[API]
LARGE_INTEGER
Single_TOKEN_PRIVILEGE
GetVersion
OpenProcessToken
GetCurrentProcess
LookupPrivilegeValueA
AdjustTokenPrivileges
CloseHandle

[CODE]
Public Sub AquirePrivilege(ByVal PrivilegeName As String)
  Dim xLong1 As Long
  Dim xType1 As Single_TOKEN_PRIVILEGE

#If Unicode Then
  If IsUnicode Then
#Else
  If (GetVersion And &H80000000) = 0& Then
#End If
    If OpenProcessToken(GetCurrentProcess(), 40&, xLong1) Then
      If LookupPrivilegeValueA(ByVal 0&, PrivilegeName, xType1.pLuid) Then
        xType1.PrivilegeCount = 1&
        xType1.Attributes = 2&
        Call AdjustTokenPrivileges(xLong1, 0&, xType1, 0&, ByVal 0&, 0&)
        End If
      Call CloseHandle(xLong1)
      End If
    End If
  End Sub
