| 226 | static HMODULE gKernelDll = NULL; |
| 227 | |
| 228 | static void ImportKernel() |
| 229 | { |
| 230 | if (gKernelDll != NULL) |
| 231 | return; |
| 232 | |
| 233 | WCHAR path[MAX_PATH]; |
| 234 | GetSystemDirectory(path, MAX_PATH); |
| 235 | wcscat(path, L"\\kernel32.dll"); |
| 236 | gKernelDll = GetModuleHandle(path); |
| 237 | if (gKernelDll == NULL) |
| 238 | { |
| 239 | return; |
| 240 | } |
| 241 | |
| 242 | gSetThreadDescription = (SetThreadDescription_t)GetProcAddress(gKernelDll, "SetThreadDescription"); |
| 243 | gGetThreadDescription = (GetThreadDescription_t)GetProcAddress(gKernelDll, "GetThreadDescription"); |
| 244 | } |
| 245 | |
| 246 | void WinDebugger::TryGetThreadName(WdThreadInfo* threadInfo) |
| 247 | { |