This repository was archived by the owner on Feb 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwinapiutils.h
More file actions
59 lines (45 loc) · 1.28 KB
/
Copy pathwinapiutils.h
File metadata and controls
59 lines (45 loc) · 1.28 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef WINAPIUTILS_H
#define WINAPIUTILS_H
// State target OS as Windows 7.
// https://msdn.microsoft.com/en-us/library/aa383745.aspx
#define _WIN32_WINNT 0x0601
#include <stdio.h>
#include <stdlib.h>
#include <wchar.h>
#include <locale.h>
#include <windows.h>
#include <winternl.h>
#include <tlhelp32.h>
#include <psapi.h>
#include <mq.h>
#define MAX_NAME_PATH 256
typedef NTSTATUS (NTAPI *_NtQueryInformationProcess)(HANDLE pHandle, DWORD pInformationClass, PVOID pInformation, DWORD pInformationLength, PDWORD ReturnLength);
typedef struct UserProfile {
WCHAR *Name;
WCHAR *Domain;
WCHAR *SID;
BOOL Elevated;
} UserProfile;
typedef struct OSProcess {
DWORD PID;
DWORD PPID;
BOOL IsRemote;
WCHAR *ExecName;
WCHAR *CommandLine;
UserProfile *UProfile;
} OSProcess;
UserProfile *
GetCurrentProcessUserProfile(DWORD *exitTag);
UserProfile *
GetProcessUserProfile(HANDLE hProcess, DWORD *exitTag);
VOID
FreeUserProfile(UserProfile *wup);
WCHAR *
GetCurrentExecutableFullName(DWORD *exitTag, DWORD *lastErrorCode);
WCHAR *
GetProcessNameInDeviceForm(HANDLE hProcess, DWORD *exitTag, DWORD *lastErrorCode);
OSProcess *
GetOSProcesses(DWORD *n, DWORD *exitTag, DWORD *lastErrorCode);
VOID
FreeOSProcesses(OSProcess *osprocs, DWORD n);
#endif /* WINAPIUTILS_H */