Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

397 lines
6.6 KiB

  1. #include "dspch.h"
  2. #pragma hdrstop
  3. #define _USERENV_
  4. #include <userenv.h>
  5. #include <userenvp.h>
  6. static
  7. BOOL
  8. WINAPI
  9. AddItemW (
  10. LPCWSTR lpGroupName,
  11. BOOL bCommonGroup,
  12. LPCWSTR lpFileName,
  13. LPCWSTR lpCommandLine,
  14. LPCWSTR lpIconPath,
  15. int iIconIndex,
  16. LPCWSTR lpWorkingDirectory,
  17. WORD wHotKey,
  18. int iShowCmd
  19. )
  20. {
  21. return FALSE;
  22. }
  23. static
  24. BOOL
  25. WINAPI
  26. DeleteItemW(
  27. IN LPCWSTR lpGroupName,
  28. IN BOOL bCommonGroup,
  29. IN LPCWSTR lpFileName,
  30. IN BOOL bDeleteGroup)
  31. {
  32. return FALSE;
  33. }
  34. static
  35. BOOL
  36. WINAPI
  37. CreateEnvironmentBlock(
  38. OUT LPVOID *lpEnvironment,
  39. IN HANDLE hToken,
  40. IN BOOL bInherit)
  41. {
  42. return FALSE;
  43. }
  44. static
  45. USERENVAPI
  46. BOOL
  47. WINAPI
  48. CreateGroupW(
  49. IN LPCWSTR lpGroupName,
  50. IN BOOL bCommonGroup)
  51. {
  52. return FALSE;
  53. }
  54. static
  55. USERENVAPI
  56. BOOL
  57. WINAPI
  58. CreateGroupExA(LPCSTR lpGroupName, BOOL bCommonGroup,
  59. LPCSTR lpResourceModuleName, UINT uResourceID)
  60. {
  61. return FALSE;
  62. }
  63. static
  64. USERENVAPI
  65. BOOL
  66. WINAPI
  67. CreateGroupExW(LPCWSTR lpGroupName, BOOL bCommonGroup,
  68. LPCWSTR lpResourceModuleName, UINT uResourceID)
  69. {
  70. return FALSE;
  71. }
  72. static
  73. USERENVAPI
  74. BOOL
  75. WINAPI
  76. CreateLinkFileW(
  77. IN INT csidl,
  78. IN LPCWSTR lpSubDirectory,
  79. IN LPCWSTR lpFileName,
  80. IN LPCWSTR lpCommandLine,
  81. IN LPCWSTR lpIconPath,
  82. IN INT iIconIndex,
  83. IN LPCWSTR lpWorkingDirectory,
  84. IN WORD wHotKey,
  85. IN INT iShowCmd,
  86. IN LPCWSTR lpDescription)
  87. {
  88. return FALSE;
  89. }
  90. static
  91. USERENVAPI
  92. BOOL
  93. WINAPI
  94. CreateLinkFileEx(INT csidl, LPCTSTR lpSubDirectory,
  95. LPCTSTR lpFileName, LPCTSTR lpCommandLine,
  96. LPCTSTR lpIconPath, int iIconIndex,
  97. LPCTSTR lpWorkingDirectory, WORD wHotKey,
  98. int iShowCmd, LPCTSTR lpDescription,
  99. LPCWSTR lpResourceModuleName, UINT uResourceID)
  100. {
  101. return FALSE;
  102. }
  103. static
  104. USERENVAPI
  105. BOOL
  106. WINAPI
  107. DeleteGroupW(
  108. IN LPCWSTR lpGroupName,
  109. IN BOOL bCommonGroup)
  110. {
  111. return FALSE;
  112. }
  113. static
  114. BOOL
  115. WINAPI
  116. ExpandEnvironmentStringsForUserA(
  117. IN HANDLE hToken,
  118. IN LPCSTR lpSrc,
  119. OUT LPSTR lpDest,
  120. IN DWORD dwSize)
  121. {
  122. return FALSE;
  123. }
  124. static
  125. BOOL
  126. WINAPI
  127. ExpandEnvironmentStringsForUserW(
  128. IN HANDLE hToken,
  129. IN LPCWSTR lpSrc,
  130. OUT LPWSTR lpDest,
  131. IN DWORD dwSize)
  132. {
  133. return FALSE;
  134. }
  135. static
  136. BOOL
  137. WINAPI
  138. GetDefaultUserProfileDirectoryW(
  139. IN LPWSTR lpProfileDir,
  140. IN OUT LPDWORD lpcchSize)
  141. {
  142. return FALSE;
  143. }
  144. static
  145. BOOL
  146. WINAPI
  147. GetProfileType(
  148. OUT DWORD *dwFlags)
  149. {
  150. return FALSE;
  151. }
  152. static
  153. USERENVAPI
  154. BOOL
  155. WINAPI
  156. InitializeProfiles(
  157. IN BOOL bGuiModeSetup)
  158. {
  159. return FALSE;
  160. }
  161. static
  162. USERENVAPI
  163. BOOL
  164. WINAPI
  165. GetUserProfileDirectoryW(
  166. IN HANDLE hToken,
  167. OUT LPWSTR lpProfileDir,
  168. IN OUT LPDWORD lpcchSize)
  169. {
  170. return FALSE;
  171. }
  172. static
  173. USERENVAPI
  174. BOOL
  175. WINAPI
  176. GetAllUsersProfileDirectoryW(
  177. OUT LPWSTR lpProfileDir,
  178. IN OUT LPDWORD lpcchSize)
  179. {
  180. return FALSE;
  181. }
  182. static
  183. USERENVAPI
  184. BOOL
  185. WINAPI
  186. GetProfilesDirectoryW(
  187. OUT LPWSTR lpProfilesDir,
  188. IN OUT LPDWORD lpcchSize)
  189. {
  190. return FALSE;
  191. }
  192. static
  193. USERENVAPI
  194. BOOL
  195. WINAPI
  196. DestroyEnvironmentBlock(
  197. IN LPVOID lpEnvironment)
  198. {
  199. return FALSE;
  200. }
  201. static
  202. USERENVAPI
  203. BOOL
  204. WINAPI
  205. LoadUserProfileW
  206. (HANDLE hToken,
  207. LPPROFILEINFOW lpProfileInfoW)
  208. {
  209. return FALSE;
  210. }
  211. static
  212. USERENVAPI
  213. BOOL
  214. WINAPI
  215. UnloadUserProfile
  216. (HANDLE hToken,
  217. HANDLE hProfile)
  218. {
  219. return FALSE;
  220. }
  221. static
  222. BOOL
  223. WINAPI
  224. RegisterGPNotification(
  225. IN HANDLE hEvent,
  226. IN BOOL bMachine )
  227. {
  228. return FALSE;
  229. }
  230. static
  231. BOOL
  232. WINAPI
  233. UnregisterGPNotification(
  234. IN HANDLE hEvent)
  235. {
  236. return FALSE;
  237. }
  238. static
  239. USERENVAPI
  240. BOOL
  241. WINAPI
  242. DeleteLinkFile(INT csidl, LPCTSTR lpSubDirectory,
  243. LPCTSTR lpFileName, BOOL bDeleteSubDirectory)
  244. {
  245. return FALSE;
  246. }
  247. static
  248. USERENVAPI
  249. BOOL
  250. WINAPI
  251. DeleteProfileW (
  252. IN LPCWSTR lpSidString,
  253. IN LPCWSTR lpProfilePath,
  254. IN LPCWSTR lpComputerName)
  255. {
  256. return FALSE;
  257. }
  258. static
  259. USERENVAPI
  260. DWORD
  261. WINAPI
  262. GetGroupPolicyNetworkName(
  263. LPWSTR szNetworkName,
  264. LPDWORD pdwByteCount
  265. )
  266. {
  267. return 0;
  268. }
  269. static
  270. DWORD
  271. WINAPI
  272. GetUserAppDataPathW(
  273. HANDLE hToken,
  274. BOOL fLocalAppData,
  275. LPWSTR lpFolderPath
  276. )
  277. {
  278. return ERROR_PROC_NOT_FOUND;
  279. }
  280. static
  281. USERENVAPI
  282. BOOL
  283. WINAPI
  284. CopySystemProfile(
  285. IN BOOL bCleanInstall
  286. )
  287. {
  288. SetLastError(ERROR_PROC_NOT_FOUND);
  289. return FALSE;
  290. }
  291. static
  292. USERENVAPI
  293. BOOL
  294. WINAPI
  295. GetUserProfileDirFromSidW(
  296. IN PSID pSid,
  297. OUT LPWSTR lpProfileDirW,
  298. IN OUT LPDWORD lpcchSize
  299. )
  300. {
  301. SetLastError(ERROR_PROC_NOT_FOUND);
  302. return FALSE;
  303. }
  304. static
  305. USERENVAPI
  306. BOOL
  307. WINAPI
  308. CopyProfileDirectoryW(
  309. IN LPCWSTR lpSourceDir,
  310. IN LPCWSTR lpDestinationDir,
  311. IN DWORD dwFlags
  312. )
  313. {
  314. SetLastError(ERROR_PROC_NOT_FOUND);
  315. return FALSE;
  316. }
  317. //
  318. // !! WARNING !! The entries below must be in order by ORDINAL
  319. //
  320. DEFINE_ORDINAL_ENTRIES(userenv)
  321. {
  322. DLOENTRY(100, InitializeProfiles)
  323. DLOENTRY(102, CreateGroupW)
  324. DLOENTRY(104, DeleteGroupW)
  325. DLOENTRY(106, AddItemW)
  326. DLOENTRY(108, DeleteItemW)
  327. DLOENTRY(112, CopyProfileDirectoryW)
  328. DLOENTRY(120, CreateLinkFileW)
  329. DLOENTRY(122, DeleteLinkFileW)
  330. DLOENTRY(132, CreateEnvironmentBlock)
  331. DLOENTRY(136, CreateGroupExA)
  332. DLOENTRY(137, CreateGroupExW)
  333. DLOENTRY(139, CreateLinkFileExW)
  334. DLOENTRY(147, GetGroupPolicyNetworkName)
  335. DLOENTRY(149, GetUserAppDataPathW)
  336. DLOENTRY(155, CopySystemProfile)
  337. DLOENTRY(157, GetUserProfileDirFromSidW)
  338. };
  339. DEFINE_ORDINAL_MAP(userenv)
  340. //
  341. // !! WARNING !! The entries below must be in alphabetical order, and are CASE SENSITIVE (eg lower case comes last!)
  342. //
  343. DEFINE_PROCNAME_ENTRIES(userenv)
  344. {
  345. DLPENTRY(CreateEnvironmentBlock)
  346. DLPENTRY(DeleteProfileW)
  347. DLPENTRY(DestroyEnvironmentBlock)
  348. DLPENTRY(ExpandEnvironmentStringsForUserA)
  349. DLPENTRY(ExpandEnvironmentStringsForUserW)
  350. DLPENTRY(GetAllUsersProfileDirectoryW)
  351. DLPENTRY(GetDefaultUserProfileDirectoryW)
  352. DLPENTRY(GetProfileType)
  353. DLPENTRY(GetProfilesDirectoryW)
  354. DLPENTRY(GetUserProfileDirectoryW)
  355. DLPENTRY(LoadUserProfileW)
  356. DLPENTRY(RegisterGPNotification)
  357. DLPENTRY(UnloadUserProfile)
  358. DLPENTRY(UnregisterGPNotification)
  359. };
  360. DEFINE_PROCNAME_MAP(userenv)