winapi_ui_automation/um/
userenv.rs1use shared::minwindef::{BOOL, DWORD, LPDWORD, LPVOID, PHKEY};
8use um::winnt::{
9 HANDLE, HRESULT, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PCWSTR, PSID, PSID_AND_ATTRIBUTES, PWSTR
10};
11use um::winreg::REGSAM;
12extern "system" {
13 pub fn UnloadUserProfile(
22 hToken: HANDLE,
23 hProfile: HANDLE,
24 ) -> BOOL;
25 pub fn GetProfilesDirectoryA(
26 lpProfileDir: LPSTR,
27 lpcchSize: LPDWORD,
28 ) -> BOOL;
29 pub fn GetProfilesDirectoryW(
30 lpProfileDir: LPWSTR,
31 lpcchSize: LPDWORD,
32 ) -> BOOL;
33 pub fn GetProfileType(
34 dwFlags: *mut DWORD,
35 ) -> BOOL;
36 pub fn DeleteProfileA(
37 lpSidString: LPCSTR,
38 lpProfilePath: LPCSTR,
39 lpComputerName: LPCSTR,
40 ) -> BOOL;
41 pub fn DeleteProfileW(
42 lpSidString: LPCWSTR,
43 lpProfilePath: LPCWSTR,
44 lpComputerName: LPCWSTR,
45 ) -> BOOL;
46 pub fn CreateProfile(
47 pszUserSid: LPCWSTR,
48 pszUserName: LPCWSTR,
49 pszProfilePath: LPWSTR,
50 cchProfilePath: DWORD,
51 ) -> HRESULT;
52 pub fn GetDefaultUserProfileDirectoryA(
53 lpProfileDir: LPSTR,
54 lpcchSize: LPDWORD,
55 ) -> BOOL;
56 pub fn GetDefaultUserProfileDirectoryW(
57 lpProfileDir: LPWSTR,
58 lpcchSize: LPDWORD,
59 ) -> BOOL;
60 pub fn GetAllUsersProfileDirectoryA(
61 lpProfileDir: LPSTR,
62 lpcchSize: LPDWORD,
63 ) -> BOOL;
64 pub fn GetAllUsersProfileDirectoryW(
65 lpProfileDir: LPWSTR,
66 lpcchSize: LPDWORD,
67 ) -> BOOL;
68 pub fn GetUserProfileDirectoryA(
69 hToken: HANDLE,
70 lpProfileDir: LPSTR,
71 lpcchSize: LPDWORD,
72 ) -> BOOL;
73 pub fn GetUserProfileDirectoryW(
74 hToken: HANDLE,
75 lpProfileDir: LPWSTR,
76 lpcchSize: LPDWORD,
77 ) -> BOOL;
78 pub fn CreateEnvironmentBlock(
79 lpEnvironment: *mut LPVOID,
80 hToken: HANDLE,
81 bInherit: BOOL,
82 ) -> BOOL;
83 pub fn DestroyEnvironmentBlock(
84 lpEnvironment: LPVOID,
85 ) -> BOOL;
86 pub fn ExpandEnvironmentStringsForUserA(
87 hToken: HANDLE,
88 lpSrc: LPCSTR,
89 lpDest: LPSTR,
90 dwSize: DWORD,
91 ) -> BOOL;
92 pub fn ExpandEnvironmentStringsForUserW(
93 hToken: HANDLE,
94 lpSrc: LPCWSTR,
95 lpDest: LPWSTR,
96 dwSize: DWORD,
97 ) -> BOOL;
98 pub fn RefreshPolicy(
99 bMachine: BOOL,
100 ) -> BOOL;
101 pub fn RefreshPolicyEx(
102 bMachine: BOOL,
103 dwOptions: DWORD,
104 ) -> BOOL;
105 pub fn EnterCriticalPolicySection(
106 bMachine: BOOL,
107 ) -> HANDLE;
108 pub fn LeaveCriticalPolicySection(
109 hSection: HANDLE,
110 ) -> BOOL;
111 pub fn RegisterGPNotification(
112 hEvent: HANDLE,
113 bMachine: BOOL,
114 ) -> BOOL;
115 pub fn UnregisterGPNotification(
116 hEvent: HANDLE,
117 ) -> BOOL;
118 pub fn CreateAppContainerProfile(
132 pszAppContainerName: PCWSTR,
133 pszDisplayName: PCWSTR,
134 pszDescription: PCWSTR,
135 pCapabilities: PSID_AND_ATTRIBUTES,
136 dwCapabilityCount: DWORD,
137 ppSidAppContainerSid: *mut PSID,
138 ) -> HRESULT;
139 pub fn DeleteAppContainerProfile(
140 pszAppContainerName: PCWSTR,
141 ) -> HRESULT;
142 pub fn GetAppContainerRegistryLocation(
143 desiredAccess: REGSAM,
144 phAppContainerKey: PHKEY,
145 ) -> HRESULT;
146 pub fn GetAppContainerFolderPath(
147 pszAppContainerSid: PCWSTR,
148 ppszPath: *mut PWSTR,
149 ) -> HRESULT;
150 pub fn DeriveAppContainerSidFromAppContainerName(
151 pszAppContainerName: PCWSTR,
152 ppsidAppContainerSid: *mut PSID,
153 ) -> HRESULT;
154 pub fn DeriveRestrictedAppContainerSidFromAppContainerSidAndRestrictedName(
155 psidAppContainerSid: PSID,
156 pszRestrictedAppContainerName: PCWSTR,
157 ppsidRestrictedAppContainerSid: *mut PSID,
158 ) -> HRESULT;
159}