MCPcopy Create free account
hub / github.com/TwoSevenOneT/WSASS / GetPPLProtectionLevel

Method GetPPLProtectionLevel

PPLHelp.cpp:3–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "PPLHelp.h"
2
3DWORD PPLProcessCreator::GetPPLProtectionLevel(DWORD processId)
4{
5 DWORD protectionLevel = 0;
6 HANDLE hProcess = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, processId);
7
8 if (hProcess)
9 {
10 PROCESS_PROTECTION_LEVEL_INFORMATION protectionInfo;
11 DWORD returnLength = 0;
12
13 if (GetProcessInformation(hProcess, ProcessProtectionLevelInfo,
14 &protectionInfo, sizeof(protectionInfo)))
15 {
16 protectionLevel = protectionInfo.ProtectionLevel;
17 }
18
19 CloseHandle(hProcess);
20 }
21
22 return protectionLevel;
23}
24std::wstring PPLProcessCreator::GetPPLProtectionLevelName(DWORD protectionLevel)
25{
26 switch (protectionLevel)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected