| 15 | namespace KbRtl { |
| 16 | |
| 17 | static PVOID GetKernelProcAddress(LPCSTR FunctionName) |
| 18 | { |
| 19 | // Converting ANSI-name to Unicode-name: |
| 20 | ULONG SymbolsCount = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, FunctionName, -1, NULL, 0); |
| 21 | std::wstring WideName(SymbolsCount, static_cast<WCHAR>(0x0000)); |
| 22 | MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, FunctionName, -1, const_cast<LPWSTR>(WideName.c_str()), SymbolsCount - 1); |
| 23 | |
| 24 | // Getting the actual kernel address: |
| 25 | WdkTypes::PVOID KernelAddress = NULL; |
| 26 | BOOL Status = Stuff::KbGetKernelProcAddress(WideName.c_str(), &KernelAddress); |
| 27 | return Status ? reinterpret_cast<PVOID>(KernelAddress) : NULL; |
| 28 | } |
| 29 | |
| 30 | class FileReader { |
| 31 | private: |
no test coverage detected