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.

70 lines
2.1 KiB

  1. //
  2. // Debug message types
  3. //
  4. #define DM_WARNING 0
  5. #define DM_ASSERT 1
  6. #define DM_VERBOSE 2
  7. //
  8. // Debug macros
  9. //
  10. #ifdef DBG
  11. #define DEBUGMSG(x) _DebugMsg x
  12. VOID _DebugMsg(UINT mask, PCSTR pszMsg, ...);
  13. #define DMASSERT(x) if (!(x)) \
  14. _DebugMsg(DM_ASSERT,"profmap.dll assertion " #x " failed\n, line %u of %s", __LINE__, TEXT(__FILE__));
  15. #else
  16. #define DEBUGMSG(x)
  17. #define DMASSERT(x)
  18. #endif
  19. //
  20. // userenv.c
  21. //
  22. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  23. #define ByteCountW(x) (lstrlenW(x) * sizeof(WCHAR))
  24. #define SizeOfStringW(x) ((lstrlenW(x) + 1) * sizeof(WCHAR))
  25. #define PROFILE_LIST_PATH TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList")
  26. #define PROFILE_IMAGE_VALUE_NAME TEXT("ProfileImagePath")
  27. #define PROFILE_GUID TEXT("Guid")
  28. #define PROFILE_GUID_PATH TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\ProfileGuid")
  29. #define WINDOWS_POLICIES_KEY TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Policies")
  30. #define ROOT_POLICIES_KEY TEXT("Software\\Policies")
  31. BOOL OurConvertSidToStringSid (PSID Sid, PWSTR *SidString);
  32. VOID DeleteSidString (PWSTR SidString);
  33. PACL CreateDefaultAcl (PSID pSid);
  34. VOID FreeDefaultAcl (PACL Acl OPTIONAL);
  35. BOOL GetProfileRoot (PSID Sid, PWSTR ProfileDir, UINT cchBuffer);
  36. BOOL UpdateProfileSecurity (PSID Sid);
  37. BOOL DeleteProfileGuidSettings (HKEY hProfile);
  38. PSID GetUserSid (HANDLE UserToken);
  39. VOID DeleteUserSid(PSID Sid);
  40. LONG MyRegLoadKey(HKEY hKey, LPTSTR lpSubKey, LPTSTR lpFile);
  41. BOOL MyRegUnLoadKey(HKEY hKey, LPTSTR lpSubKey);
  42. BOOL SetupNewHive(LPTSTR lpSidString, PSID pSid);
  43. DWORD ApplySecurityToRegistryTree(HKEY RootKey, PSECURITY_DESCRIPTOR pSD);
  44. BOOL SecureUserKey(LPTSTR lpKey, PSID pSid);
  45. LPWSTR ProduceWFromA(LPCSTR pszA);
  46. BOOL IsUserAnAdminMember(HANDLE hToken);
  47. VOID RegistrySearchAndReplaceW (HKEY hRoot, PCWSTR szKey, PCWSTR Search, PCWSTR Replace);
  48. PWSTR StringSearchAndReplaceW (PCWSTR SourceString, PCWSTR SearchString, PCWSTR ReplaceString, DWORD* pcbNewString);