MCPcopy Create free account
hub / github.com/Spuckwaffel/Kernel-Thread-Driver / GetProcessId

Function GetProcessId

UM/Driver.h:129–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129DWORD GetProcessId(const wchar_t* ImageName) {
130 HANDLE Snapshot{ CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0) };
131 PROCESSENTRY32W Process{ sizeof(PROCESSENTRY32W) };
132
133 if (Process32FirstW(Snapshot, &Process)) {
134 do {
135 if (!wcscmp(ImageName, Process.szExeFile)) {
136 CloseHandle(Snapshot);
137 return Process.th32ProcessID;
138 }
139 } while (Process32NextW(Snapshot, &Process));
140 }
141
142 CloseHandle(Snapshot);
143 return NULL;
144}

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected