MCPcopy Create free account
hub / github.com/KDAB/GammaRay / queryFullProcessImageName

Function queryFullProcessImageName

launcher/ui/processlist_win.cpp:58–74  ·  view source on GitHub ↗

Resolve QueryFullProcessImageNameW out of kernel32.dll due to incomplete MinGW import libs and it not being present on Windows XP.

Source from the content-addressed store, hash-verified

56// to incomplete MinGW import libs and it not being present
57// on Windows XP.
58static inline BOOL queryFullProcessImageName(HANDLE h, DWORD flags, LPWSTR buffer, DWORD *size)
59{
60 // Resolve required symbols from the kernel32.dll
61 typedef BOOL(WINAPI * QueryFullProcessImageNameWProtoType)(HANDLE, DWORD, LPWSTR, PDWORD);
62 static QueryFullProcessImageNameWProtoType queryFullProcessImageNameW = nullptr;
63 if (!queryFullProcessImageNameW) {
64 QLibrary kernel32Lib(QLatin1String("kernel32.dll"), 0);
65 if (kernel32Lib.isLoaded() || kernel32Lib.load()) {
66 queryFullProcessImageNameW = ( QueryFullProcessImageNameWProtoType )kernel32Lib.resolve(
67 "QueryFullProcessImageNameW");
68 }
69 }
70 if (!queryFullProcessImageNameW)
71 return FALSE;
72 // Read out process
73 return (*queryFullProcessImageNameW)(h, flags, buffer, size);
74}
75
76struct ProcessInfo
77{

Callers 1

processInfoFunction · 0.85

Calls 2

loadMethod · 0.45
resolveMethod · 0.45

Tested by

no test coverage detected