Note that there are some explanatory texts on larger screens.

plurals
  1. PORemote Desktop Services
    text
    copied!<p>I am trying to get the remote desktop IP address, for that i am hooking the API WTSQuerysessionInformation .But this function is not hooking, please can any one help me.my code is as below .check any parameter mismatch and suggest me what i have do.</p> <pre><code>#include "stdafx.h" #include "MinHook.h" #include &lt;Wtsapi32.h&gt; #if defined _M_X64 #pragma comment(lib, "libMinHook.x64.lib") #elif defined _M_IX86 #pragma comment(lib, "libMinHook.x86.lib") #endif typedef BOOL(WINAPI *WTSQuerySessionInformationWNext)(IN HANDLE hServer, IN DWORD SessionId, IN WTS_INFO_CLASS WTSInfoClass, __deref_out_bcount(*pBytesReturned) LPWSTR * ppBuffer, __out DWORD * pBytesReturned); WTSQuerySessionInformationWNext Real_WTSQuerySessionInformationW = NULL; BOOL WINAPI WTSQuerySessionInformationWCallback(IN HANDLE hServer,IN DWORD SessionId, IN WTS_INFO_CLASS WTSInfoClass, __deref_out_bcount(*pBytesReturned) LPWSTR * ppBuffer, __out DWORD * pBytesReturned) { BOOL ret = Real_WTSQuerySessionInformationW(hServer, SessionId, WTSInfoClass, ppBuffer, pBytesReturned); if(ret != NULL) { MessageBoxA(NULL, "WTSQuerySessionInformationW Called", "Info", MB_OK); return ret; } else { MessageBoxA(NULL, "WTSQuerySessionInformationW fails", "Info", MB_OK); return ret; } } BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: if (MH_Initialize() != MH_OK) { MessageBoxW(NULL, L"Failed Initialize", L"Info!", MB_ICONWARNING|MB_OK); } if (MH_CreateHook(&amp;WTSQuerySessionInformationW, &amp;WTSQuerySessionInformationWCallback, reinterpret_cast&lt;void**&gt;(&amp;Real_WTSQuerySessionInformationW)) != MH_OK) { MessageBoxW(NULL, L"Failed CreateHook WTSQuerySessionInformationW", L"Info!",MB_ICONWARNING|MB_OK); } if (MH_EnableHook(&amp;WTSQuerySessionInformationW) != MH_OK) { MessageBoxW(NULL, L"Failed EnableHook WTSQuerySessionInformationW", L"Info!",MB_ICONWARNING|MB_OK); } break; case DLL_PROCESS_DETACH: if (MH_Uninitialize() != MH_OK) { } if(MH_DisableHook(&amp;ProcessIdToSessionId) != MH_OK) { } break; } return TRUE; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload