Jump to content

Search the Community

Showing results for tags 'different'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 2 results

  1. The following code contains 2 functions to achieve the same results, although function2 works fine whereas function1 returns different results ;#include <Array.au3> #include <security.au3> #include <WinAPI.au3> #include <ProcessConstants.au3> Global Const $TOKEN_MAXIMUM_ALLOWED = 0x02000000 Func _GetTokenPSid($hToken) Local $aCall = DllStructGetData(_Security__GetTokenInformation($hToken, $TOKENUSER), 1) $tempPtr = DllStructCreate("PTR") $ptrSize = DllStructGetSize($tempPtr) $rawSid = BinaryMid($aCall, $ptrSize * 2 + 1, BinaryLen($aCall)) $mem = DllStructCreate("byte Attributes[" & BinaryLen($rawSid) & "]") DllStructSetData($mem, "Attributes", $rawSid) $pSid = DllStructGetPtr($mem) Return $pSid EndFunc ;==>_GetTokenPSid Func _GetTokenUser1($hToken) $pSid = _GetTokenPSid($hToken) Local $aCall = DllCall("advapi32.dll", "bool", "LookupAccountSidW", "ptr", "", "ptr", $pSid, "wstr", "", "dword*", 65536, "wstr", "", "dword*", 65536, "int*", 0) If IsArray($aCall) Then Return $aCall[5] & "\" & $aCall[3] Else Return "" EndIf EndFunc ;==>_GetTokenUser Func _GetTokenUser2($hToken) Local $aCall = DllStructGetData(_Security__GetTokenInformation($hToken, $TOKENUSER), 1) $tempPtr = DllStructCreate("PTR") $ptrSize = DllStructGetSize($tempPtr) $rawSid = BinaryMid($aCall, $ptrSize * 2 + 1, BinaryLen($aCall)) $mem = DllStructCreate("byte Attributes[" & BinaryLen($rawSid) & "]") DllStructSetData($mem, "Attributes", $rawSid) $pSid = DllStructGetPtr($mem) Local $bCall = DllCall("advapi32.dll", "bool", "LookupAccountSidW", "ptr", "", "ptr", $pSID, "wstr", "", "dword*", 65536, "wstr", "", "dword*", 65536, "int*", 0) If IsArray($bCall) Then Return $bCall[5] & "\" & $bCall[3] Else Return "" EndIf EndFunc Func _ProcessTokenInfo($pid) $hToken = _Security__OpenProcessToken(_WinAPI_OpenProcess($TOKEN_MAXIMUM_ALLOWED, 0, $pid), $TOKEN_QUERY) If Not $hToken Then $hToken = _Security__OpenProcessToken(_WinAPI_OpenProcess($PROCESS_QUERY_LIMITED_INFORMATION, 0, $pid), $TOKEN_QUERY) EndIf ConsoleWrite("GetTokenUser1 : " & _GetTokenUser1($hToken) & @CRLF) ConsoleWrite("GetTokenUser2 : " & _GetTokenUser2($hToken) & @CRLF) ConsoleWrite(@CRLF) _WinAPI_CloseHandle($hToken) Return EndFunc ;==>_ProcessTokenInfo For $i = 1 To 10 _ProcessTokenInfo(856) Next Below are the results Am I doing something wrong here ?
  2. Is it possible to show different menus for left click and right on tray icon simultaneously, if yes, please tell how, hoping for a reply soon
×
×
  • Create New...