!
! ********************************************************************
! *                                                                  *
! *  Copyright 2001 Compaq Computer Corporation                      *
! *                                                                  *
! *  COMPAQ Registered in U.S. Patent and Trademark Office.          *
! *                                                                  *
! *  Confidential computer software. Valid license from Compaq or    *
! *  authorized sublicensor required for possession, use or copying. *
! *  Consistent with FAR 12.211 and 12.212, Commercial Computer      *
! *  Software, Computer Software Documentation, and Technical Data   *
! *  for Commercial Items are licensed to the U.S. Government under  *
! *  vendor's standard commercial license.                           *
! *                                                                  *
! ********************************************************************
!
!DEC$ IF .NOT. DEFINED (ADVAPI32_ )
!DEC$ DEFINE xADVAPI32_  
!
!
!
!         *****ADVAPI32.LIB Interfaces*****
! 
!     This module defines routine interfaces to the Windows APIs
!     for both the 32-bit (_M_IX86) and 64-bit (_M_IA64) versions of the
!     NT4 and WIN2000 operating systems.  
!
!     The base for this version is: 
!
!           Microsoft Platform Software Development Kit (SDK)
!                Win64 Pre-alpha February 2000
!
!     As with the C header files distributed with the SDK, there
!     is only one common set of files for both 64-bit and 32-bit
!     operating systems.
!   
!     Within the Fortran versions of the header files, the
!     following symbols are used to control the compilation.
! 
!     _M_IA64 conditionally compiles items for 64 bit systems.
!     _M_IX86 conditionally compiles items for 32 bit systesm.
!
!     Known problems: 
!
!07-12-00
!
module advapi32
use dfwinty
!DEC$OBJCOMMENT LIB:"ADVAPI32.LIB"
!
INTERFACE 
FUNCTION EncryptFile( &
        lpFileName)
USE DFWINTY
  integer(BOOL) :: EncryptFile ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'EncryptFileA' :: EncryptFile
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpFileName
  character*(*) lpFileName ! LPCSTR lpFileName
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION DecryptFile( &
        lpFileName, &
        dwReserved)
USE DFWINTY
  integer(BOOL) :: DecryptFile ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'DecryptFileA' :: DecryptFile
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpFileName
  character*(*) lpFileName ! LPCSTR lpFileName
  integer(DWORD) dwReserved ! DWORD dwReserved
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION FileEncryptionStatus( &
        lpFileName, &
        lpStatus)
USE DFWINTY
  integer(BOOL) :: FileEncryptionStatus ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'FileEncryptionStatusA' :: FileEncryptionStatus
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpFileName
  character*(*) lpFileName ! LPCSTR lpFileName
  integer(LPDWORD) lpStatus ! LPDWORD lpStatus
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION OpenEncryptedFileRaw( &
        lpFileName, &
        ulFlags, &
        pvContext)
USE DFWINTY
  integer(DWORD) :: OpenEncryptedFileRaw ! DWORD
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'OpenEncryptedFileRawA' :: OpenEncryptedFileRaw
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpFileName
  character*(*) lpFileName ! LPCSTR lpFileName
  integer(ULONG) ulFlags ! ULONG ulFlags
!DEC$ ATTRIBUTES REFERENCE :: pvContext
  integer(PVOID)  pvContext ! PVOID*  pvContext
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION ReadEncryptedFileRaw( &
        pfExportCallback, &
        pvCallbackContext, &
        pvContext)
USE DFWINTY
  integer(DWORD) :: ReadEncryptedFileRaw ! DWORD
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'ReadEncryptedFileRaw' :: ReadEncryptedFileRaw
  integer(LPVOID) pfExportCallback ! PFE_EXPORT_FUNC pfExportCallback
  integer(PVOID) pvCallbackContext ! PVOID pvCallbackContext
  integer(PVOID) pvContext ! PVOID pvContext
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION WriteEncryptedFileRaw( &
        pfImportCallback, &
        pvCallbackContext, &
        pvContext)
USE DFWINTY
  integer(DWORD) :: WriteEncryptedFileRaw ! DWORD
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'WriteEncryptedFileRaw' :: WriteEncryptedFileRaw
  integer(LPVOID) pfImportCallback ! PFE_IMPORT_FUNC pfImportCallback
  integer(PVOID) pvCallbackContext ! PVOID pvCallbackContext
  integer(PVOID) pvContext ! PVOID pvContext
 END FUNCTION
END INTERFACE
INTERFACE 
   SUBROUTINE CloseEncryptedFileRaw( &
        pvContext)
USE DFWINTY
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CloseEncryptedFileRaw' :: CloseEncryptedFileRaw
  integer(PVOID) pvContext ! PVOID pvContext
 END SUBROUTINE
END INTERFACE
INTERFACE 
FUNCTION IsTextUnicode( &
        lpBuffer, &
        cb, &
        lpi)
USE DFWINTY
  integer(BOOL) :: IsTextUnicode ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'IsTextUnicode' :: IsTextUnicode
  integer(LPVOID) lpBuffer ! LPVOID lpBuffer
  integer(SINT) cb ! int cb
  integer(LPINT) lpi ! LPINT lpi
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION ClearEventLog( &
        hEventLog, &
        lpBackupFileName)
USE DFWINTY
  integer(BOOL) :: ClearEventLog ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'ClearEventLogA' :: ClearEventLog
  integer(HANDLE) hEventLog ! HANDLE hEventLog
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpBackupFileName
  character*(*) lpBackupFileName ! LPCSTR lpBackupFileName
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION BackupEventLog( &
        hEventLog, &
        lpBackupFileName)
USE DFWINTY
  integer(BOOL) :: BackupEventLog ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'BackupEventLogA' :: BackupEventLog
  integer(HANDLE) hEventLog ! HANDLE hEventLog
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpBackupFileName
  character*(*) lpBackupFileName ! LPCSTR lpBackupFileName
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CloseEventLog( &
        hEventLog)
USE DFWINTY
  integer(BOOL) :: CloseEventLog ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CloseEventLog' :: CloseEventLog
  integer(HANDLE) hEventLog ! HANDLE hEventLog
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION DeregisterEventSource( &
        hEventLog)
USE DFWINTY
  integer(BOOL) :: DeregisterEventSource ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'DeregisterEventSource' :: DeregisterEventSource
  integer(HANDLE) hEventLog ! HANDLE hEventLog
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION NotifyChangeEventLog( &
        hEventLog, &
        hEvent)
USE DFWINTY
  integer(BOOL) :: NotifyChangeEventLog ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'NotifyChangeEventLog' :: NotifyChangeEventLog
  integer(HANDLE) hEventLog ! HANDLE hEventLog
  integer(HANDLE) hEvent ! HANDLE hEvent
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetNumberOfEventLogRecords( &
        hEventLog, &
        NumberOfRecords)
USE DFWINTY
  integer(BOOL) :: GetNumberOfEventLogRecords ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetNumberOfEventLogRecords' :: GetNumberOfEventLogRecords
  integer(HANDLE) hEventLog ! HANDLE hEventLog
  integer(LPDWORD) NumberOfRecords ! PDWORD NumberOfRecords
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetOldestEventLogRecord( &
        hEventLog, &
        OldestRecord)
USE DFWINTY
  integer(BOOL) :: GetOldestEventLogRecord ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetOldestEventLogRecord' :: GetOldestEventLogRecord
  integer(HANDLE) hEventLog ! HANDLE hEventLog
  integer(LPDWORD) OldestRecord ! PDWORD OldestRecord
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION OpenEventLog( &
        lpUNCServerName, &
        lpSourceName)
USE DFWINTY
  integer(HANDLE) :: OpenEventLog ! HANDLE
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'OpenEventLogA' :: OpenEventLog
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpUNCServerName
  character*(*) lpUNCServerName ! LPCSTR lpUNCServerName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpSourceName
  character*(*) lpSourceName ! LPCSTR lpSourceName
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegisterEventSource( &
        lpUNCServerName, &
        lpSourceName)
USE DFWINTY
  integer(HANDLE) :: RegisterEventSource ! HANDLE
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegisterEventSourceA' :: RegisterEventSource
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpUNCServerName
  character*(*) lpUNCServerName ! LPCSTR lpUNCServerName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpSourceName
  character*(*) lpSourceName ! LPCSTR lpSourceName
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION OpenBackupEventLog( &
        lpUNCServerName, &
        lpFileName)
USE DFWINTY
  integer(HANDLE) :: OpenBackupEventLog ! HANDLE
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'OpenBackupEventLogA' :: OpenBackupEventLog
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpUNCServerName
  character*(*) lpUNCServerName ! LPCSTR lpUNCServerName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpFileName
  character*(*) lpFileName ! LPCSTR lpFileName
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION ReadEventLog( &
        hEventLog, &
        dwReadFlags, &
        dwRecordOffset, &
        lpBuffer, &
        nNumberOfBytesToRead, &
        pnBytesRead, &
        pnMinNumberOfBytesNeeded)
USE DFWINTY
  integer(BOOL) :: ReadEventLog ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'ReadEventLogA' :: ReadEventLog
  integer(HANDLE) hEventLog ! HANDLE hEventLog
  integer(DWORD) dwReadFlags ! DWORD dwReadFlags
  integer(DWORD) dwRecordOffset ! DWORD dwRecordOffset
  integer(LPVOID) lpBuffer ! LPVOID lpBuffer
  integer(DWORD) nNumberOfBytesToRead ! DWORD nNumberOfBytesToRead
!DEC$ ATTRIBUTES REFERENCE :: pnBytesRead
integer(DWORD) pnBytesRead ! DWORD* pnBytesRead
!DEC$ ATTRIBUTES REFERENCE :: pnMinNumberOfBytesNeeded
integer(DWORD) pnMinNumberOfBytesNeeded ! DWORD* pnMinNumberOfBytesNeeded
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION ReportEvent( &
        hEventLog, &
        wType, &
        wCategory, &
        dwEventID, &
        lpUserSid, &
        wNumStrings, &
        dwDataSize, &
        lpStrings, &
        lpRawData)
USE DFWINTY
  integer(BOOL) :: ReportEvent ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'ReportEventA' :: ReportEvent
  integer(HANDLE) hEventLog ! HANDLE hEventLog
  integer(WORD) wType ! WORD wType
  integer(WORD) wCategory ! WORD wCategory
  integer(DWORD) dwEventID ! DWORD dwEventID
  integer(PVOID) lpUserSid ! PSID lpUserSid
  integer(WORD) wNumStrings ! WORD wNumStrings
  integer(DWORD) dwDataSize ! DWORD dwDataSize
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: lpStrings
  integer(LPCSTR) lpStrings ! LPCSTR* lpStrings
  integer(LPVOID) lpRawData ! LPVOID lpRawData
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetEventLogInformation( &
        hEventLog, &
        dwInfoLevel, &
        lpBuffer, &
        cbBufSize, &
        pcbBytesNeeded)
USE DFWINTY
  integer(BOOL) :: GetEventLogInformation ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetEventLogInformation' :: GetEventLogInformation
  integer(HANDLE) hEventLog ! HANDLE hEventLog
  integer(DWORD) dwInfoLevel ! DWORD dwInfoLevel
  integer(LPVOID) lpBuffer ! LPVOID lpBuffer
  integer(DWORD) cbBufSize ! DWORD cbBufSize
  integer(LPDWORD) pcbBytesNeeded ! LPDWORD pcbBytesNeeded
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION DuplicateToken( &
        ExistingTokenHandle, &
        ImpersonationLevel, &
        DuplicateTokenHandle)
USE DFWINTY
  integer(BOOL) :: DuplicateToken ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'DuplicateToken' :: DuplicateToken
  integer(HANDLE) ExistingTokenHandle ! HANDLE ExistingTokenHandle
  integer(ENUM) ImpersonationLevel ! SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
!DEC$ ATTRIBUTES REFERENCE :: DuplicateTokenHandle
  integer(HANDLE) DuplicateTokenHandle ! PHANDLE DuplicateTokenHandle
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetKernelObjectSecurity( &
        aHandle, &
        RequestedInformation, &
        pSecurityDescriptor, &
        nLength, &
        lpnLengthNeeded)
USE DFWINTY
  integer(BOOL) :: GetKernelObjectSecurity ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetKernelObjectSecurity' :: GetKernelObjectSecurity
  integer(HANDLE) aHandle ! HANDLE Handle
  integer(ULONG) RequestedInformation ! SECURITY_INFORMATION RequestedInformation
  integer(LPVOID) pSecurityDescriptor ! PSECURITY_DESCRIPTOR pSecurityDescriptor
  integer(DWORD) nLength ! DWORD nLength
  integer(LPDWORD) lpnLengthNeeded ! LPDWORD lpnLengthNeeded
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION ImpersonateNamedPipeClient( &
        hNamedPipe)
USE DFWINTY
  integer(BOOL) :: ImpersonateNamedPipeClient ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'ImpersonateNamedPipeClient' :: ImpersonateNamedPipeClient
  integer(HANDLE) hNamedPipe ! HANDLE hNamedPipe
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION ImpersonateSelf( &
        ImpersonationLevel)
USE DFWINTY
  integer(BOOL) :: ImpersonateSelf ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'ImpersonateSelf' :: ImpersonateSelf
  integer(ENUM) ImpersonationLevel ! SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RevertToSelf( &
             )
USE DFWINTY
  integer(BOOL) :: RevertToSelf ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RevertToSelf' :: RevertToSelf
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION SetThreadToken( &
        Thread, &
        Token)
USE DFWINTY
  integer(BOOL) :: SetThreadToken ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'SetThreadToken' :: SetThreadToken
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: Thread
  integer(HANDLE) Thread ! PHANDLE Thread
  integer(HANDLE) Token ! HANDLE Token
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION AccessCheck( &
        pSecurityDescriptor, &
        ClientToken, &
        DesiredAccess, &
        GenericMapping, &
        PrivilegeSet, &
        PrivilegeSetLength, &
        GrantedAccess, &
        AccessStatus)
USE DFWINTY
  integer(BOOL) :: AccessCheck ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'AccessCheck' :: AccessCheck
  integer(LPVOID) pSecurityDescriptor ! PSECURITY_DESCRIPTOR pSecurityDescriptor
  integer(HANDLE) ClientToken ! HANDLE ClientToken
  integer(DWORD) DesiredAccess ! DWORD DesiredAccess
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: GenericMapping
  TYPE(T_GENERIC_MAPPING)  GenericMapping ! PGENERIC_MAPPING GenericMapping
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: PrivilegeSet
  TYPE (T_PRIVILEGE_SET) PrivilegeSet ! PPRIVILEGE_SET PrivilegeSet
  integer(LPDWORD) PrivilegeSetLength ! LPDWORD PrivilegeSetLength
  integer(LPDWORD) GrantedAccess ! LPDWORD GrantedAccess
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: AccessStatus
  integer(BOOL) AccessStatus ! LPBOOL AccessStatus
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION OpenProcessToken( &
        ProcessHandle, &
        DesiredAccess, &
        TokenHandle)
USE DFWINTY
  integer(BOOL) :: OpenProcessToken ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'OpenProcessToken' :: OpenProcessToken
  integer(HANDLE) ProcessHandle ! HANDLE ProcessHandle
  integer(DWORD) DesiredAccess ! DWORD DesiredAccess
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: TokenHandle
  integer(HANDLE) TokenHandle ! PHANDLE TokenHandle
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION OpenThreadToken( &
        ThreadHandle, &
        DesiredAccess, &
        OpenAsSelf, &
        TokenHandle)
USE DFWINTY
  integer(BOOL) :: OpenThreadToken ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'OpenThreadToken' :: OpenThreadToken
  integer(HANDLE) ThreadHandle ! HANDLE ThreadHandle
  integer(DWORD) DesiredAccess ! DWORD DesiredAccess
  integer(BOOL) OpenAsSelf ! BOOL OpenAsSelf
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: TokenHandle
  integer(HANDLE) TokenHandle ! PHANDLE TokenHandle
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetTokenInformation( &
        TokenHandle, &
        TokenInformationClass, &
        TokenInformation, &
        TokenInformationLength, &
        ReturnLength)
USE DFWINTY
  integer(BOOL) :: GetTokenInformation ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetTokenInformation' :: GetTokenInformation
  integer(HANDLE) TokenHandle ! HANDLE TokenHandle
  integer(ENUM) TokenInformationClass ! TOKEN_INFORMATION_CLASS TokenInformationClass
  integer(LPVOID) TokenInformation ! LPVOID TokenInformation
  integer(DWORD) TokenInformationLength ! DWORD TokenInformationLength
  integer(LPDWORD) ReturnLength ! PDWORD ReturnLength
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION SetTokenInformation( &
        TokenHandle, &
        TokenInformationClass, &
        TokenInformation, &
        TokenInformationLength)
USE DFWINTY
  integer(BOOL) :: SetTokenInformation ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'SetTokenInformation' :: SetTokenInformation
  integer(HANDLE) TokenHandle ! HANDLE TokenHandle
  integer(ENUM) TokenInformationClass ! TOKEN_INFORMATION_CLASS TokenInformationClass
  integer(LPVOID) TokenInformation ! LPVOID TokenInformation
  integer(DWORD) TokenInformationLength ! DWORD TokenInformationLength
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION AdjustTokenPrivileges( &
        TokenHandle, &
        DisableAllPrivileges, &
        NewState, &
        BufferLength, &
        PreviousState, &
        ReturnLength)
USE DFWINTY
  integer(BOOL) :: AdjustTokenPrivileges ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'AdjustTokenPrivileges' :: AdjustTokenPrivileges
  integer(HANDLE) TokenHandle ! HANDLE TokenHandle
  integer(BOOL) DisableAllPrivileges ! BOOL DisableAllPrivileges
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: NewState
  TYPE (T_TOKEN_PRIVILEGES) NewState ! PTOKEN_PRIVILEGES NewState
  integer(DWORD) BufferLength ! DWORD BufferLength
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: PreviousState
  TYPE (T_TOKEN_PRIVILEGES) PreviousState ! PTOKEN_PRIVILEGES PreviousState
  integer(LPDWORD) ReturnLength ! PDWORD ReturnLength
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION AdjustTokenGroups( &
        TokenHandle, &
        ResetToDefault, &
        NewState, &
        BufferLength, &
        PreviousState, &
        ReturnLength)
USE DFWINTY
  integer(BOOL) :: AdjustTokenGroups ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'AdjustTokenGroups' :: AdjustTokenGroups
  integer(HANDLE) TokenHandle ! HANDLE TokenHandle
  integer(BOOL) ResetToDefault ! BOOL ResetToDefault
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: NewState
  TYPE (T_TOKEN_GROUPS) NewState ! PTOKEN_GROUPS NewState
  integer(DWORD) BufferLength ! DWORD BufferLength
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: PreviousState
  TYPE (T_TOKEN_GROUPS) PreviousState ! PTOKEN_GROUPS PreviousState
  integer(LPDWORD) ReturnLength ! PDWORD ReturnLength
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION PrivilegeCheck( &
        ClientToken, &
        RequiredPrivileges, &
        pfResult)
USE DFWINTY
  integer(BOOL) :: PrivilegeCheck ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'PrivilegeCheck' :: PrivilegeCheck
  integer(HANDLE) ClientToken ! HANDLE ClientToken
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: RequiredPrivileges
  TYPE (T_PRIVILEGE_SET) RequiredPrivileges ! PPRIVILEGE_SET RequiredPrivileges
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: pfResult
  integer(BOOL) pfResult ! LPBOOL pfResult
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION AccessCheckAndAuditAlarm( &
        SubsystemName, &
        HandleId, &
        ObjectTypeName, &
        ObjectName, &
        SecurityDescriptor, &
        DesiredAccess, &
        GenericMapping, &
        ObjectCreation, &
        GrantedAccess, &
        AccessStatus, &
        pfGenerateOnClose)
USE DFWINTY
  integer(BOOL) :: AccessCheckAndAuditAlarm ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'AccessCheckAndAuditAlarmA' :: AccessCheckAndAuditAlarm
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: SubsystemName
  character*(*) SubsystemName ! LPCSTR SubsystemName
  integer(LPVOID) HandleId ! LPVOID HandleId
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: ObjectTypeName
  character*(*) ObjectTypeName ! LPSTR ObjectTypeName
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: ObjectName
  character*(*) ObjectName ! LPSTR ObjectName
  integer(LPVOID) SecurityDescriptor ! PSECURITY_DESCRIPTOR SecurityDescriptor
  integer(DWORD) DesiredAccess ! DWORD DesiredAccess
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: GenericMapping
  TYPE(T_GENERIC_MAPPING)  GenericMapping ! PGENERIC_MAPPING GenericMapping
  integer(BOOL) ObjectCreation ! BOOL ObjectCreation
  integer(LPDWORD) GrantedAccess ! LPDWORD GrantedAccess
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: AccessStatus
  integer(BOOL) AccessStatus ! LPBOOL AccessStatus
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: pfGenerateOnClose
  integer(BOOL) pfGenerateOnClose ! LPBOOL pfGenerateOnClose
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION ObjectOpenAuditAlarm( &
        SubsystemName, &
        HandleId, &
        ObjectTypeName, &
        ObjectName, &
        pSecurityDescriptor, &
        ClientToken, &
        DesiredAccess, &
        GrantedAccess, &
        Privileges, &
        ObjectCreation, &
        AccessGranted, &
        GenerateOnClose)
USE DFWINTY
  integer(BOOL) :: ObjectOpenAuditAlarm ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'ObjectOpenAuditAlarmA' :: ObjectOpenAuditAlarm
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: SubsystemName
  character*(*) SubsystemName ! LPCSTR SubsystemName
  integer(LPVOID) HandleId ! LPVOID HandleId
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: ObjectTypeName
  character*(*) ObjectTypeName ! LPSTR ObjectTypeName
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: ObjectName
  character*(*) ObjectName ! LPSTR ObjectName
  integer(LPVOID) pSecurityDescriptor ! PSECURITY_DESCRIPTOR pSecurityDescriptor
  integer(HANDLE) ClientToken ! HANDLE ClientToken
  integer(DWORD) DesiredAccess ! DWORD DesiredAccess
  integer(DWORD) GrantedAccess ! DWORD GrantedAccess
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: Privileges
  TYPE (T_PRIVILEGE_SET) Privileges ! PPRIVILEGE_SET Privileges
  integer(BOOL) ObjectCreation ! BOOL ObjectCreation
  integer(BOOL) AccessGranted ! BOOL AccessGranted
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: GenerateOnClose
  integer(BOOL) GenerateOnClose ! LPBOOL GenerateOnClose
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION ObjectPrivilegeAuditAlarm( &
        SubsystemName, &
        HandleId, &
        ClientToken, &
        DesiredAccess, &
        Privileges, &
        AccessGranted)
USE DFWINTY
  integer(BOOL) :: ObjectPrivilegeAuditAlarm ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'ObjectPrivilegeAuditAlarmA' :: ObjectPrivilegeAuditAlarm
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: SubsystemName
  character*(*) SubsystemName ! LPCSTR SubsystemName
  integer(LPVOID) HandleId ! LPVOID HandleId
  integer(HANDLE) ClientToken ! HANDLE ClientToken
  integer(DWORD) DesiredAccess ! DWORD DesiredAccess
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: Privileges
  TYPE (T_PRIVILEGE_SET) Privileges ! PPRIVILEGE_SET Privileges
  integer(BOOL) AccessGranted ! BOOL AccessGranted
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION ObjectCloseAuditAlarm( &
        SubsystemName, &
        HandleId, &
        GenerateOnClose)
USE DFWINTY
  integer(BOOL) :: ObjectCloseAuditAlarm ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'ObjectCloseAuditAlarmA' :: ObjectCloseAuditAlarm
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: SubsystemName
  character*(*) SubsystemName ! LPCSTR SubsystemName
  integer(LPVOID) HandleId ! LPVOID HandleId
  integer(BOOL) GenerateOnClose ! BOOL GenerateOnClose
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION ObjectDeleteAuditAlarm( &
        SubsystemName, &
        HandleId, &
        GenerateOnClose)
USE DFWINTY
  integer(BOOL) :: ObjectDeleteAuditAlarm ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'ObjectDeleteAuditAlarmA' :: ObjectDeleteAuditAlarm
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: SubsystemName
  character*(*) SubsystemName ! LPCSTR SubsystemName
  integer(LPVOID) HandleId ! LPVOID HandleId
  integer(BOOL) GenerateOnClose ! BOOL GenerateOnClose
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION PrivilegedServiceAuditAlarm( &
        SubsystemName, &
        ServiceName, &
        ClientToken, &
        Privileges, &
        AccessGranted)
USE DFWINTY
  integer(BOOL) :: PrivilegedServiceAuditAlarm ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'PrivilegedServiceAuditAlarmA' :: PrivilegedServiceAuditAlarm
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: SubsystemName
  character*(*) SubsystemName ! LPCSTR SubsystemName
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: ServiceName
  character*(*) ServiceName ! LPCSTR ServiceName
  integer(HANDLE) ClientToken ! HANDLE ClientToken
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: Privileges
  TYPE (T_PRIVILEGE_SET) Privileges ! PPRIVILEGE_SET Privileges
  integer(BOOL) AccessGranted ! BOOL AccessGranted
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION IsValidSid( &
        pSid)
USE DFWINTY
  integer(BOOL) :: IsValidSid ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'IsValidSid' :: IsValidSid
  integer(PVOID) pSid ! PSID pSid
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION EqualSid( &
        pSid1, &
        pSid2)
USE DFWINTY
  integer(BOOL) :: EqualSid ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'EqualSid' :: EqualSid
  integer(PVOID) pSid1 ! PSID pSid1
  integer(PVOID) pSid2 ! PSID pSid2
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION EqualPrefixSid( &
        pSid1, &
        pSid2)
USE DFWINTY
  integer(BOOL) :: EqualPrefixSid ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'EqualPrefixSid' :: EqualPrefixSid
  integer(PVOID) pSid1 ! PSID pSid1
  integer(PVOID) pSid2 ! PSID pSid2
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetSidLengthRequired( &
        nSubAuthorityCount)
USE DFWINTY
  integer(DWORD) :: GetSidLengthRequired ! DWORD
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetSidLengthRequired' :: GetSidLengthRequired
  character*1 nSubAuthorityCount ! UCHAR nSubAuthorityCount
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION AllocateAndInitializeSid( &
        pIdentifierAuthority, &
        nSubAuthorityCount, &
        nSubAuthority0, &
        nSubAuthority1, &
        nSubAuthority2, &
        nSubAuthority3, &
        nSubAuthority4, &
        nSubAuthority5, &
        nSubAuthority6, &
        nSubAuthority7, &
        pSid)
USE DFWINTY
  integer(BOOL) :: AllocateAndInitializeSid ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'AllocateAndInitializeSid' :: AllocateAndInitializeSid
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: pIdentifierAuthority
  TYPE (T_SID_IDENTIFIER_AUTHORITY) pIdentifierAuthority ! PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority
  integer(BYTE) nSubAuthorityCount ! BYTE nSubAuthorityCount
  integer(DWORD) nSubAuthority0 ! DWORD nSubAuthority0
  integer(DWORD) nSubAuthority1 ! DWORD nSubAuthority1
  integer(DWORD) nSubAuthority2 ! DWORD nSubAuthority2
  integer(DWORD) nSubAuthority3 ! DWORD nSubAuthority3
  integer(DWORD) nSubAuthority4 ! DWORD nSubAuthority4
  integer(DWORD) nSubAuthority5 ! DWORD nSubAuthority5
  integer(DWORD) nSubAuthority6 ! DWORD nSubAuthority6
  integer(DWORD) nSubAuthority7 ! DWORD nSubAuthority7
!DEC$ ATTRIBUTES REFERENCE :: pSid
  integer(PVOID) pSid ! PSID* pSid
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION FreeSid( &
        pSid)
USE DFWINTY
  integer(PVOID) :: FreeSid ! PVOID
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'FreeSid' :: FreeSid
  integer(PVOID) pSid ! PSID pSid
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION InitializeSid( &
        Sid, &
        pIdentifierAuthority, &
        nSubAuthorityCount)
USE DFWINTY
  integer(BOOL) :: InitializeSid ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'InitializeSid' :: InitializeSid
  integer(PVOID) Sid ! PSID Sid
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: pIdentifierAuthority
  TYPE (T_SID_IDENTIFIER_AUTHORITY) pIdentifierAuthority ! PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority
  integer(BYTE) nSubAuthorityCount ! BYTE nSubAuthorityCount
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetSidIdentifierAuthority( &
        pSid)
USE DFWINTY
 integer(LPVOID):: GetSidIdentifierAuthority ! PSID_IDENTIFIER_AUTHORITY
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetSidIdentifierAuthority' :: GetSidIdentifierAuthority
  integer(PVOID) pSid ! PSID pSid
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetSidSubAuthority( &
        pSid, &
        nSubAuthority)
USE DFWINTY
  integer(PDWORD) :: GetSidSubAuthority ! PDWORD
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetSidSubAuthority' :: GetSidSubAuthority
  integer(PVOID) pSid ! PSID pSid
  integer(DWORD) nSubAuthority ! DWORD nSubAuthority
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetSidSubAuthorityCount( &
        pSid)
USE DFWINTY
  integer(PUCHAR) :: GetSidSubAuthorityCount ! PUCHAR
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetSidSubAuthorityCount' :: GetSidSubAuthorityCount
  integer(PVOID) pSid ! PSID pSid
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetLengthSid( &
        pSid)
USE DFWINTY
  integer(DWORD) :: GetLengthSid ! DWORD
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetLengthSid' :: GetLengthSid
  integer(PVOID) pSid ! PSID pSid
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CopySid( &
        nDestinationSidLength, &
        pDestinationSid, &
        pSourceSid)
USE DFWINTY
  integer(BOOL) :: CopySid ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CopySid' :: CopySid
  integer(DWORD) nDestinationSidLength ! DWORD nDestinationSidLength
  integer(PVOID) pDestinationSid ! PSID pDestinationSid
  integer(PVOID) pSourceSid ! PSID pSourceSid
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION AreAllAccessesGranted( &
        GrantedAccess, &
        DesiredAccess)
USE DFWINTY
  integer(BOOL) :: AreAllAccessesGranted ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'AreAllAccessesGranted' :: AreAllAccessesGranted
  integer(DWORD) GrantedAccess ! DWORD GrantedAccess
  integer(DWORD) DesiredAccess ! DWORD DesiredAccess
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION AreAnyAccessesGranted( &
        GrantedAccess, &
        DesiredAccess)
USE DFWINTY
  integer(BOOL) :: AreAnyAccessesGranted ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'AreAnyAccessesGranted' :: AreAnyAccessesGranted
  integer(DWORD) GrantedAccess ! DWORD GrantedAccess
  integer(DWORD) DesiredAccess ! DWORD DesiredAccess
 END FUNCTION
END INTERFACE
INTERFACE 
   SUBROUTINE MapGenericMask( &
        AccessMask, &
        GenericMapping)
USE DFWINTY
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'MapGenericMask' :: MapGenericMask
  integer(LPDWORD) AccessMask ! PDWORD AccessMask
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: GenericMapping
  TYPE(T_GENERIC_MAPPING)  GenericMapping ! PGENERIC_MAPPING GenericMapping
 END SUBROUTINE
END INTERFACE
INTERFACE 
FUNCTION IsValidAcl( &
        pAcl)
USE DFWINTY
  integer(BOOL) :: IsValidAcl ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'IsValidAcl' :: IsValidAcl
  integer(LPVOID) pAcl ! PACL pAcl
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION InitializeAcl( &
        pAcl, &
        nAclLength, &
        dwAclRevision)
USE DFWINTY
  integer(BOOL) :: InitializeAcl ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'InitializeAcl' :: InitializeAcl
  integer(LPVOID) pAcl ! PACL pAcl
  integer(DWORD) nAclLength ! DWORD nAclLength
  integer(DWORD) dwAclRevision ! DWORD dwAclRevision
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetAclInformation( &
        pAcl, &
        pAclInformation, &
        nAclInformationLength, &
        dwAclInformationClass)
USE DFWINTY
  integer(BOOL) :: GetAclInformation ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetAclInformation' :: GetAclInformation
  integer(LPVOID) pAcl ! PACL pAcl
  integer(LPVOID) pAclInformation ! LPVOID pAclInformation
  integer(DWORD) nAclInformationLength ! DWORD nAclInformationLength
  integer(ENUM) dwAclInformationClass ! ACL_INFORMATION_CLASS dwAclInformationClass
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION SetAclInformation( &
        pAcl, &
        pAclInformation, &
        nAclInformationLength, &
        dwAclInformationClass)
USE DFWINTY
  integer(BOOL) :: SetAclInformation ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'SetAclInformation' :: SetAclInformation
  integer(LPVOID) pAcl ! PACL pAcl
  integer(LPVOID) pAclInformation ! LPVOID pAclInformation
  integer(DWORD) nAclInformationLength ! DWORD nAclInformationLength
  integer(ENUM) dwAclInformationClass ! ACL_INFORMATION_CLASS dwAclInformationClass
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION AddAce( &
        pAcl, &
        dwAceRevision, &
        dwStartingAceIndex, &
        pAceList, &
        nAceListLength)
USE DFWINTY
  integer(BOOL) :: AddAce ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'AddAce' :: AddAce
  integer(LPVOID) pAcl ! PACL pAcl
  integer(DWORD) dwAceRevision ! DWORD dwAceRevision
  integer(DWORD) dwStartingAceIndex ! DWORD dwStartingAceIndex
  integer(LPVOID) pAceList ! LPVOID pAceList
  integer(DWORD) nAceListLength ! DWORD nAceListLength
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION DeleteAce( &
        pAcl, &
        dwAceIndex)
USE DFWINTY
  integer(BOOL) :: DeleteAce ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'DeleteAce' :: DeleteAce
  integer(LPVOID) pAcl ! PACL pAcl
  integer(DWORD) dwAceIndex ! DWORD dwAceIndex
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetAce( &
        pAcl, &
        dwAceIndex, &
        pAce)
USE DFWINTY
  integer(BOOL) :: GetAce ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetAce' :: GetAce
  integer(LPVOID) pAcl ! PACL pAcl
  integer(DWORD) dwAceIndex ! DWORD dwAceIndex
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: pAce
  integer(LPVOID) pAce ! LPVOID* pAce
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION AddAccessAllowedAce( &
        pAcl, &
        dwAceRevision, &
        AccessMask, &
        pSid)
USE DFWINTY
  integer(BOOL) :: AddAccessAllowedAce ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'AddAccessAllowedAce' :: AddAccessAllowedAce
  integer(LPVOID) pAcl ! PACL pAcl
  integer(DWORD) dwAceRevision ! DWORD dwAceRevision
  integer(DWORD) AccessMask ! DWORD AccessMask
  integer(PVOID) pSid ! PSID pSid
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION AddAccessDeniedAce( &
        pAcl, &
        dwAceRevision, &
        AccessMask, &
        pSid)
USE DFWINTY
  integer(BOOL) :: AddAccessDeniedAce ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'AddAccessDeniedAce' :: AddAccessDeniedAce
  integer(LPVOID) pAcl ! PACL pAcl
  integer(DWORD) dwAceRevision ! DWORD dwAceRevision
  integer(DWORD) AccessMask ! DWORD AccessMask
  integer(PVOID) pSid ! PSID pSid
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION AddAuditAccessAce( &
        pAcl, &
        dwAceRevision, &
        dwAccessMask, &
        pSid, &
        bAuditSuccess, &
        bAuditFailure)
USE DFWINTY
  integer(BOOL) :: AddAuditAccessAce ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'AddAuditAccessAce' :: AddAuditAccessAce
  integer(LPVOID) pAcl ! PACL pAcl
  integer(DWORD) dwAceRevision ! DWORD dwAceRevision
  integer(DWORD) dwAccessMask ! DWORD dwAccessMask
  integer(PVOID) pSid ! PSID pSid
  integer(BOOL) bAuditSuccess ! BOOL bAuditSuccess
  integer(BOOL) bAuditFailure ! BOOL bAuditFailure
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION FindFirstFreeAce( &
        pAcl, &
        pAce)
USE DFWINTY
  integer(BOOL) :: FindFirstFreeAce ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'FindFirstFreeAce' :: FindFirstFreeAce
  integer(LPVOID) pAcl ! PACL pAcl
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: pAce
  integer(LPVOID) pAce ! LPVOID* pAce
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION InitializeSecurityDescriptor( &
        pSecurityDescriptor, &
        dwRevision)
USE DFWINTY
  integer(BOOL) :: InitializeSecurityDescriptor ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'InitializeSecurityDescriptor' :: InitializeSecurityDescriptor
  integer(LPVOID) pSecurityDescriptor ! PSECURITY_DESCRIPTOR pSecurityDescriptor
  integer(DWORD) dwRevision ! DWORD dwRevision
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION IsValidSecurityDescriptor( &
        pSecurityDescriptor)
USE DFWINTY
  integer(BOOL) :: IsValidSecurityDescriptor ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'IsValidSecurityDescriptor' :: IsValidSecurityDescriptor
  integer(LPVOID) pSecurityDescriptor ! PSECURITY_DESCRIPTOR pSecurityDescriptor
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetSecurityDescriptorLength( &
        pSecurityDescriptor)
USE DFWINTY
  integer(DWORD) :: GetSecurityDescriptorLength ! DWORD
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetSecurityDescriptorLength' :: GetSecurityDescriptorLength
  integer(LPVOID) pSecurityDescriptor ! PSECURITY_DESCRIPTOR pSecurityDescriptor
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetSecurityDescriptorControl( &
        pSecurityDescriptor, &
        pControl, &
        lpdwRevision)
USE DFWINTY
  integer(BOOL) :: GetSecurityDescriptorControl ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetSecurityDescriptorControl' :: GetSecurityDescriptorControl
  integer(LPVOID) pSecurityDescriptor ! PSECURITY_DESCRIPTOR pSecurityDescriptor
  integer(LPWORD) pControl ! PSECURITY_DESCRIPTOR_CONTROL pControl
  integer(LPDWORD) lpdwRevision ! LPDWORD lpdwRevision
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION SetSecurityDescriptorDacl( &
        pSecurityDescriptor, &
        bDaclPresent, &
        pDacl, &
        bDaclDefaulted)
USE DFWINTY
  integer(BOOL) :: SetSecurityDescriptorDacl ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'SetSecurityDescriptorDacl' :: SetSecurityDescriptorDacl
  integer(LPVOID) pSecurityDescriptor ! PSECURITY_DESCRIPTOR pSecurityDescriptor
  integer(BOOL) bDaclPresent ! BOOL bDaclPresent
  integer(LPVOID) pDacl ! PACL pDacl
  integer(BOOL) bDaclDefaulted ! BOOL bDaclDefaulted
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetSecurityDescriptorDacl( &
        pSecurityDescriptor, &
        lpbDaclPresent, &
        pDacl, &
        lpbDaclDefaulted)
USE DFWINTY
  integer(BOOL) :: GetSecurityDescriptorDacl ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetSecurityDescriptorDacl' :: GetSecurityDescriptorDacl
  integer(LPVOID) pSecurityDescriptor ! PSECURITY_DESCRIPTOR pSecurityDescriptor
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: lpbDaclPresent
  integer(BOOL) lpbDaclPresent ! LPBOOL lpbDaclPresent
  integer(LPVOID) pDacl ! PACL* pDacl - output, pointer to a pointer to a T_ACL
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: lpbDaclDefaulted
  integer(BOOL) lpbDaclDefaulted ! LPBOOL lpbDaclDefaulted
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION SetSecurityDescriptorSacl( &
        pSecurityDescriptor, &
        bSaclPresent, &
        pSacl, &
        bSaclDefaulted)
USE DFWINTY
  integer(BOOL) :: SetSecurityDescriptorSacl ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'SetSecurityDescriptorSacl' :: SetSecurityDescriptorSacl
  integer(LPVOID) pSecurityDescriptor ! PSECURITY_DESCRIPTOR pSecurityDescriptor
  integer(BOOL) bSaclPresent ! BOOL bSaclPresent
  integer(LPVOID) pSacl ! PACL pAacl
  integer(BOOL) bSaclDefaulted ! BOOL bSaclDefaulted
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetSecurityDescriptorSacl( &
        pSecurityDescriptor, &
        lpbSaclPresent, &
        pSacl, &
        lpbSaclDefaulted)
USE DFWINTY
  integer(BOOL) :: GetSecurityDescriptorSacl ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetSecurityDescriptorSacl' :: GetSecurityDescriptorSacl
  integer(LPVOID) pSecurityDescriptor ! PSECURITY_DESCRIPTOR pSecurityDescriptor
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: lpbSaclPresent
  integer(BOOL) lpbSaclPresent ! LPBOOL lpbSaclPresent
  integer(LPVOID) pSacl ! PACL* pSacl - output, pointer to a pointer to a T_ACL
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: lpbSaclDefaulted
  integer(BOOL) lpbSaclDefaulted ! LPBOOL lpbSaclDefaulted
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION SetSecurityDescriptorOwner( &
        pSecurityDescriptor, &
        pOwner, &
        bOwnerDefaulted)
USE DFWINTY
  integer(BOOL) :: SetSecurityDescriptorOwner ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'SetSecurityDescriptorOwner' :: SetSecurityDescriptorOwner
  integer(LPVOID) pSecurityDescriptor ! PSECURITY_DESCRIPTOR pSecurityDescriptor
  integer(PVOID) pOwner ! PSID pOwner
  integer(BOOL) bOwnerDefaulted ! BOOL bOwnerDefaulted
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetSecurityDescriptorOwner( &
        pSecurityDescriptor, &
        pOwner, &
        lpbOwnerDefaulted)
USE DFWINTY
  integer(BOOL) :: GetSecurityDescriptorOwner ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetSecurityDescriptorOwner' :: GetSecurityDescriptorOwner
  integer(LPVOID) pSecurityDescriptor ! PSECURITY_DESCRIPTOR pSecurityDescriptor
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: pOwner
  integer(PVOID) pOwner ! PSID* pOwner
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: lpbOwnerDefaulted
  integer(BOOL) lpbOwnerDefaulted ! LPBOOL lpbOwnerDefaulted
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION SetSecurityDescriptorGroup( &
        pSecurityDescriptor, &
        pGroup, &
        bGroupDefaulted)
USE DFWINTY
  integer(BOOL) :: SetSecurityDescriptorGroup ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'SetSecurityDescriptorGroup' :: SetSecurityDescriptorGroup
  integer(LPVOID) pSecurityDescriptor ! PSECURITY_DESCRIPTOR pSecurityDescriptor
  integer(PVOID) pGroup ! PSID pGroup
  integer(BOOL) bGroupDefaulted ! BOOL bGroupDefaulted
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetSecurityDescriptorGroup( &
        pSecurityDescriptor, &
        pGroup, &
        lpbGroupDefaulted)
USE DFWINTY
  integer(BOOL) :: GetSecurityDescriptorGroup ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetSecurityDescriptorGroup' :: GetSecurityDescriptorGroup
  integer(LPVOID) pSecurityDescriptor ! PSECURITY_DESCRIPTOR pSecurityDescriptor
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: pGroup
  integer(PVOID) pGroup ! PSID* pGroup
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: lpbGroupDefaulted
  integer(BOOL) lpbGroupDefaulted ! LPBOOL lpbGroupDefaulted
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION SetSecurityDescriptorRMControl( &
        SecurityDescriptor, &
        RMControl)
USE DFWINTY
  integer(DWORD) :: SetSecurityDescriptorRMControl ! DWORD
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'SetSecurityDescriptorRMControl' :: SetSecurityDescriptorRMControl
  integer(LPVOID) SecurityDescriptor ! PSECURITY_DESCRIPTOR SecurityDescriptor
!DEC$ ATTRIBUTES REFERENCE :: RMControl
  integer(UCHAR) RMControl ! PUCHAR RMControl
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetSecurityDescriptorRMControl( &
        SecurityDescriptor, &
        RMControl)
USE DFWINTY
  integer(DWORD) :: GetSecurityDescriptorRMControl ! DWORD
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetSecurityDescriptorRMControl' :: GetSecurityDescriptorRMControl
  integer(LPVOID) SecurityDescriptor ! PSECURITY_DESCRIPTOR SecurityDescriptor
!DEC$ ATTRIBUTES REFERENCE :: RMControl
  integer(UCHAR) RMControl ! PUCHAR RMControl
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CreatePrivateObjectSecurity( &
        ParentDescriptor, &
        CreatorDescriptor, &
        NewDescriptor, &
        IsDirectoryObject, &
        Token, &
        GenericMapping)
USE DFWINTY
  integer(BOOL) :: CreatePrivateObjectSecurity ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CreatePrivateObjectSecurity' :: CreatePrivateObjectSecurity
  integer(LPVOID) ParentDescriptor ! PSECURITY_DESCRIPTOR ParentDescriptor
  integer(LPVOID) CreatorDescriptor ! PSECURITY_DESCRIPTOR CreatorDescriptor
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: NewDescriptor
  integer(PVOID)  NewDescriptor ! PSECURITY_DESCRIPTOR*  NewDescriptor
  integer(BOOL) IsDirectoryObject ! BOOL IsDirectoryObject
  integer(HANDLE) Token ! HANDLE Token
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: GenericMapping
  TYPE(T_GENERIC_MAPPING)  GenericMapping ! PGENERIC_MAPPING GenericMapping
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION SetPrivateObjectSecurity( &
        SecurityInformation, &
        ModificationDescriptor, &
        ObjectsSecurityDescriptor, &
        GenericMapping, &
        Token)
USE DFWINTY
  integer(BOOL) :: SetPrivateObjectSecurity ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'SetPrivateObjectSecurity' :: SetPrivateObjectSecurity
  integer(ULONG) SecurityInformation ! SECURITY_INFORMATION SecurityInformation
  integer(LPVOID) ModificationDescriptor ! PSECURITY_DESCRIPTOR ModificationDescriptor
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: ObjectsSecurityDescriptor
  integer(PVOID) ObjectsSecurityDescriptor ! PSECURITY_DESCRIPTOR* ObjectsSecurityDescriptor
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: GenericMapping
  TYPE(T_GENERIC_MAPPING)  GenericMapping ! PGENERIC_MAPPING GenericMapping
  integer(HANDLE) Token ! HANDLE Token
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetPrivateObjectSecurity( &
        ObjectDescriptor, &
        SecurityInformation, &
        ResultantDescriptor, &
        DescriptorLength, &
        ReturnLength)
USE DFWINTY
  integer(BOOL) :: GetPrivateObjectSecurity ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetPrivateObjectSecurity' :: GetPrivateObjectSecurity
  integer(LPVOID) ObjectDescriptor ! PSECURITY_DESCRIPTOR ObjectDescriptor
  integer(ULONG) SecurityInformation ! SECURITY_INFORMATION SecurityInformation
  integer(LPVOID) ResultantDescriptor ! PSECURITY_DESCRIPTOR ResultantDescriptor
  integer(DWORD) DescriptorLength ! DWORD DescriptorLength
  integer(LPDWORD) ReturnLength ! PDWORD ReturnLength
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION DestroyPrivateObjectSecurity( &
        ObjectDescriptor)
USE DFWINTY
  integer(BOOL) :: DestroyPrivateObjectSecurity ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'DestroyPrivateObjectSecurity' :: DestroyPrivateObjectSecurity
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: ObjectDescriptor
  integer(PVOID)  ObjectDescriptor ! PSECURITY_DESCRIPTOR*  ObjectDescriptor
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION MakeSelfRelativeSD( &
        pAbsoluteSecurityDescriptor, &
        pSelfRelativeSecurityDescriptor, &
        lpdwBufferLength)
USE DFWINTY
  integer(BOOL) :: MakeSelfRelativeSD ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'MakeSelfRelativeSD' :: MakeSelfRelativeSD
  integer(LPVOID) pAbsoluteSecurityDescriptor ! PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor
  integer(LPVOID) pSelfRelativeSecurityDescriptor ! PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor
  integer(LPDWORD) lpdwBufferLength ! LPDWORD lpdwBufferLength
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION MakeAbsoluteSD( &
        pSelfRelativeSecurityDescriptor, &
        pAbsoluteSecurityDescriptor, &
        lpdwAbsoluteSecurityDescriptorSize, &
        pDacl, &
        lpdwDaclSize, &
        pSacl, &
        lpdwSaclSize, &
        pOwner, &
        lpdwOwnerSize, &
        pPrimaryGroup, &
        lpdwPrimaryGroupSize)
USE DFWINTY
  integer(BOOL) :: MakeAbsoluteSD ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'MakeAbsoluteSD' :: MakeAbsoluteSD
  integer(LPVOID) pSelfRelativeSecurityDescriptor ! PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor
  integer(LPVOID) pAbsoluteSecurityDescriptor ! PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor
  integer(LPDWORD) lpdwAbsoluteSecurityDescriptorSize ! LPDWORD lpdwAbsoluteSecurityDescriptorSize
  integer(LPVOID) pDacl ! PACL pDacl
  integer(LPDWORD) lpdwDaclSize ! LPDWORD lpdwDaclSize
  integer(LPVOID) pSacl ! PACL pSacl
  integer(LPDWORD) lpdwSaclSize ! LPDWORD lpdwSaclSize
  integer(PVOID) pOwner ! PSID pOwner
  integer(LPDWORD) lpdwOwnerSize ! LPDWORD lpdwOwnerSize
  integer(PVOID) pPrimaryGroup ! PSID pPrimaryGroup
  integer(LPDWORD) lpdwPrimaryGroupSize ! LPDWORD lpdwPrimaryGroupSize
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION MakeAbsoluteSD2( &
        pSelfRelativeSecurityDescriptor, &
        lpdwBufferSize)
USE DFWINTY
  integer(BOOL) :: MakeAbsoluteSD2 ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'MakeAbsoluteSD2' :: MakeAbsoluteSD2
  integer(LPVOID) pSelfRelativeSecurityDescriptor ! PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor
  integer(LPDWORD) lpdwBufferSize ! LPDWORD lpdwBufferSize
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION SetFileSecurity( &
        lpFileName, &
        SecurityInformation, &
        pSecurityDescriptor)
USE DFWINTY
  integer(BOOL) :: SetFileSecurity ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'SetFileSecurityA' :: SetFileSecurity
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: lpFileName
  character*(*) lpFileName ! LPCSTR lpFileName
  integer(ULONG) SecurityInformation ! SECURITY_INFORMATION SecurityInformation
  integer(LPVOID) pSecurityDescriptor ! PSECURITY_DESCRIPTOR pSecurityDescriptor
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetFileSecurity( &
        lpFileName, &
        RequestedInformation, &
        pSecurityDescriptor, &
        nLength, &
        lpnLengthNeeded)
USE DFWINTY
  integer(BOOL) :: GetFileSecurity ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetFileSecurityA' :: GetFileSecurity
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpFileName
  character*(*) lpFileName ! LPCSTR lpFileName
  integer(ULONG) RequestedInformation ! SECURITY_INFORMATION RequestedInformation
  integer(LPVOID) pSecurityDescriptor ! PSECURITY_DESCRIPTOR pSecurityDescriptor
  integer(DWORD) nLength ! DWORD nLength
  integer(LPDWORD) lpnLengthNeeded ! LPDWORD lpnLengthNeeded
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION SetKernelObjectSecurity( &
        aHandle, &
        SecurityInformation, &
        SecurityDescriptor)
USE DFWINTY
  integer(BOOL) :: SetKernelObjectSecurity ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'SetKernelObjectSecurity' :: SetKernelObjectSecurity
  integer(HANDLE) aHandle ! HANDLE Handle
  integer(ULONG) SecurityInformation ! SECURITY_INFORMATION SecurityInformation
  integer(LPVOID) SecurityDescriptor ! PSECURITY_DESCRIPTOR SecurityDescriptor
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION LookupAccountSid( &
        lpSystemName, &
        Sid, &
        Name, &
        cbName, &
        ReferencedDomainName, &
        cbReferencedDomainName, &
        peUse)
USE DFWINTY
  integer(BOOL) :: LookupAccountSid ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'LookupAccountSidA' :: LookupAccountSid
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpSystemName
  character*(*) lpSystemName ! LPCSTR lpSystemName
  integer(PVOID) Sid ! PSID Sid
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: Name
  character*(*) Name ! LPSTR Name
  integer(LPDWORD) cbName ! LPDWORD cbName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: ReferencedDomainName
  character*(*) ReferencedDomainName ! LPSTR ReferencedDomainName
  integer(LPDWORD) cbReferencedDomainName ! LPDWORD cbReferencedDomainName
  integer(ENUM) peUse ! PSID_NAME_USE peUse
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION LookupAccountName( &
        lpSystemName, &
        lpAccountName, &
        Sid, &
        cbSid, &
        ReferencedDomainName, &
        cbReferencedDomainName, &
        peUse)
USE DFWINTY
  integer(BOOL) :: LookupAccountName ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'LookupAccountNameA' :: LookupAccountName
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: lpSystemName
  character*(*) lpSystemName ! LPCSTR lpSystemName
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: lpAccountName
  character*(*) lpAccountName ! LPCSTR lpAccountName
  integer(PVOID) Sid ! PSID Sid
  integer(LPDWORD) cbSid ! LPDWORD cbSid
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: ReferencedDomainName
  character*(*) ReferencedDomainName ! LPSTR ReferencedDomainName
  integer(LPDWORD) cbReferencedDomainName ! LPDWORD cbReferencedDomainName
  integer(ENUM) peUse ! PSID_NAME_USE peUse
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION LookupPrivilegeValue( &
        lpSystemName, &
        lpName, &
        lpLuid)
USE DFWINTY
  integer(BOOL) :: LookupPrivilegeValue ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'LookupPrivilegeValueA' :: LookupPrivilegeValue
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: lpSystemName
  character*(*) lpSystemName ! LPCSTR lpSystemName
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: lpName
  character*(*) lpName ! LPCSTR lpName
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: lpLuid
  TYPE (T_LUID) lpLuid ! PLUID lpLuid
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION LookupPrivilegeName( &
        lpSystemName, &
        lpLuid, &
        lpName, &
        cbName)
USE DFWINTY
  integer(BOOL) :: LookupPrivilegeName ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'LookupPrivilegeNameA' :: LookupPrivilegeName
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: lpSystemName
  character*(*) lpSystemName ! LPCSTR lpSystemName
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: lpLuid
  TYPE (T_LUID) lpLuid ! PLUID lpLuid
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: lpName
  character*(*) lpName ! LPSTR lpName
  integer(LPDWORD) cbName ! LPDWORD cbName
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION LookupPrivilegeDisplayName( &
        lpSystemName, &
        lpName, &
        lpDisplayName, &
        cbDisplayName, &
        lpLanguageId)
USE DFWINTY
  integer(BOOL) :: LookupPrivilegeDisplayName ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'LookupPrivilegeDisplayNameA' :: LookupPrivilegeDisplayName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpSystemName
  character*(*) lpSystemName ! LPCSTR lpSystemName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpName
  character*(*) lpName ! LPCSTR lpName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpDisplayName
  character*(*) lpDisplayName ! LPSTR lpDisplayName
  integer(LPDWORD) cbDisplayName ! LPDWORD cbDisplayName
  integer(LPDWORD) lpLanguageId ! LPDWORD lpLanguageId
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION AllocateLocallyUniqueId( &
        Luid)
USE DFWINTY
  integer(BOOL) :: AllocateLocallyUniqueId ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'AllocateLocallyUniqueId' :: AllocateLocallyUniqueId
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: Luid
  TYPE (T_LUID) Luid ! PLUID Luid
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetUserName( &
        lpBuffer, &
        nSize)
USE DFWINTY
  integer(BOOL) :: GetUserName ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetUserNameA' :: GetUserName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpBuffer
  character*(*) lpBuffer ! LPSTR lpBuffer
  integer(LPDWORD) nSize ! LPDWORD nSize
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION LogonUser( &
        lpszUsername, &
        lpszDomain, &
        lpszPassword, &
        dwLogonType, &
        dwLogonProvider, &
        phToken)
USE DFWINTY
  integer(BOOL) :: LogonUser ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'LogonUserA' :: LogonUser
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpszUsername
  character*(*) lpszUsername ! LPSTR lpszUsername
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpszDomain
  character*(*) lpszDomain ! LPSTR lpszDomain
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpszPassword
  character*(*) lpszPassword ! LPSTR lpszPassword
  integer(DWORD) dwLogonType ! DWORD dwLogonType
  integer(DWORD) dwLogonProvider ! DWORD dwLogonProvider
!DEC$ ATTRIBUTES REFERENCE :: phToken
  integer(HANDLE) phToken ! PHANDLE phToken
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION ImpersonateLoggedOnUser( &
        hToken)
USE DFWINTY
  integer(BOOL) :: ImpersonateLoggedOnUser ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'ImpersonateLoggedOnUser' :: ImpersonateLoggedOnUser
  integer(HANDLE) hToken ! HANDLE hToken
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CreateProcessAsUser( &
        hToken, &
        lpApplicationName, &
        lpCommandLine, &
        lpProcessAttributes, &
        lpThreadAttributes, &
        bInheritHandles, &
        dwCreationFlags, &
        lpEnvironment, &
        lpCurrentDirectory, &
        lpStartupInfo, &
        lpProcessInformation)
USE DFWINTY
  integer(BOOL) :: CreateProcessAsUser ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CreateProcessAsUserA' :: CreateProcessAsUser
  integer(HANDLE) hToken ! HANDLE hToken
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpApplicationName
  character*(*) lpApplicationName ! LPCSTR lpApplicationName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpCommandLine
  character*(*) lpCommandLine ! LPSTR lpCommandLine
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpProcessAttributes
  TYPE (T_SECURITY_ATTRIBUTES) lpProcessAttributes ! LPSECURITY_ATTRIBUTES lpProcessAttributes
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpThreadAttributes
  TYPE (T_SECURITY_ATTRIBUTES) lpThreadAttributes ! LPSECURITY_ATTRIBUTES lpThreadAttributes
  integer(BOOL) bInheritHandles ! BOOL bInheritHandles
  integer(DWORD) dwCreationFlags ! DWORD dwCreationFlags
  integer(LPVOID) lpEnvironment ! LPVOID lpEnvironment
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpCurrentDirectory
  character*(*) lpCurrentDirectory ! LPCSTR lpCurrentDirectory
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpStartupInfo
  TYPE (T_STARTUPINFO) lpStartupInfo ! LPSTARTUPINFOA lpStartupInfo
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpProcessInformation
  TYPE (T_PROCESS_INFORMATION) lpProcessInformation ! LPPROCESS_INFORMATION lpProcessInformation
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION ImpersonateAnonymousToken( &
        ThreadHandle)
USE DFWINTY
  integer(BOOL) :: ImpersonateAnonymousToken ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'ImpersonateAnonymousToken' :: ImpersonateAnonymousToken
  integer(HANDLE) ThreadHandle ! HANDLE ThreadHandle
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION DuplicateTokenEx( &
        hExistingToken, &
        dwDesiredAccess, &
        lpTokenAttributes, &
        ImpersonationLevel, &
        aTokenType, &
        phNewToken)
USE DFWINTY
  integer(BOOL) :: DuplicateTokenEx ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'DuplicateTokenEx' :: DuplicateTokenEx
  integer(HANDLE) hExistingToken ! HANDLE hExistingToken
  integer(DWORD) dwDesiredAccess ! DWORD dwDesiredAccess
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpTokenAttributes
  TYPE (T_SECURITY_ATTRIBUTES) lpTokenAttributes ! LPSECURITY_ATTRIBUTES lpTokenAttributes
  integer(ENUM) ImpersonationLevel ! SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
  integer(ENUM) aTokenType ! TOKEN_TYPE TokenType
!DEC$ ATTRIBUTES REFERENCE :: phNewToken
  integer(HANDLE) phNewToken ! PHANDLE phNewToken
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CreateRestrictedToken( &
        ExistingTokenHandle, &
        Flags, &
        DisableSidCount, &
        SidsToDisable, &
        DeletePrivilegeCount, &
        PrivilegesToDelete, &
        RestrictedSidCount, & 
        SidsToRestrict, &
        NewTokenHandle)
USE DFWINTY
  integer(BOOL) :: CreateRestrictedToken ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CreateRestrictedToken' :: CreateRestrictedToken
  integer(HANDLE) ExistingTokenHandle ! HANDLE ExistingTokenHandle
  integer(DWORD) Flags ! DWORD Flags
  integer(DWORD) DisableSidCount ! DWORD DisableSidCount
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: SidsToDisable
  TYPE (T_SID_AND_ATTRIBUTES) SidsToDisable ! PSID_AND_ATTRIBUTES SidsToDisable
  integer(DWORD) DeletePrivilegeCount ! DWORD DeletePrivilegeCount
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: PrivilegesToDelete
  TYPE (T_LUID_AND_ATTRIBUTES) PrivilegesToDelete ! PLUID_AND_ATTRIBUTES PrivilegesToDelete
  integer(DWORD) RestrictedSidCount ! DWORD RestrictedSidCount
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: SidsToRestrict
  TYPE (T_SID_AND_ATTRIBUTES) SidsToRestrict ! PSID_AND_ATTRIBUTES SidsToRestrict
!DEC$ ATTRIBUTES REFERENCE :: NewTokenHandle
  integer(HANDLE) NewTokenHandle ! PHANDLE NewTokenHandle
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION IsProcessRestricted( &
             )
USE DFWINTY
  integer(BOOL) :: IsProcessRestricted ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'IsProcessRestricted' :: IsProcessRestricted
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION IsTokenRestricted( &
        TokenHandle)
USE DFWINTY
  integer(BOOL) :: IsTokenRestricted ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'IsTokenRestricted' :: IsTokenRestricted
  integer(HANDLE) TokenHandle ! HANDLE TokenHandle
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetSiteSidFromToken( &
        TokenHandle)
USE DFWINTY
  integer(PVOID) :: GetSiteSidFromToken ! PSID
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetSiteSidFromToken' :: GetSiteSidFromToken
  integer(HANDLE) TokenHandle ! HANDLE TokenHandle
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetSiteSidFromUrl( &
        pszUrl)
USE DFWINTY
  integer(PVOID) :: GetSiteSidFromUrl ! PSID
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetSiteSidFromUrl' :: GetSiteSidFromUrl
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: pszUrl
  integer(WCHAR) pszUrl(*) ! LPCWSTR pszUrl
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetSiteNameFromSid( &
        pSid, &
        pwsSite)
USE DFWINTY
  integer(LONG) :: GetSiteNameFromSid ! HRESULT
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetSiteNameFromSid' :: GetSiteNameFromSid
  integer(PVOID) pSid ! PSID pSid
!DEC$ ATTRIBUTES REFERENCE :: pwsSite
  integer(LPWSTR) pwsSite ! LPWSTR* pwsSite
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetMangledSiteSid( &
        pSid, &
        cchMangledSite, &
        ppwszMangledSite)
USE DFWINTY
  integer(LONG) :: GetMangledSiteSid ! HRESULT
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetMangledSiteSid' :: GetMangledSiteSid
  integer(PVOID) pSid ! PSID pSid
  integer(ULONG) cchMangledSite ! ULONG cchMangledSite
!DEC$ ATTRIBUTES REFERENCE :: ppwszMangledSite
  integer(LPWSTR) ppwszMangledSite ! LPWSTR* ppwszMangledSite
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetSiteDirectory( &
        hToken, &
        pszSiteDirectory, &
        uSize)
USE DFWINTY
  integer(ULONG) :: GetSiteDirectory ! ULONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetSiteDirectoryA' :: GetSiteDirectory
  integer(HANDLE) hToken ! HANDLE hToken
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: pszSiteDirectory
  character*(*) pszSiteDirectory ! LPSTR pszSiteDirectory
  integer(ULONG) uSize ! ULONG uSize
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CheckTokenMembership( &
        TokenHandle, &
        SidToCheck, &
        IsMember)
USE DFWINTY
  integer(BOOL) :: CheckTokenMembership ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CheckTokenMembership' :: CheckTokenMembership
  integer(HANDLE) TokenHandle ! HANDLE TokenHandle
  integer(PVOID) SidToCheck ! PSID SidToCheck
!DEC$ ATTRIBUTES REFERENCE :: IsMember
  integer(BOOL) IsMember ! PBOOL IsMember
 END FUNCTION
END INTERFACE
!DEC$ IF DEFINED( _M_IX86)
INTERFACE 
FUNCTION GetCurrentHwProfile( &
        lpHwProfileInfo)
USE DFWINTY
  integer(BOOL) :: GetCurrentHwProfile ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetCurrentHwProfileA' :: GetCurrentHwProfile
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpHwProfileInfo
  TYPE (T_HW_PROFILE_INFO) lpHwProfileInfo ! LPHW_PROFILE_INFOA lpHwProfileInfo
 END FUNCTION
END INTERFACE
!DEC$ ENDIF
INTERFACE 
FUNCTION RegCloseKey( &
        hKey)
USE DFWINTY
  integer(LONG) :: RegCloseKey ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegCloseKey' :: RegCloseKey
  integer(HANDLE) hKey ! HKEY hKey
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegOverridePredefKey( &
        hKey, &
        hNewHKey)
USE DFWINTY
  integer(LONG) :: RegOverridePredefKey ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegOverridePredefKey' :: RegOverridePredefKey
  integer(HANDLE) hKey ! HKEY hKey
  integer(HANDLE) hNewHKey ! HKEY hNewHKey
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegOpenUserClassesRoot( &
        hToken, &
        dwOptions, &
        samDesired, &
        phkResult)
USE DFWINTY
  integer(LONG) :: RegOpenUserClassesRoot ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegOpenUserClassesRoot' :: RegOpenUserClassesRoot
  integer(HANDLE) hToken ! HANDLE hToken
  integer(DWORD) dwOptions ! DWORD dwOptions
  integer(ULONG) samDesired ! REGSAM samDesired
!DEC$ ATTRIBUTES REFERENCE :: phkResult
  integer(HANDLE)  phkResult ! PHKEY phkResult
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegOpenCurrentUser( &
        samDesired, &
        phkResult)
USE DFWINTY
  integer(LONG) :: RegOpenCurrentUser ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegOpenCurrentUser' :: RegOpenCurrentUser
  integer(ULONG) samDesired ! REGSAM samDesired
!DEC$ ATTRIBUTES REFERENCE :: phkResult
  integer(HANDLE)  phkResult ! PHKEY phkResult
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegDisablePredefinedCache( &
             )
USE DFWINTY
  integer(LONG) :: RegDisablePredefinedCache ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegDisablePredefinedCache' :: RegDisablePredefinedCache
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegConnectRegistry( &
        lpMachineName, &
        hKey, &
        phkResult)
USE DFWINTY
  integer(LONG) :: RegConnectRegistry ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegConnectRegistryA' :: RegConnectRegistry
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: lpMachineName
  character*(*) lpMachineName ! LPCSTR lpMachineName
  integer(HANDLE) hKey ! HKEY hKey
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: phkResult
  integer(HANDLE)  phkResult ! PHKEY phkResult
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegCreateKey( &
        hKey, &
        lpSubKey, &
        phkResult)
USE DFWINTY
  integer(LONG) :: RegCreateKey ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegCreateKeyA' :: RegCreateKey
  integer(HANDLE) hKey ! HKEY hKey
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: lpSubKey
  character*(*) lpSubKey ! LPCSTR lpSubKey
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: phkResult
  integer(HANDLE)  phkResult ! PHKEY phkResult
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegCreateKeyEx( &
        hKey, &
        lpSubKey, &
        Reserved, &
        lpClass, &
        dwOptions, &
        samDesired, &
        lpSecurityAttributes, &
        phkResult, &
        lpdwDisposition)
USE DFWINTY
  integer(LONG) :: RegCreateKeyEx ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegCreateKeyExA' :: RegCreateKeyEx
  integer(HANDLE) hKey ! HKEY hKey
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: lpSubKey
  character*(*) lpSubKey ! LPCSTR lpSubKey
  integer(DWORD) Reserved ! DWORD Reserved
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: lpClass
  character*(*) lpClass ! LPSTR lpClass
  integer(DWORD) dwOptions ! DWORD dwOptions
  integer(ULONG) samDesired ! REGSAM samDesired
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: lpSecurityAttributes
  TYPE (T_SECURITY_ATTRIBUTES) lpSecurityAttributes ! LPSECURITY_ATTRIBUTES lpSecurityAttributes
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: phkResult
  integer(HANDLE)  phkResult ! PHKEY phkResult
  integer(LPDWORD) lpdwDisposition ! LPDWORD lpdwDisposition
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegDeleteKey( &
        hKey, &
        lpSubKey)
USE DFWINTY
  integer(LONG) :: RegDeleteKey ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegDeleteKeyA' :: RegDeleteKey
  integer(HANDLE) hKey ! HKEY hKey
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpSubKey
  character*(*) lpSubKey ! LPCSTR lpSubKey
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegDeleteValue( &
        hKey, &
        lpValueName)
USE DFWINTY
  integer(LONG) :: RegDeleteValue ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegDeleteValueA' :: RegDeleteValue
  integer(HANDLE) hKey ! HKEY hKey
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpValueName
  character*(*) lpValueName ! LPCSTR lpValueName
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegEnumKey( &
        hKey, &
        dwIndex, &
        lpName, &
        cbName)
USE DFWINTY
  integer(LONG) :: RegEnumKey ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegEnumKeyA' :: RegEnumKey
  integer(HANDLE) hKey ! HKEY hKey
  integer(DWORD) dwIndex ! DWORD dwIndex
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpName
  character*(*) lpName ! LPSTR lpName
  integer(DWORD) cbName ! DWORD cbName
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegEnumKeyEx( &
        hKey, &
        dwIndex, &
        lpName, &
        lpcbName, &
        lpReserved, &
        lpClass, &
        lpcbClass, &
        lpftLastWriteTime)
USE DFWINTY
  integer(LONG) :: RegEnumKeyEx ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegEnumKeyExA' :: RegEnumKeyEx
  integer(HANDLE) hKey ! HKEY hKey
  integer(DWORD) dwIndex ! DWORD dwIndex
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpName
  character*(*) lpName ! LPSTR lpName
  integer(LPDWORD) lpcbName ! LPDWORD lpcbName
  integer(LPDWORD) lpReserved ! LPDWORD lpReserved
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpClass
  character*(*) lpClass ! LPSTR lpClass
  integer(LPDWORD) lpcbClass ! LPDWORD lpcbClass
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpftLastWriteTime
  TYPE (T_FILETIME) lpftLastWriteTime ! PFILETIME lpftLastWriteTime
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegEnumValue( &
        hKey, &
        dwIndex, &
        lpValueName, &
        lpcbValueName, &
        lpReserved, &
        lpType, &
        lpData, &
        lpcbData)
USE DFWINTY
  integer(LONG) :: RegEnumValue ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegEnumValueA' :: RegEnumValue
  integer(HANDLE) hKey ! HKEY hKey
  integer(DWORD) dwIndex ! DWORD dwIndex
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpValueName
  character*(*) lpValueName ! LPSTR lpValueName
  integer(LPDWORD) lpcbValueName ! LPDWORD lpcbValueName
  integer(LPDWORD) lpReserved ! LPDWORD lpReserved
  integer(LPDWORD) lpType ! LPDWORD lpType
  integer(LPBYTE) lpData ! LPBYTE lpData
  integer(LPDWORD) lpcbData ! LPDWORD lpcbData
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegFlushKey( &
        hKey)
USE DFWINTY
  integer(LONG) :: RegFlushKey ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegFlushKey' :: RegFlushKey
  integer(HANDLE) hKey ! HKEY hKey
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegGetKeySecurity( &
        hKey, &
        SecurityInformation, &
        pSecurityDescriptor, &
        lpcbSecurityDescriptor)
USE DFWINTY
  integer(LONG) :: RegGetKeySecurity ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegGetKeySecurity' :: RegGetKeySecurity
  integer(HANDLE) hKey ! HKEY hKey
  integer(ULONG) SecurityInformation ! SECURITY_INFORMATION SecurityInformation
  integer(LPVOID) pSecurityDescriptor ! PSECURITY_DESCRIPTOR pSecurityDescriptor
  integer(LPDWORD) lpcbSecurityDescriptor ! LPDWORD lpcbSecurityDescriptor
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegLoadKey( &
        hKey, &
        lpSubKey, &
        lpFile)
USE DFWINTY
  integer(LONG) :: RegLoadKey ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegLoadKeyA' :: RegLoadKey
  integer(HANDLE) hKey ! HKEY hKey
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpSubKey
  character*(*) lpSubKey ! LPCSTR lpSubKey
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpFile
  character*(*) lpFile ! LPCSTR lpFile
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegNotifyChangeKeyValue( &
        hKey, &
        bWatchSubtree, &
        dwNotifyFilter, &
        hEvent, &
        fAsynchronus)
USE DFWINTY
  integer(LONG) :: RegNotifyChangeKeyValue ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegNotifyChangeKeyValue' :: RegNotifyChangeKeyValue
  integer(HANDLE) hKey ! HKEY hKey
  integer(BOOL) bWatchSubtree ! BOOL bWatchSubtree
  integer(DWORD) dwNotifyFilter ! DWORD dwNotifyFilter
  integer(HANDLE) hEvent ! HANDLE hEvent
  integer(BOOL) fAsynchronus ! BOOL fAsynchronus
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegOpenKey( &
        hKey, &
        lpSubKey, &
        phkResult)
USE DFWINTY
  integer(LONG) :: RegOpenKey ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegOpenKeyA' :: RegOpenKey
  integer(HANDLE) hKey ! HKEY hKey
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: lpSubKey
  character*(*) lpSubKey ! LPCSTR lpSubKey
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: phkResult
  integer(HANDLE)  phkResult ! PHKEY phkResult
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegOpenKeyEx( &
        hKey, &
        lpSubKey, &
        ulOptions, &
        samDesired, &
        phkResult)
USE DFWINTY
  integer(LONG) :: RegOpenKeyEx ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegOpenKeyExA' :: RegOpenKeyEx
  integer(HANDLE) hKey ! HKEY hKey
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: lpSubKey
  character*(*) lpSubKey ! LPCSTR lpSubKey
  integer(DWORD) ulOptions ! DWORD ulOptions
  integer(ULONG) samDesired ! REGSAM samDesired
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: phkResult
  integer(HANDLE)  phkResult ! PHKEY phkResult
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegQueryInfoKey( &
        hKey, &
        lpClass, &
        lpcbClass, &
        lpReserved, &
        lpcSubKeys, &
        lpcbMaxSubKeyLen, &
        lpcbMaxClassLen, &
        lpcValues, &
        lpcbMaxValueNameLen, &
        lpcbMaxValueLen, &
        lpcbSecurityDescriptor, &
        lpftLastWriteTime)
USE DFWINTY
  integer(LONG) :: RegQueryInfoKey ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegQueryInfoKeyA' :: RegQueryInfoKey
  integer(HANDLE) hKey ! HKEY hKey
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpClass
  character*(*) lpClass ! LPSTR lpClass
  integer(LPDWORD) lpcbClass ! LPDWORD lpcbClass
  integer(LPDWORD) lpReserved ! LPDWORD lpReserved
  integer(LPDWORD) lpcSubKeys ! LPDWORD lpcSubKeys
  integer(LPDWORD) lpcbMaxSubKeyLen ! LPDWORD lpcbMaxSubKeyLen
  integer(LPDWORD) lpcbMaxClassLen ! LPDWORD lpcbMaxClassLen
  integer(LPDWORD) lpcValues ! LPDWORD lpcValues
  integer(LPDWORD) lpcbMaxValueNameLen ! LPDWORD lpcbMaxValueNameLen
  integer(LPDWORD) lpcbMaxValueLen ! LPDWORD lpcbMaxValueLen
  integer(LPDWORD) lpcbSecurityDescriptor ! LPDWORD lpcbSecurityDescriptor
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpftLastWriteTime
  TYPE (T_FILETIME) lpftLastWriteTime ! PFILETIME lpftLastWriteTime
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegQueryValue( &
        hKey, &
        lpSubKey, &
        lpValue, &
        lpcbValue)
USE DFWINTY
  integer(LONG) :: RegQueryValue ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegQueryValueA' :: RegQueryValue
  integer(HANDLE) hKey ! HKEY hKey
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpSubKey
  character*(*) lpSubKey ! LPCSTR lpSubKey
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpValue
  character*(*) lpValue ! LPSTR lpValue
  integer(LPLONG) lpcbValue ! PLONG lpcbValue
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegQueryMultipleValues( &
        hKey, &
        val_list, &
        num_vals, &
        lpValueBuf, &
        ldwTotsize)
USE DFWINTY
  integer(LONG) :: RegQueryMultipleValues ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegQueryMultipleValuesA' :: RegQueryMultipleValues
  integer(HANDLE) hKey ! HKEY hKey
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: val_list
  TYPE (T_VALENT) val_list ! PVALENTA val_list
  integer(DWORD) num_vals ! DWORD num_vals
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpValueBuf
  character*(*) lpValueBuf ! LPSTR lpValueBuf
  integer(LPDWORD) ldwTotsize ! LPDWORD ldwTotsize
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegQueryValueEx( &
        hKey, &
        lpValueName, &
        lpReserved, &
        lpType, &
        lpData, &
        lpcbData)
USE DFWINTY
  integer(LONG) :: RegQueryValueEx ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegQueryValueExA' :: RegQueryValueEx
  integer(HANDLE) hKey ! HKEY hKey
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpValueName
  character*(*) lpValueName ! LPCSTR lpValueName
  integer(LPDWORD) lpReserved ! LPDWORD lpReserved
  integer(LPDWORD) lpType ! LPDWORD lpType
  integer(LPBYTE) lpData ! LPBYTE lpData
  integer(LPDWORD) lpcbData ! LPDWORD lpcbData
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegReplaceKey( &
        hKey, &
        lpSubKey, &
        lpNewFile, &
        lpOldFile)
USE DFWINTY
  integer(LONG) :: RegReplaceKey ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegReplaceKeyA' :: RegReplaceKey
  integer(HANDLE) hKey ! HKEY hKey
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpSubKey
  character*(*) lpSubKey ! LPCSTR lpSubKey
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpNewFile
  character*(*) lpNewFile ! LPCSTR lpNewFile
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpOldFile
  character*(*) lpOldFile ! LPCSTR lpOldFile
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegRestoreKey( &
        hKey, &
        lpFile, &
        dwFlags)
USE DFWINTY
  integer(LONG) :: RegRestoreKey ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegRestoreKeyA' :: RegRestoreKey
  integer(HANDLE) hKey ! HKEY hKey
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpFile
  character*(*) lpFile ! LPCSTR lpFile
  integer(DWORD) dwFlags ! DWORD dwFlags
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegSaveKey( &
        hKey, &
        lpFile, &
        lpSecurityAttributes)
USE DFWINTY
  integer(LONG) :: RegSaveKey ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegSaveKeyA' :: RegSaveKey
  integer(HANDLE) hKey ! HKEY hKey
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpFile
  character*(*) lpFile ! LPCSTR lpFile
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpSecurityAttributes
  TYPE (T_SECURITY_ATTRIBUTES) lpSecurityAttributes ! LPSECURITY_ATTRIBUTES lpSecurityAttributes
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegSetKeySecurity( &
        hKey, &
        SecurityInformation, &
        pSecurityDescriptor)
USE DFWINTY
  integer(LONG) :: RegSetKeySecurity ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegSetKeySecurity' :: RegSetKeySecurity
  integer(HANDLE) hKey ! HKEY hKey
  integer(ULONG) SecurityInformation ! SECURITY_INFORMATION SecurityInformation
  integer(LPVOID) pSecurityDescriptor ! PSECURITY_DESCRIPTOR pSecurityDescriptor
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegSetValue( &
        hKey, &
        lpSubKey, &
        dwType, &
        lpData, &
        cbData)
USE DFWINTY
  integer(LONG) :: RegSetValue ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegSetValueA' :: RegSetValue
  integer(HANDLE) hKey ! HKEY hKey
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpSubKey
  character*(*) lpSubKey ! LPCSTR lpSubKey
  integer(DWORD) dwType ! DWORD dwType
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpData
  character*(*) lpData ! LPCSTR lpData
  integer(DWORD) cbData ! DWORD cbData
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegSetValueEx( &
        hKey, &
        lpValueName, &
        Reserved, &
        dwType, &
        lpData, &
        cbData)
USE DFWINTY
  integer(LONG) :: RegSetValueEx ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegSetValueExA' :: RegSetValueEx
  integer(HANDLE) hKey ! HKEY hKey
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpValueName
  character*(*) lpValueName ! LPCSTR lpValueName
  integer(DWORD) Reserved ! DWORD Reserved
  integer(DWORD) dwType ! DWORD dwType
  integer(LPBYTE)  lpData ! BYTE *  lpData
  integer(DWORD) cbData ! DWORD cbData
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegUnLoadKey( &
        hKey, &
        lpSubKey)
USE DFWINTY
  integer(LONG) :: RegUnLoadKey ! LONG
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegUnLoadKeyA' :: RegUnLoadKey
  integer(HANDLE) hKey ! HKEY hKey
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpSubKey
  character*(*) lpSubKey ! LPCSTR lpSubKey
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION InitiateSystemShutdown( &
        lpMachineName, &
        lpMessage, &
        dwTimeout, &
        bForceAppsClosed, &
        bRebootAfterShutdown)
USE DFWINTY
  integer(BOOL) :: InitiateSystemShutdown ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'InitiateSystemShutdownA' :: InitiateSystemShutdown
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: lpMachineName
  character*(*) lpMachineName ! LPSTR lpMachineName
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: lpMessage
  character*(*) lpMessage ! LPSTR lpMessage
  integer(DWORD) dwTimeout ! DWORD dwTimeout
  integer(BOOL) bForceAppsClosed ! BOOL bForceAppsClosed
  integer(BOOL) bRebootAfterShutdown ! BOOL bRebootAfterShutdown
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION AbortSystemShutdown( &
        lpMachineName)
USE DFWINTY
  integer(BOOL) :: AbortSystemShutdown ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'AbortSystemShutdownA' :: AbortSystemShutdown
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpMachineName
  character*(*) lpMachineName ! LPSTR lpMachineName
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION InitiateSystemShutdownEx( &
        lpMachineName, &
        lpMessage, &
        dwTimeout, &
        bForceAppsClosed, &
        bRebootAfterShutdown, &
        dwReason)
USE DFWINTY
  integer(BOOL) :: InitiateSystemShutdownEx ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'InitiateSystemShutdownExA' :: InitiateSystemShutdownEx
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpMachineName
  character*(*) lpMachineName ! LPSTR lpMachineName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpMessage
  character*(*) lpMessage ! LPSTR lpMessage
  integer(DWORD) dwTimeout ! DWORD dwTimeout
  integer(BOOL) bForceAppsClosed ! BOOL bForceAppsClosed
  integer(BOOL) bRebootAfterShutdown ! BOOL bRebootAfterShutdown
  integer(DWORD) dwReason ! DWORD dwReason
 END FUNCTION
END INTERFACE
INTERFACE 
 FUNCTION CryptAcquireContext( &
         phProv, &
         szContainer, &
         szProvider, &
         dwProvType, &
         dwFlags)
USE DFWINTY
  integer(BOOL) :: CryptAcquireContext ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptAcquireContextA' :: CryptAcquireContext
!DEC$ ATTRIBUTES REFERENCE :: phProv
   integer(ULONG_PTR) phProv ! HCRYPTPROV* phProv
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: szContainer
   character*(*) szContainer ! LPCSTR szContainer
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: szProvider
   character*(*) szProvider ! LPCSTR szProvider
   integer(DWORD) dwProvType ! DWORD dwProvType
   integer(DWORD) dwFlags ! DWORD dwFlags
  END FUNCTION
 END INTERFACE
INTERFACE 
FUNCTION CryptReleaseContext( &
        hProv, &
        dwFlags)
USE DFWINTY
  integer(BOOL) :: CryptReleaseContext ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptReleaseContext' :: CryptReleaseContext
  integer(HANDLE) hProv ! HCRYPTPROV hProv
  integer(DWORD) dwFlags ! DWORD dwFlags
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptGenKey( &
        hProv, &
        Algid, &
        dwFlags, &
        phKey)
USE DFWINTY
  integer(BOOL) :: CryptGenKey ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptGenKey' :: CryptGenKey
  integer(ULONG_PTR) hProv ! HCRYPTPROV hProv
  integer(UINT) Algid ! ALG_ID Algid
  integer(DWORD) dwFlags ! DWORD dwFlags
!DEC$ ATTRIBUTES REFERENCE :: phKey
  integer(ULONG_PTR) phKey ! HCRYPTKEY* phKey
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptDeriveKey( &
        hProv, &
        Algid, &
        hBaseData, &
        dwFlags, &
        phKey)
USE DFWINTY
  integer(BOOL) :: CryptDeriveKey ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptDeriveKey' :: CryptDeriveKey
  integer(ULONG_PTR) hProv ! HCRYPTPROV hProv
  integer(UINT) Algid ! ALG_ID Algid
  integer(ULONG_PTR) hBaseData ! HCRYPTHASH hBaseData
  integer(DWORD) dwFlags ! DWORD dwFlags
!DEC$ ATTRIBUTES REFERENCE :: phKey
  integer(ULONG_PTR) phKey ! HCRYPTKEY* phKey
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptDestroyKey( &
        hKey)
USE DFWINTY
  integer(BOOL) :: CryptDestroyKey ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptDestroyKey' :: CryptDestroyKey
  integer(ULONG_PTR) hKey ! HCRYPTKEY hKey
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptSetKeyParam( &
        hKey, &
        dwParam, &
        pbData, &
        dwFlags)
USE DFWINTY
  integer(BOOL) :: CryptSetKeyParam ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptSetKeyParam' :: CryptSetKeyParam
  integer(ULONG_PTR) hKey ! HCRYPTKEY hKey
  integer(DWORD) dwParam ! DWORD dwParam
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL, NO_ARG_CHECK :: pbData
integer(BYTE) pbData ! BYTE* pbData
  integer(DWORD) dwFlags ! DWORD dwFlags
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptGetKeyParam( &
        hKey, &
        dwParam, &
        pbData, &
        pdwDataLen, &
        dwFlags)
USE DFWINTY
  integer(BOOL) :: CryptGetKeyParam ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptGetKeyParam' :: CryptGetKeyParam
  integer(ULONG_PTR) hKey ! HCRYPTKEY hKey
  integer(DWORD) dwParam ! DWORD dwParam
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL, NO_ARG_CHECK :: pbData
integer(BYTE) pbData ! BYTE* pbData
!DEC$ ATTRIBUTES REFERENCE :: pdwDataLen
integer(DWORD) pdwDataLen ! DWORD* pdwDataLen
  integer(DWORD) dwFlags ! DWORD dwFlags
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptSetHashParam( &
        hHash, &
        dwParam, &
        pbData, &
        dwFlags)
USE DFWINTY
  integer(BOOL) :: CryptSetHashParam ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptSetHashParam' :: CryptSetHashParam
  integer(ULONG_PTR) hHash ! HCRYPTHASH hHash
  integer(DWORD) dwParam ! DWORD dwParam
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL, NO_ARG_CHECK :: pbData
integer(BYTE) pbData ! BYTE* pbData
  integer(DWORD) dwFlags ! DWORD dwFlags
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptGetHashParam( &
        hHash, &
        dwParam, &
        pbData, &
        pdwDataLen, &
        dwFlags)
USE DFWINTY
  integer(BOOL) :: CryptGetHashParam ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptGetHashParam' :: CryptGetHashParam
  integer(ULONG_PTR) hHash ! HCRYPTHASH hHash
  integer(DWORD) dwParam ! DWORD dwParam
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL, NO_ARG_CHECK :: pbData
integer(BYTE) pbData ! BYTE* pbData
!DEC$ ATTRIBUTES REFERENCE :: pdwDataLen
integer(DWORD) pdwDataLen ! DWORD* pdwDataLen
  integer(DWORD) dwFlags ! DWORD dwFlags
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptSetProvParam( &
        hProv, &
        dwParam, &
        pbData, &
        dwFlags)
USE DFWINTY
  integer(BOOL) :: CryptSetProvParam ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptSetProvParam' :: CryptSetProvParam
  integer(ULONG_PTR) hProv ! HCRYPTPROV hProv
  integer(DWORD) dwParam ! DWORD dwParam
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL, NO_ARG_CHECK :: pbData
integer(BYTE) pbData ! BYTE* pbData
  integer(DWORD) dwFlags ! DWORD dwFlags
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptGetProvParam( &
        hProv, &
        dwParam, &
        pbData, &
        pdwDataLen, &
        dwFlags)
USE DFWINTY
  integer(BOOL) :: CryptGetProvParam ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptGetProvParam' :: CryptGetProvParam
  integer(ULONG_PTR) hProv ! HCRYPTPROV hProv
  integer(DWORD) dwParam ! DWORD dwParam
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL, NO_ARG_CHECK :: pbData
integer(BYTE) pbData ! BYTE* pbData
!DEC$ ATTRIBUTES REFERENCE :: pdwDataLen
integer(DWORD) pdwDataLen ! DWORD* pdwDataLen
  integer(DWORD) dwFlags ! DWORD dwFlags
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptGenRandom( &
        hProv, &
        dwLen, &
        pbBuffer)
USE DFWINTY
  integer(BOOL) :: CryptGenRandom ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptGenRandom' :: CryptGenRandom
  integer(ULONG_PTR) hProv ! HCRYPTPROV hProv
  integer(DWORD) dwLen ! DWORD dwLen
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL, NO_ARG_CHECK :: pbBuffer
integer(BYTE) pbBuffer ! BYTE* pbBuffer
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptGetUserKey( &
        hProv, &
        dwKeySpec, &
        phUserKey)
USE DFWINTY
  integer(BOOL) :: CryptGetUserKey ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptGetUserKey' :: CryptGetUserKey
  integer(ULONG_PTR) hProv ! HCRYPTPROV hProv
  integer(DWORD) dwKeySpec ! DWORD dwKeySpec
!DEC$ ATTRIBUTES REFERENCE :: phUserKey
  integer(ULONG_PTR) phUserKey ! HCRYPTKEY* phUserKey
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptExportKey( &
        hKey, &
        hExpKey, &
        dwBlobType, &
        dwFlags, &
        pbData, &
        pdwDataLen)
USE DFWINTY
  integer(BOOL) :: CryptExportKey ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptExportKey' :: CryptExportKey
  integer(ULONG_PTR) hKey ! HCRYPTKEY hKey
  integer(ULONG_PTR) hExpKey ! HCRYPTKEY hExpKey
  integer(DWORD) dwBlobType ! DWORD dwBlobType
  integer(DWORD) dwFlags ! DWORD dwFlags
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL, NO_ARG_CHECK :: pbData
integer(BYTE) pbData ! BYTE* pbData
!DEC$ ATTRIBUTES REFERENCE :: pdwDataLen
integer(DWORD) pdwDataLen ! DWORD* pdwDataLen
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptImportKey( &
        hProv, &
        pbData, &
        dwDataLen, &
        hPubKey, &
        dwFlags, &
        phKey)
USE DFWINTY
  integer(BOOL) :: CryptImportKey ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptImportKey' :: CryptImportKey
  integer(ULONG_PTR) hProv ! HCRYPTPROV hProv
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL, NO_ARG_CHECK :: pbData
integer(BYTE) pbData ! BYTE* pbData
  integer(DWORD) dwDataLen ! DWORD dwDataLen
  integer(ULONG_PTR) hPubKey ! HCRYPTKEY hPubKey
  integer(DWORD) dwFlags ! DWORD dwFlags
!DEC$ ATTRIBUTES REFERENCE :: phKey
  integer(ULONG_PTR) phKey ! HCRYPTKEY* phKey
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptEncrypt( &
        hKey, &
        hHash, &
        Final, &
        dwFlags, &
        pbData, &
        pdwDataLen, &
        dwBufLen)
USE DFWINTY
  integer(BOOL) :: CryptEncrypt ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptEncrypt' :: CryptEncrypt
  integer(ULONG_PTR) hKey ! HCRYPTKEY hKey
  integer(ULONG_PTR) hHash ! HCRYPTHASH hHash
  integer(BOOL) Final ! BOOL Final
  integer(DWORD) dwFlags ! DWORD dwFlags
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL, NO_ARG_CHECK :: pbData
integer(BYTE) pbData ! BYTE* pbData
!DEC$ ATTRIBUTES REFERENCE :: pdwDataLen
integer(DWORD) pdwDataLen ! DWORD* pdwDataLen
  integer(DWORD) dwBufLen ! DWORD dwBufLen
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptDecrypt( &
        hKey, &
        hHash, &
        Final, &
        dwFlags, &
        pbData, &
        pdwDataLen)
USE DFWINTY
  integer(BOOL) :: CryptDecrypt ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptDecrypt' :: CryptDecrypt
  integer(ULONG_PTR) hKey ! HCRYPTKEY hKey
  integer(ULONG_PTR) hHash ! HCRYPTHASH hHash
  integer(BOOL) Final ! BOOL Final
  integer(DWORD) dwFlags ! DWORD dwFlags
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL, NO_ARG_CHECK :: pbData
integer(BYTE) pbData ! BYTE* pbData
!DEC$ ATTRIBUTES REFERENCE :: pdwDataLen
integer(DWORD) pdwDataLen ! DWORD* pdwDataLen
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptCreateHash( &
        hProv, &
        Algid, &
        hKey, &
        dwFlags, &
        phHash)
USE DFWINTY
  integer(BOOL) :: CryptCreateHash ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptCreateHash' :: CryptCreateHash
  integer(ULONG_PTR) hProv ! HCRYPTPROV hProv
  integer(UINT) Algid ! ALG_ID Algid
  integer(ULONG_PTR) hKey ! HCRYPTKEY hKey
  integer(DWORD) dwFlags ! DWORD dwFlags
!DEC$ ATTRIBUTES REFERENCE :: phHash
  integer(ULONG_PTR) phHash ! HCRYPTHASH* phHash
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptHashData( &
        hHash, &
        pbData, &
        dwDataLen, &
        dwFlags)
USE DFWINTY
  integer(BOOL) :: CryptHashData ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptHashData' :: CryptHashData
  integer(ULONG_PTR) hHash ! HCRYPTHASH hHash
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL, NO_ARG_CHECK :: pbData
integer(BYTE) pbData ! BYTE* pbData
  integer(DWORD) dwDataLen ! DWORD dwDataLen
  integer(DWORD) dwFlags ! DWORD dwFlags
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptHashSessionKey( &
        hHash, &
        hKey, &
        dwFlags)
USE DFWINTY
  integer(BOOL) :: CryptHashSessionKey ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptHashSessionKey' :: CryptHashSessionKey
  integer(ULONG_PTR) hHash ! HCRYPTHASH hHash
  integer(ULONG_PTR) hKey ! HCRYPTKEY hKey
  integer(DWORD) dwFlags ! DWORD dwFlags
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptDestroyHash( &
        hHash)
USE DFWINTY
  integer(BOOL) :: CryptDestroyHash ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptDestroyHash' :: CryptDestroyHash
  integer(ULONG_PTR) hHash ! HCRYPTHASH hHash
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptSignHash( &
        hHash, &
        dwKeySpec, &
        sDescription, &
        dwFlags, &
        pbSignature, &
        pdwSigLen)
USE DFWINTY
  integer(BOOL) :: CryptSignHash ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptSignHashA' :: CryptSignHash
  integer(ULONG_PTR) hHash ! HCRYPTHASH hHash
  integer(DWORD) dwKeySpec ! DWORD dwKeySpec
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: sDescription
  character*(*) sDescription ! LPCSTR sDescription
  integer(DWORD) dwFlags ! DWORD dwFlags
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL, NO_ARG_CHECK :: pbSignature
integer(BYTE) pbSignature ! BYTE* pbSignature
!DEC$ ATTRIBUTES REFERENCE :: pdwSigLen
integer(DWORD) pdwSigLen ! DWORD* pdwSigLen
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptVerifySignature( &
        hHash, &
        pbSignature, &
        dwSigLen, &
        hPubKey, &
        sDescription, &
        dwFlags)
USE DFWINTY
  integer(BOOL) :: CryptVerifySignature ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptVerifySignatureA' :: CryptVerifySignature
  integer(ULONG_PTR) hHash ! HCRYPTHASH hHash
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL, NO_ARG_CHECK :: pbSignature
integer(BYTE) pbSignature ! BYTE* pbSignature
  integer(DWORD) dwSigLen ! DWORD dwSigLen
  integer(ULONG_PTR) hPubKey ! HCRYPTKEY hPubKey
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: sDescription
  character*(*) sDescription ! LPCSTR sDescription
  integer(DWORD) dwFlags ! DWORD dwFlags
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptSetProvider( &
        pszProvName, &
        dwProvType)
USE DFWINTY
  integer(BOOL) :: CryptSetProvider ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptSetProviderA' :: CryptSetProvider
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: pszProvName
  character*(*) pszProvName ! LPCSTR pszProvName
  integer(DWORD) dwProvType ! DWORD dwProvType
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptSetProviderEx( &
        pszProvName, &
        dwProvType, &
        pdwReserved, &
        dwFlags)
USE DFWINTY
  integer(BOOL) :: CryptSetProviderEx ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptSetProviderExA' :: CryptSetProviderEx
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: pszProvName
  character*(*) pszProvName ! LPCSTR pszProvName
  integer(DWORD) dwProvType ! DWORD dwProvType
!DEC$ ATTRIBUTES REFERENCE :: pdwReserved
integer(DWORD) pdwReserved ! DWORD*  pdwReserved
  integer(DWORD) dwFlags ! DWORD dwFlags
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptGetDefaultProvider( &
        dwProvType, &
        pdwReserved, &
        dwFlags, &
        pszProvName, &
        pcbProvName)
USE DFWINTY
  integer(BOOL) :: CryptGetDefaultProvider ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptGetDefaultProviderA' :: CryptGetDefaultProvider
  integer(DWORD) dwProvType ! DWORD dwProvType
!DEC$ ATTRIBUTES REFERENCE :: pdwReserved
integer(DWORD) pdwReserved ! DWORD* pdwReserved
  integer(DWORD) dwFlags ! DWORD dwFlags
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: pszProvName
  character*(*) pszProvName ! LPSTR pszProvName
!DEC$ ATTRIBUTES REFERENCE :: pcbProvName
integer(DWORD) pcbProvName ! DWORD* pcbProvName
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptEnumProviderTypes( &
        dwIndex, &
        pdwReserved, &
        dwFlags, &
        pdwProvType, &
        pszTypeName, &
        pcbTypeName)
USE DFWINTY
  integer(BOOL) :: CryptEnumProviderTypes ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptEnumProviderTypesA' :: CryptEnumProviderTypes
  integer(DWORD) dwIndex ! DWORD dwIndex
!DEC$ ATTRIBUTES REFERENCE :: pdwReserved
integer(DWORD) pdwReserved ! DWORD*  pdwReserved
  integer(DWORD) dwFlags ! DWORD dwFlags
!DEC$ ATTRIBUTES REFERENCE :: pdwProvType
integer(DWORD) pdwProvType ! DWORD*  pdwProvType
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: pszTypeName
  character*(*) pszTypeName ! LPSTR pszTypeName
!DEC$ ATTRIBUTES REFERENCE :: pcbTypeName
integer(DWORD) pcbTypeName ! DWORD*  pcbTypeName
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptEnumProviders( &
        dwIndex, &
        pdwReserved, &
        dwFlags, &
        pdwProvType, &
        pszProvName, &
        pcbProvName)
USE DFWINTY
  integer(BOOL) :: CryptEnumProviders ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptEnumProvidersA' :: CryptEnumProviders
  integer(DWORD) dwIndex ! DWORD dwIndex
!DEC$ ATTRIBUTES REFERENCE :: pdwReserved
integer(DWORD) pdwReserved ! DWORD*  pdwReserved
  integer(DWORD) dwFlags ! DWORD dwFlags
!DEC$ ATTRIBUTES REFERENCE :: pdwProvType
integer(DWORD) pdwProvType ! DWORD*  pdwProvType
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: pszProvName
  character*(*) pszProvName ! LPSTR pszProvName
!DEC$ ATTRIBUTES REFERENCE :: pcbProvName
integer(DWORD) pcbProvName ! DWORD*  pcbProvName
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptContextAddRef( &
        hProv, &
        pdwReserved, &
        dwFlags)
USE DFWINTY
  integer(BOOL) :: CryptContextAddRef ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptContextAddRef' :: CryptContextAddRef
  integer(ULONG_PTR) hProv ! HCRYPTPROV hProv
!DEC$ ATTRIBUTES REFERENCE :: pdwReserved
integer(DWORD) pdwReserved ! DWORD*  pdwReserved
  integer(DWORD) dwFlags ! DWORD dwFlags
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptDuplicateKey( &
        hKey, &
        pdwReserved, &
        dwFlags, &
        phKey)
USE DFWINTY
  integer(BOOL) :: CryptDuplicateKey ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptDuplicateKey' :: CryptDuplicateKey
  integer(ULONG_PTR) hKey ! HCRYPTKEY hKey
!DEC$ ATTRIBUTES REFERENCE :: pdwReserved
integer(DWORD) pdwReserved ! DWORD*  pdwReserved
  integer(DWORD) dwFlags ! DWORD dwFlags
!DEC$ ATTRIBUTES REFERENCE :: phKey
  integer(ULONG_PTR)  phKey ! HCRYPTKEY*  phKey
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CryptDuplicateHash( &
        hHash, &
        pdwReserved, &
        dwFlags, &
        phHash)
USE DFWINTY
  integer(BOOL) :: CryptDuplicateHash ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CryptDuplicateHash' :: CryptDuplicateHash
  integer(ULONG_PTR) hHash ! HCRYPTHASH hHash
!DEC$ ATTRIBUTES REFERENCE :: pdwReserved
integer(DWORD) pdwReserved ! DWORD*  pdwReserved
  integer(DWORD) dwFlags ! DWORD dwFlags
!DEC$ ATTRIBUTES REFERENCE :: phHash
  integer(ULONG_PTR)  phHash ! HCRYPTHASH*  phHash
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION QueryUsersOnEncryptedFile( &
        lpFileName, &
        pUsers)
USE DFWINTY
  integer(DWORD) :: QueryUsersOnEncryptedFile ! DWORD
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'QueryUsersOnEncryptedFile' :: QueryUsersOnEncryptedFile
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpFileName
  integer(WCHAR) lpFileName(*) ! LPCWSTR lpFileName
!DEC$ ATTRIBUTES REFERENCE :: pUsers
  integer(ULONG_PTR) pUsers ! PENCRYPTION_CERTIFICATE_HASH_LIST*  pUsers
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION QueryRecoveryAgentsOnEncryptedFile( &
        lpFileName, &
        pRecoveryAgents)
USE DFWINTY
  integer(DWORD) :: QueryRecoveryAgentsOnEncryptedFile ! DWORD
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'QueryRecoveryAgentsOnEncryptedFile' :: QueryRecoveryAgentsOnEncryptedFile
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpFileName
  integer(WCHAR) lpFileName(*) ! LPCWSTR lpFileName
!DEC$ ATTRIBUTES REFERENCE :: pRecoveryAgents
  integer(ULONG_PTR) pRecoveryAgents ! PENCRYPTION_CERTIFICATE_HASH_LIST*  pRecoveryAgents
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RemoveUsersFromEncryptedFile( &
        lpFileName, &
        pHashes)
USE DFWINTY
  integer(DWORD) :: RemoveUsersFromEncryptedFile ! DWORD
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RemoveUsersFromEncryptedFile' :: RemoveUsersFromEncryptedFile
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpFileName
  integer(WCHAR) lpFileName(*) ! LPCWSTR lpFileName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: pHashes
  TYPE (T_ENCRYPTION_CERTIFICATE_HASH_LIST) pHashes ! PENCRYPTION_CERTIFICATE_HASH_LIST pHashes
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION AddUsersToEncryptedFile( &
        lpFileName, &
        pUsers)
USE DFWINTY
  integer(DWORD) :: AddUsersToEncryptedFile ! DWORD
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'AddUsersToEncryptedFile' :: AddUsersToEncryptedFile
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpFileName
  integer(WCHAR) lpFileName(*) ! LPCWSTR lpFileName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: pUsers
  TYPE (T_ENCRYPTION_CERTIFICATE_LIST) pUsers ! PENCRYPTION_CERTIFICATE_LIST pUsers
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION SetUserFileEncryptionKey( &
        pEncryptionCertificate)
USE DFWINTY
  integer(DWORD) :: SetUserFileEncryptionKey ! DWORD
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'SetUserFileEncryptionKey' :: SetUserFileEncryptionKey
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: pEncryptionCertificate
  TYPE (T_ENCRYPTION_CERTIFICATE) pEncryptionCertificate ! PENCRYPTION_CERTIFICATE pEncryptionCertificate
 END FUNCTION
END INTERFACE
INTERFACE 
   SUBROUTINE FreeEncryptionCertificateHashList( &
        pHashes)
USE DFWINTY
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'FreeEncryptionCertificateHashList' :: FreeEncryptionCertificateHashList
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: pHashes
  TYPE (T_ENCRYPTION_CERTIFICATE_HASH_LIST) pHashes ! PENCRYPTION_CERTIFICATE_HASH_LIST pHashes
 END SUBROUTINE
END INTERFACE
INTERFACE 
FUNCTION EncryptionDisable( &
        DirPath, &
        Disable)
USE DFWINTY
  integer(BOOL) :: EncryptionDisable ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'EncryptionDisable' :: EncryptionDisable
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: DirPath
  integer(WCHAR) DirPath(*) ! LPCWSTR DirPath
  integer(BOOL) Disable ! BOOL Disable
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION ChangeServiceConfig( &
        hService, &
        dwServiceType, &
        dwStartType, &
        dwErrorControl, &
        lpBinaryPathName, &
        lpLoadOrderGroup, &
        lpdwTagId, &
        lpDependencies, &
        lpServiceStartName, &
        lpPassword, &
        lpDisplayName)
USE DFWINTY
  integer(BOOL) :: ChangeServiceConfig ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'ChangeServiceConfigA' :: ChangeServiceConfig
  integer(HANDLE) hService ! SC_HANDLE hService
  integer(DWORD) dwServiceType ! DWORD dwServiceType
  integer(DWORD) dwStartType ! DWORD dwStartType
  integer(DWORD) dwErrorControl ! DWORD dwErrorControl
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpBinaryPathName
  character*(*) lpBinaryPathName ! LPCSTR lpBinaryPathName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpLoadOrderGroup
  character*(*) lpLoadOrderGroup ! LPCSTR lpLoadOrderGroup
  integer(LPDWORD) lpdwTagId ! LPDWORD lpdwTagId
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpDependencies
  character*(*) lpDependencies ! LPCSTR lpDependencies
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpServiceStartName
  character*(*) lpServiceStartName ! LPCSTR lpServiceStartName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpPassword
  character*(*) lpPassword ! LPCSTR lpPassword
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpDisplayName
  character*(*) lpDisplayName ! LPCSTR lpDisplayName
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION ChangeServiceConfig2( &
        hService, &
        dwInfoLevel, &
        lpInfo)
USE DFWINTY
  integer(BOOL) :: ChangeServiceConfig2 ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'ChangeServiceConfig2A' :: ChangeServiceConfig2
  integer(HANDLE) hService ! SC_HANDLE hService
  integer(DWORD) dwInfoLevel ! DWORD dwInfoLevel
  integer(LPVOID) lpInfo ! LPVOID lpInfo
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CloseServiceHandle( &
        hSCObject)
USE DFWINTY
  integer(BOOL) :: CloseServiceHandle ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CloseServiceHandle' :: CloseServiceHandle
  integer(HANDLE) hSCObject ! SC_HANDLE hSCObject
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION ControlService( &
        hService, &
        dwControl, &
        lpServiceStatus)
USE DFWINTY
  integer(BOOL) :: ControlService ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'ControlService' :: ControlService
  integer(HANDLE) hService ! SC_HANDLE hService
  integer(DWORD) dwControl ! DWORD dwControl
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpServiceStatus
  TYPE (T_SERVICE_STATUS) lpServiceStatus ! LPSERVICE_STATUS lpServiceStatus
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION CreateService( &
        hSCManager, &
        lpServiceName, &
        lpDisplayName, &
        dwDesiredAccess, &
        dwServiceType, &
        dwStartType, &
        dwErrorControl, &
        lpBinaryPathName, &
        lpLoadOrderGroup, &
        lpdwTagId, &
        lpDependencies, &
        lpServiceStartName, &
        lpPassword)
USE DFWINTY
  integer(HANDLE) :: CreateService ! SC_HANDLE
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'CreateServiceA' :: CreateService
  integer(HANDLE) hSCManager ! SC_HANDLE hSCManager
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpServiceName
  character*(*) lpServiceName ! LPCSTR lpServiceName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpDisplayName
  character*(*) lpDisplayName ! LPCSTR lpDisplayName
  integer(DWORD) dwDesiredAccess ! DWORD dwDesiredAccess
  integer(DWORD) dwServiceType ! DWORD dwServiceType
  integer(DWORD) dwStartType ! DWORD dwStartType
  integer(DWORD) dwErrorControl ! DWORD dwErrorControl
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpBinaryPathName
  character*(*) lpBinaryPathName ! LPCSTR lpBinaryPathName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpLoadOrderGroup
  character*(*) lpLoadOrderGroup ! LPCSTR lpLoadOrderGroup
  integer(LPDWORD) lpdwTagId ! LPDWORD lpdwTagId
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpDependencies
  character*(*) lpDependencies ! LPCSTR lpDependencies
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpServiceStartName
  character*(*) lpServiceStartName ! LPCSTR lpServiceStartName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpPassword
  character*(*) lpPassword ! LPCSTR lpPassword
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION DeleteService( &
        hService)
USE DFWINTY
  integer(BOOL) :: DeleteService ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'DeleteService' :: DeleteService
  integer(HANDLE) hService ! SC_HANDLE hService
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION EnumDependentServices( &
        hService, &
        dwServiceState, &
        lpServices, &
        cbBufSize, &
        pcbBytesNeeded, &
        lpServicesReturned)
USE DFWINTY
  integer(BOOL) :: EnumDependentServices ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'EnumDependentServicesA' :: EnumDependentServices
  integer(HANDLE) hService ! SC_HANDLE hService
  integer(DWORD) dwServiceState ! DWORD dwServiceState
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpServices
  TYPE (T_ENUM_SERVICE_STATUS) lpServices ! LPENUM_SERVICE_STATUSA lpServices
  integer(DWORD) cbBufSize ! DWORD cbBufSize
  integer(LPDWORD) pcbBytesNeeded ! LPDWORD pcbBytesNeeded
  integer(LPDWORD) lpServicesReturned ! LPDWORD lpServicesReturned
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION EnumServicesStatus( &
        hSCManager, &
        dwServiceType, &
        dwServiceState, &
        lpServices, &
        cbBufSize, &
        pcbBytesNeeded, &
        lpServicesReturned, &
        lpResumeHandle)
USE DFWINTY
  integer(BOOL) :: EnumServicesStatus ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'EnumServicesStatusA' :: EnumServicesStatus
  integer(HANDLE) hSCManager ! SC_HANDLE hSCManager
  integer(DWORD) dwServiceType ! DWORD dwServiceType
  integer(DWORD) dwServiceState ! DWORD dwServiceState
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpServices
  TYPE (T_ENUM_SERVICE_STATUS) lpServices ! LPENUM_SERVICE_STATUSA lpServices
  integer(DWORD) cbBufSize ! DWORD cbBufSize
  integer(LPDWORD) pcbBytesNeeded ! LPDWORD pcbBytesNeeded
  integer(LPDWORD) lpServicesReturned ! LPDWORD lpServicesReturned
  integer(LPDWORD) lpResumeHandle ! LPDWORD lpResumeHandle
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION EnumServicesStatusEx( &
        hSCManager, &
        InfoLevel, &
        dwServiceType, &
        dwServiceState, &
        lpServices, &
        cbBufSize, &
        pcbBytesNeeded, &
        lpServicesReturned, &
        lpResumeHandle, &
        pszGroupName)
USE DFWINTY
  integer(BOOL) :: EnumServicesStatusEx ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'EnumServicesStatusExA' :: EnumServicesStatusEx
  integer(HANDLE) hSCManager ! SC_HANDLE hSCManager
  integer(ENUM) InfoLevel ! SC_ENUM_TYPE InfoLevel
  integer(DWORD) dwServiceType ! DWORD dwServiceType
  integer(DWORD) dwServiceState ! DWORD dwServiceState
  integer(LPBYTE) lpServices ! LPBYTE lpServices
  integer(DWORD) cbBufSize ! DWORD cbBufSize
  integer(LPDWORD) pcbBytesNeeded ! LPDWORD pcbBytesNeeded
  integer(LPDWORD) lpServicesReturned ! LPDWORD lpServicesReturned
  integer(LPDWORD) lpResumeHandle ! LPDWORD lpResumeHandle
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: pszGroupName
  character*(*) pszGroupName ! LPCSTR pszGroupName
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetServiceKeyName( &
        hSCManager, &
        lpDisplayName, &
        lpServiceName, &
        lpcchBuffer)
USE DFWINTY
  integer(BOOL) :: GetServiceKeyName ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetServiceKeyNameA' :: GetServiceKeyName
  integer(HANDLE) hSCManager ! SC_HANDLE hSCManager
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpDisplayName
  character*(*) lpDisplayName ! LPCSTR lpDisplayName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpServiceName
  character*(*) lpServiceName ! LPSTR lpServiceName
  integer(LPDWORD) lpcchBuffer ! LPDWORD lpcchBuffer
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION GetServiceDisplayName( &
        hSCManager, &
        lpServiceName, &
        lpDisplayName, &
        lpcchBuffer)
USE DFWINTY
  integer(BOOL) :: GetServiceDisplayName ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetServiceDisplayNameA' :: GetServiceDisplayName
  integer(HANDLE) hSCManager ! SC_HANDLE hSCManager
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpServiceName
  character*(*) lpServiceName ! LPCSTR lpServiceName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpDisplayName
  character*(*) lpDisplayName ! LPSTR lpDisplayName
  integer(LPDWORD) lpcchBuffer ! LPDWORD lpcchBuffer
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION LockServiceDatabase( &
        hSCManager)
USE DFWINTY
  integer(LPVOID) :: LockServiceDatabase ! SC_LOCK
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'LockServiceDatabase' :: LockServiceDatabase
  integer(HANDLE) hSCManager ! SC_HANDLE hSCManager
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION NotifyBootConfigStatus( &
        BootAcceptable)
USE DFWINTY
  integer(BOOL) :: NotifyBootConfigStatus ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'NotifyBootConfigStatus' :: NotifyBootConfigStatus
  integer(BOOL) BootAcceptable ! BOOL BootAcceptable
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION OpenSCManager( &
        lpMachineName, &
        lpDatabaseName, &
        dwDesiredAccess)
USE DFWINTY
  integer(HANDLE) :: OpenSCManager ! SC_HANDLE
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'OpenSCManagerA' :: OpenSCManager
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpMachineName
  character*(*) lpMachineName ! LPCSTR lpMachineName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpDatabaseName
  character*(*) lpDatabaseName ! LPCSTR lpDatabaseName
  integer(DWORD) dwDesiredAccess ! DWORD dwDesiredAccess
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION OpenService( &
        hSCManager, &
        lpServiceName, &
        dwDesiredAccess)
USE DFWINTY
  integer(HANDLE) :: OpenService ! SC_HANDLE
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'OpenServiceA' :: OpenService
  integer(HANDLE) hSCManager ! SC_HANDLE hSCManager
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpServiceName
  character*(*) lpServiceName ! LPCSTR lpServiceName
  integer(DWORD) dwDesiredAccess ! DWORD dwDesiredAccess
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION QueryServiceConfig( &
        hService, &
        lpServiceConfig, &
        cbBufSize, &
        pcbBytesNeeded)
USE DFWINTY
  integer(BOOL) :: QueryServiceConfig ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'QueryServiceConfigA' :: QueryServiceConfig
  integer(HANDLE) hService ! SC_HANDLE hService
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpServiceConfig
  TYPE (T_QUERY_SERVICE_CONFIG) lpServiceConfig ! LPQUERY_SERVICE_CONFIGA lpServiceConfig
  integer(DWORD) cbBufSize ! DWORD cbBufSize
  integer(LPDWORD) pcbBytesNeeded ! LPDWORD pcbBytesNeeded
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION QueryServiceConfig2( &
        hService, &
        dwInfoLevel, &
        lpBuffer, &
        cbBufSize, &
        pcbBytesNeeded)
USE DFWINTY
  integer(BOOL) :: QueryServiceConfig2 ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'QueryServiceConfig2A' :: QueryServiceConfig2
  integer(HANDLE) hService ! SC_HANDLE hService
  integer(DWORD) dwInfoLevel ! DWORD dwInfoLevel
  integer(LPBYTE) lpBuffer ! LPBYTE lpBuffer
  integer(DWORD) cbBufSize ! DWORD cbBufSize
  integer(LPDWORD) pcbBytesNeeded ! LPDWORD pcbBytesNeeded
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION QueryServiceLockStatus( &
        hSCManager, &
        lpLockStatus, &
        cbBufSize, &
        pcbBytesNeeded)
USE DFWINTY
  integer(BOOL) :: QueryServiceLockStatus ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'QueryServiceLockStatusA' :: QueryServiceLockStatus
  integer(HANDLE) hSCManager ! SC_HANDLE hSCManager
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpLockStatus
  TYPE (T_QUERY_SERVICE_LOCK_STATUS) lpLockStatus ! LPQUERY_SERVICE_LOCK_STATUSA lpLockStatus
  integer(DWORD) cbBufSize ! DWORD cbBufSize
  integer(LPDWORD) pcbBytesNeeded ! LPDWORD pcbBytesNeeded
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION QueryServiceObjectSecurity( &
        hService, &
        dwSecurityInformation, &
        lpSecurityDescriptor, &
        cbBufSize, &
        pcbBytesNeeded)
USE DFWINTY
  integer(BOOL) :: QueryServiceObjectSecurity ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'QueryServiceObjectSecurity' :: QueryServiceObjectSecurity
  integer(HANDLE) hService ! SC_HANDLE hService
  integer(ULONG) dwSecurityInformation ! SECURITY_INFORMATION dwSecurityInformation
  integer(LPVOID) lpSecurityDescriptor ! PSECURITY_DESCRIPTOR lpSecurityDescriptor
  integer(DWORD) cbBufSize ! DWORD cbBufSize
  integer(LPDWORD) pcbBytesNeeded ! LPDWORD pcbBytesNeeded
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION QueryServiceStatus( &
        hService, &
        lpServiceStatus)
USE DFWINTY
  integer(BOOL) :: QueryServiceStatus ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'QueryServiceStatus' :: QueryServiceStatus
  integer(HANDLE) hService ! SC_HANDLE hService
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpServiceStatus
  TYPE (T_SERVICE_STATUS) lpServiceStatus ! LPSERVICE_STATUS lpServiceStatus
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION QueryServiceStatusEx( &
        hService, &
        InfoLevel, &
        lpBuffer, &
        cbBufSize, &
        pcbBytesNeeded)
USE DFWINTY
  integer(BOOL) :: QueryServiceStatusEx ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'QueryServiceStatusEx' :: QueryServiceStatusEx
  integer(HANDLE) hService ! SC_HANDLE hService
  integer(ENUM) InfoLevel ! SC_STATUS_TYPE InfoLevel
  integer(LPBYTE) lpBuffer ! LPBYTE lpBuffer
  integer(DWORD) cbBufSize ! DWORD cbBufSize
  integer(LPDWORD) pcbBytesNeeded ! LPDWORD pcbBytesNeeded
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegisterServiceCtrlHandler( &
        lpServiceName, &
        lpHandlerProc)
USE DFWINTY
  integer(HANDLE) :: RegisterServiceCtrlHandler ! SERVICE_STATUS_HANDLE
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegisterServiceCtrlHandlerA' :: RegisterServiceCtrlHandler
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpServiceName
  character*(*) lpServiceName ! LPCSTR lpServiceName
  integer(LPVOID) lpHandlerProc ! LPHANDLER_FUNCTION lpHandlerProc
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION RegisterServiceCtrlHandlerEx( &
        lpServiceName, &
        lpHandlerProc, &
        lpContext)
USE DFWINTY
  integer(HANDLE) :: RegisterServiceCtrlHandlerEx ! SERVICE_STATUS_HANDLE
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'RegisterServiceCtrlHandlerExA' :: RegisterServiceCtrlHandlerEx
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpServiceName
  character*(*) lpServiceName ! LPCSTR lpServiceName
    integer(LPVOID) lpHandlerProc ! LPHANDLER_FUNCTION_EX lpHandlerProc
  integer(LPVOID) lpContext ! LPVOID lpContext
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION SetServiceObjectSecurity( &
        hService, &
        dwSecurityInformation, &
        lpSecurityDescriptor)
USE DFWINTY
  integer(BOOL) :: SetServiceObjectSecurity ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'SetServiceObjectSecurity' :: SetServiceObjectSecurity
  integer(HANDLE) hService ! SC_HANDLE hService
  integer(ULONG) dwSecurityInformation ! SECURITY_INFORMATION dwSecurityInformation
  integer(LPVOID) lpSecurityDescriptor ! PSECURITY_DESCRIPTOR lpSecurityDescriptor
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION SetServiceStatus( &
        hServiceStatus, &
        lpServiceStatus)
USE DFWINTY
  integer(BOOL) :: SetServiceStatus ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'SetServiceStatus' :: SetServiceStatus
  integer(HANDLE) hServiceStatus ! SERVICE_STATUS_HANDLE hServiceStatus
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpServiceStatus
  TYPE (T_SERVICE_STATUS) lpServiceStatus ! LPSERVICE_STATUS lpServiceStatus
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION StartServiceCtrlDispatcher( &
        lpServiceStartTable)
USE DFWINTY
  integer(BOOL) :: StartServiceCtrlDispatcher ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'StartServiceCtrlDispatcherA' :: StartServiceCtrlDispatcher
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpServiceStartTable
  TYPE (T_SERVICE_TABLE_ENTRY) lpServiceStartTable ! SERVICE_TABLE_ENTRYA* lpServiceStartTable
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION StartService( &
        hService, &
        dwNumServiceArgs, &
        lpServiceArgVectors)
USE DFWINTY
  integer(BOOL) :: StartService ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'StartServiceA' :: StartService
  integer(HANDLE) hService ! SC_HANDLE hService
  integer(DWORD) dwNumServiceArgs ! DWORD dwNumServiceArgs
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC :: lpServiceArgVectors
  integer(LPCSTR) lpServiceArgVectors ! LPCSTR* lpServiceArgVectors
 END FUNCTION
END INTERFACE
INTERFACE 
FUNCTION UnlockServiceDatabase( &
        ScLock)
USE DFWINTY
  integer(BOOL) :: UnlockServiceDatabase ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'UnlockServiceDatabase' :: UnlockServiceDatabase
  integer(LPVOID) ScLock ! SC_LOCK ScLock
 END FUNCTION
END INTERFACE
!
end module advapi32
!
!DEC$ ENDIF ! /* ADVAPI32_ */
