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.

94 lines
2.2 KiB

  1. //+------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996 - 1999
  5. //
  6. // File: cstore.hxx
  7. //
  8. //-------------------------------------------------------------------------
  9. #include <nt.h>
  10. #include <ntrtl.h>
  11. #include <nturtl.h>
  12. #include <windows.h>
  13. #include <ole2.h>
  14. #include <stdio.h>
  15. #include <malloc.h>
  16. #include <rpc.h>
  17. #include <userenv.h>
  18. #include <sddl.h>
  19. //
  20. // Active Ds includes
  21. //
  22. #include <ntdsapi.h>
  23. #include "activeds.h"
  24. #include "adsi.h"
  25. #include "netevent.h"
  26. #define EXIT_ON_NOMEM(p) \
  27. if (!(p)) { \
  28. hr = E_OUT_OF_MEMORY; \
  29. goto Error_Cleanup; \
  30. }
  31. #define ERROR_ON_FAILURE(hr) \
  32. if (FAILED(hr)) { \
  33. goto Error_Cleanup; \
  34. }
  35. #define RETURN_ON_FAILURE(hr) \
  36. if (FAILED(hr)) { \
  37. return hr; \
  38. }
  39. #define GENERIC_READ_MAPPING DS_GENERIC_READ
  40. #define GENERIC_EXECUTE_MAPPING DS_GENERIC_EXECUTE
  41. #define GENERIC_WRITE_MAPPING DS_GENERIC_WRITE
  42. #define GENERIC_ALL_MAPPING DS_GENERIC_ALL
  43. extern DWORD gDebugLog;
  44. extern DWORD gDebugOut;
  45. extern DWORD gDebugEventLog;
  46. extern DWORD gDebug;
  47. //
  48. // We define our own private debugging macro in order to avoid
  49. // adding complexity for the generic debugging macro -- an alternative
  50. // is to add a DM_CSTORE debug mask and alter the general _DebugMsg utility
  51. // to use it, but this will result in a general utility containing
  52. // references to a specific component.
  53. //
  54. #define CSDBGPrint(Args) { if (gDebug) _DebugMsg Args ; }
  55. // private header exported from adsldpc.dll
  56. HRESULT
  57. BuildADsPathFromParent(
  58. LPWSTR Parent,
  59. LPWSTR Name,
  60. LPWSTR *ppszADsPath
  61. );
  62. HRESULT
  63. BuildADsParentPath(
  64. LPWSTR szBuffer,
  65. LPWSTR *ppszParent,
  66. LPWSTR *ppszCommonName
  67. );
  68. HRESULT
  69. ADsEncodeBinaryData (
  70. PBYTE pbSrcData,
  71. DWORD dwSrcLen,
  72. LPWSTR * ppszDestData
  73. );
  74. /*
  75. HRESULT ParseLdapName(WCHAR *szName, DWORD *pServerNameLen, BOOL *pX500Name);
  76. */