PC Review


Reply
Thread Tools Rate Thread

DiskQuotaControl hangs with new user accounts

 
 
Mark
Guest
Posts: n/a
 
      30th Sep 2004

Has anyone experience of using the DiskQuotaControl library on Windows 2003?
I am having severe problems using it within a VB program to interrogate the
quota status of new user accounts.

It appears that, if you make repeated use of the control, it can fail
(taking the calling application with it) when you try to unload it. When
this happens the application log will register an event 1000, category (100)
with the description 'Faulting application (your app and version), faulting
module dskquota.dll, version 5.2.3790.0, fault address 0x00004442.'

However, once the user's quota status has been successfully checked it seems
that the control will not hang when checking the same user account in the
future.

From what I can find the problem seems similar the KB article 297835, but
that relates to Windows 2000 and was fixed in SP3. I have not had a
opportunity to test this on a Windows 2000 server yet.

Below is a sample function that I have used to reproduce the problem on 5
different Windows 2003 servers. The function will usually hang if called 3
to 10 times against a new user account.

Has anyone seen this before or am I doing something wrong?

Mark


Private Function GetFreeQuota(ByVal LogonName As String) As Long

On Error GoTo DiskErr

Dim DQQ As DiskQuotaControl
Dim DQU As DIDiskQuotaUser
Dim SID As String

'Create a new instance of DiskQuotaControl
Set DQQ = New DiskQuotaControl

'Initialise the quota volume
DQQ.Initialize "C:\", False

'Find the user's SID from the logon name
SID = DQQ.TranslateLogonNameToSID(LogonName)

'Find the disk quota user from the SID
'This is where the problem starts, comment the next
'line out and it never fails.
Set DQU = DQQ.FindUser(SID)

If Not (DQU Is Nothing) Then
GetFreeQuota = (DQU.QuotaLimit - DQU.QuotaUsed)
End If

'Release the DIDiskQuotaUser
Set DQU = Nothing

'Release the DiskQuotaControl
'This is where the problem will reveal itself, if FindUser was
'called the DiskQuota control can die with no warning taking
'the IDE (or application if compiled) with it, the only clue
'is an application log event id 1000:
'Faulting application (VB IDE or App version), faulting module
'dskquota.dll, version 5.2.3790.0, fault address 0x00004442
Set DQQ = Nothing

'We wont get this far when it fails
Exit Function

DiskErr:
'Put this here to check if there was an error
'we could handle, there isnt.
With Err
Debug.Print "Error: " & .Number & " - " & .Description
End With
End Function


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
win xp hangs on blue logon screen with no user accounts Phil Windows XP Help 0 22nd Jan 2009 02:36 AM
Windows hangs on welcome screen with no user accounts displayed Phil Windows XP General 0 20th Jan 2009 05:57 AM
User Accounts at Logon vs User Accounts in Parental Control spacejuicer Windows Vista General Discussion 1 20th Jun 2008 07:11 PM
user accounts not displayed in local groups and user accounts utility in admin tools m2 Windows XP General 2 31st May 2007 05:55 AM
synchronize w2k local user accounts and domain user accounts =?Utf-8?B?bGxveWRh?= Microsoft Windows 2000 Setup 1 30th Mar 2004 10:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:00 PM.