Retrieves information about a specified object.
#Include <WinAPIEx.au3>
_WinAPI_GetObjectInfoByHandle ( $hObject )
$hObject | A handle to the object to obtain information about. |
Success | The array containing the following information: |
[0] | The attributes of the object. |
[1] | A mask that represents the granted access to the object. |
[2] | The number of handles to the object. |
[3] | The number of pointers to the object. |
Failure | 0 string and sets the @error flag to non-zero, @extended flag may contain the NTSTATUS code. |
在MSDN中搜索
#Include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
Global $hFile, $aInfo
$hFile = _WinAPI_CreateFile(@ScriptFullPath, 2, 0, 6)
If @error Then
Exit
EndIf
$aInfo = _WinAPI_GetObjectInfoByHandle($hFile)
If IsArray($aInfo) Then
ConsoleWrite('Handle: ' & $hFile & @CR)
ConsoleWrite('Attributes: 0x' & Hex($aInfo[0]) & @CR)
ConsoleWrite('Access: 0x' & Hex($aInfo[1]) & @CR)
ConsoleWrite('Handles: ' & $aInfo[2] & @CR)
ConsoleWrite('Pointers: ' & $aInfo[3] & @CR)
EndIf
_WinAPI_CloseHandle($hFile)