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.

144 lines
4.8 KiB

  1. //
  2. // SvrApi.h
  3. //
  4. #pragma once
  5. // svrapi.h and lmshare.h have some of the same defines,
  6. // so turn off the compile warning for them...
  7. #pragma warning(disable:4005)
  8. EXTERN_C BOOL AllocateAndInitializeSid_NT(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, BYTE nSubAuthorityCount, DWORD dwSubAuthority0, DWORD dwSubAuthority1, DWORD dwSubAuthority2, DWORD dwSubAuthority3, DWORD dwSubAuthority4, DWORD dwSubAuthority5, DWORD dwSubAuthority6, DWORD dwSubAuthority7, PSID *pSid);
  9. EXTERN_C BOOL CheckTokenMembership_NT(HANDLE TokenHandle, PSID SidToCheck, PBOOL IsMember);
  10. EXTERN_C PVOID FreeSid_NT(PSID SidToFree);
  11. //
  12. // Get the Win9X versions of these apis
  13. //
  14. #define NetAccessAdd NetAccessAdd_W95
  15. #define NetAccessCheck NetAccessCheck_W95
  16. #define NetAccessDel NetAccessDel_W95
  17. #define NetAccessEnum NetAccessEnum_W95
  18. #define NetAccessGetInfo NetAccessGetInfo_W95
  19. #define NetAccessSetInfo NetAccessSetInfo_W95
  20. #define NetAccessGetUserPerms NetAccessGetUserPerms_W95
  21. #define NetShareAdd NetShareAdd_W95
  22. #define NetShareDel NetShareDel_W95
  23. #define NetShareEnum NetShareEnum_W95
  24. #define NetShareGetInfo NetShareGetInfo_W95
  25. #define NetShareSetInfo NetShareSetInfo_W95
  26. #define NetSessionDel NetSessionDel_W95
  27. #define NetSessionEnum NetSessionEnum_W95
  28. #define NetSessionGetInfo NetSessionGetInfo_W95
  29. #define NetConnectionEnum NetConnectionEnum_W95
  30. #define NetFileClose2 NetFileClose2_W95
  31. #define NetFileEnum NetFileEnum_W95
  32. #define NetServerGetInfo NetServerGetInfo_W95
  33. #define NetServerSetInfo NetServerSetInfo_W95
  34. #define NetSecurityGetInfo NetSecurityGetInfo_W95
  35. #define _SVRAPI_ // turn off dllimport define
  36. #include <svrapi.h>
  37. #undef NetAccessAdd
  38. #undef NetAccessCheck
  39. #undef NetAccessDel
  40. #undef NetAccessEnum
  41. #undef NetAccessGetInfo
  42. #undef NetAccessSetInfo
  43. #undef NetAccessGetUserPerms
  44. #undef NetShareAdd
  45. #undef NetShareDel
  46. #undef NetShareEnum
  47. #undef NetShareGetInfo
  48. #undef NetShareSetInfo
  49. #undef NetSessionDel
  50. #undef NetSessionEnum
  51. #undef NetSessionGetInfo
  52. #undef NetConnectionEnum
  53. #undef NetFileClose2
  54. #undef NetFileEnum
  55. #undef NetServerGetInfo
  56. #undef NetServerSetInfo
  57. #undef NetSecurityGetInfo
  58. //
  59. // get the NT versions of these apis
  60. //
  61. #define NetShareAdd NetShareAdd_NT
  62. #define NetShareEnum NetShareEnum_NT
  63. #define NetShareEnumSticky NetShareEnumSticky_NT
  64. #define NetShareGetInfo NetShareGetInfo_NT
  65. #define NetShareSetInfo NetShareSetInfo_NT
  66. #define NetShareDel NetShareDel_NT
  67. #define NetShareDelSticky NetShareDelSticky_NT
  68. #define NetShareCheck NetShareCheck_NT
  69. #define NetSessionEnum NetSessionEnum_NT
  70. #define NetSessionDel NetSessionDel_NT
  71. #define NetSessionGetInfo NetSessionGetInfo_NT
  72. #define NetConnectionEnum NetConnectionEnum_NT
  73. #define NetFileClose NetFileClose_NT
  74. #define NetFileEnum NetFileEnum_NT
  75. #define NetFileGetInfo NetFileGetInfo_NT
  76. #include <lmshare.h>
  77. #undef NetShareAdd
  78. #undef NetShareEnum
  79. #undef NetShareEnumSticky
  80. #undef NetShareGetInfo
  81. #undef NetShareSetInfo
  82. #undef NetShareDel
  83. #undef NetShareDelSticky
  84. #undef NetShareCheck
  85. #undef NetSessionEnum
  86. #undef NetSessionDel
  87. #undef NetSessionGetInfo
  88. #undef NetConnectionEnum
  89. #undef NetFileClose
  90. #undef NetFileEnum
  91. #undef NetFileGetInfo
  92. #pragma warning(default:4005)
  93. #define NetApiBufferAllocate NetApiBufferAllocate_NT
  94. #define NetApiBufferFree NetApiBufferFree_NT
  95. #define NetApiBufferReallocate NetApiBufferReallocate_NT
  96. #define NetApiBufferSize NetApiBufferSize_NT
  97. #include <lmapibuf.h>
  98. #undef NetApiBufferAllocate
  99. #undef NetApiBufferFree
  100. #undef NetApiBufferReallocate
  101. #undef NetApiBufferSize
  102. //
  103. // Now define our wrapper versions of these functions
  104. //
  105. #ifndef _NO_NETSHARE_WRAPPERS_
  106. NET_API_STATUS NetShareEnumWrap(LPCTSTR pszServer, DWORD level, LPBYTE * ppbuffer, DWORD PrefMaxLen, LPDWORD pcEntriesRead, LPDWORD pcTotalEntries, LPDWORD phResumeHandle);
  107. NET_API_STATUS NetShareAddWrap(LPCTSTR pszServer, DWORD level, LPBYTE buffer);
  108. NET_API_STATUS NetShareDelWrap(LPCTSTR pszServer, LPCTSTR pszNetName, DWORD reserved);
  109. NET_API_STATUS NetShareGetInfoWrap(LPCTSTR pszServer, LPCTSTR pszNetName, DWORD level, LPBYTE * ppbuffer);
  110. NET_API_STATUS NetShareSetInfoWrap(LPCTSTR pszServer, LPCTSTR pszNetName, DWORD level, LPBYTE buffer);
  111. NET_API_STATUS NetApiBufferFreeWrap(LPVOID p);
  112. #define NetShareEnum NetShareEnumWrap
  113. #define NetShareAdd NetShareAddWrap
  114. #define NetShareDel NetShareDelWrap
  115. #define NetShareGetInfo NetShareGetInfoWrap
  116. #define NetShareSetInfo NetShareSetInfoWrap
  117. #define NetApiBufferFree NetApiBufferFreeWrap
  118. #endif // _NO_NETSHARE_WRAPPERS_