#include #include #include Global Const $tagIOSTATUSBLOCK = "dword Status;ptr Information" Global Const $tagFILEINTERNALINFORMATION = "int IndexNumber;" MsgBox(0,'',_GetIndexNumber(@UserProfileDir & '\NTUSER.DAT')) Func _GetIndexNumber($path) Local $sISB = DllStructCreate($tagIOSTATUSBLOCK) Local $buffer = DllStructCreate("byte[16384]") Local $hFile = _WinAPI_CreateFileEx('\\?\' & $path, $OPEN_EXISTING, 0, BitOR($FILE_SHARE_READ, $FILE_SHARE_WRITE), BitOR($FILE_FLAG_BACKUP_SEMANTICS, $FILE_FLAG_OPEN_REPARSE_POINT)) If @error Then Return SetError(1, @extended, '') Local $aRet = DllCall('ntdll.dll', 'long', 'ZwQueryInformationFile', 'handle', $hFile, 'struct*', $sISB, 'struct*', $buffer, 'ulong', 16384, 'uint', 6) If @error Then Return SetError(2, @extended, '') If $aRet[0] Then Return SetError(3, $aRet[0], '') Local $pFSO = DllStructGetPtr($buffer) Local $sFSO = DllStructCreate($tagFILEINTERNALINFORMATION, $pFSO) Local $IndexNumber = DllStructGetData($sFSO, "IndexNumber") _WinAPI_CloseHandle($hFile) Return $IndexNumber EndFunc