-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwinapi.hpp
More file actions
33 lines (22 loc) · 1.26 KB
/
Copy pathwinapi.hpp
File metadata and controls
33 lines (22 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef WINAPI_H
#define WINAPI_H
#include <Windows.h>
/* DEBUG - Converts SID to STRING, can print results */
BOOL GetAccountFromSID(PSID pSid, LPVOID *lpName, LPVOID *lpDomain);
/* Fills pTokenOwner with TokenHandle Owner; Must free when finished */
BOOL GetTokenOwner(HANDLE TokenHandle, PTOKEN_OWNER *pTokenOwner);
/* Enable Privilege on current process */
BOOL SetPrivilege(LPCWSTR lpSE_PRIVILEGE);
/* Check if privilege is enabled in hToken, current process if NULL */
BOOL IsPrivilegeEnabled(HANDLE hToken, LPCWSTR lpSE_PRIVILEGE);
/* Sets the Owner of the hKey with the TOKEN_OWNER provided; hKey needs to be open with WRITE_OWNER */
BOOL RegSetKeyOwner(HKEY hKey, PTOKEN_OWNER pTokenOwner);
/* Gets the Owner of the hKey and compare it with the provided TOKEN_OWNER */
BOOL RegGetKeyOwner(HKEY hKey, PTOKEN_OWNER pTokenOwner);
/* Fills pSD with Owner,Group,DACL,SACL of the provided registry key; Must free when finished */
BOOL GetKeySecurityDescriptor(HKEY hKey, LPCWSTR lpSubkey, PSECURITY_DESCRIPTOR *pSD);
/* Sets SET_VALUE permission for pRequiredSID for registry hKey */
BOOL RegSetKeyACE(HKEY hKey, PSID pRequiredSID);
/* Sets the Owner of the hKey back to TRUSTEDINSTALLER */
BOOL RegSetKeyDefaults(HKEY hKey);
#endif /* WINAPI_H */