Hello all!!, for some reason, I am getting error 997 (Overlapped I/O operation is in progress.) when running the following code (on the last Err.LastDllError check. I am allowing windows to DoEvents and all with the delay function (I got it from this forum), but I still get the error. Can someone out there help me? Thanks a lot!!

<Code>
Code:
   p_lngRtn = OpenProcessToken(GetCurrentProcess(), _
      TOKEN_ADJUST_PRIVILEGES Or TOKEN_QUERY, p_lngToken)
   If p_lngRtn = 0 Then
      Exit Function ' Failed
   ElseIf Err.LastDllError <> 0 Then
      Exit Function ' Failed
   End If

   Delay 10

   p_lngRtn = LookupPrivilegeValue(vbNullString, _
      SE_RESTORE_NAME, p_typPrevTokenPriv.Privileges(0).pLuid)
   Delay 10
   If p_lngRtn = 0 Then
      Exit Function ' Failed
   ElseIf Err.LastDllError <> 0 Then 'ERROR 997 RIGHT HERE!!!
   'MsgBox Err.Description & " LastDllError= " & Err.LastDllError & " err.number= " & Err.Number & "  err.source= " & Err.Source

     Exit Function ' Failed
   End If