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.

204 lines
4.6 KiB

  1. //=================================================================
  2. //
  3. // MprApi.h
  4. //
  5. // Copyright (c) 1999-2001 Microsoft Corporation, All Rights Reserved
  6. //
  7. //=================================================================
  8. #ifndef _MprApi_H_
  9. #define _MprApi_H_
  10. /******************************************************************************
  11. * #includes to Register this class with the CResourceManager.
  12. *****************************************************************************/
  13. extern const GUID g_guidMprApi;
  14. extern const TCHAR g_tstrMpr[];
  15. /******************************************************************************
  16. * Function pointer typedefs. Add new functions here as required.
  17. *****************************************************************************/
  18. #ifdef UNICODE
  19. typedef DWORD (APIENTRY *PFN_Mpr_WNetEnumResource )
  20. (
  21. IN HANDLE hEnum,
  22. IN OUT LPDWORD lpcCount,
  23. OUT LPVOID lpBuffer,
  24. IN OUT LPDWORD lpBufferSize
  25. );
  26. #else
  27. typedef DWORD (APIENTRY *PFN_Mpr_WNetEnumResource )
  28. (
  29. IN HANDLE hEnum,
  30. IN OUT LPDWORD lpcCount,
  31. OUT LPVOID lpBuffer,
  32. IN OUT LPDWORD lpBufferSize
  33. );
  34. #endif
  35. #ifdef UNICODE
  36. typedef DWORD (APIENTRY *PFN_Mpr_WNetOpenEnum )
  37. (
  38. IN DWORD dwScope,
  39. IN DWORD dwType,
  40. IN DWORD dwUsage,
  41. IN LPNETRESOURCEW lpNetResource,
  42. OUT LPHANDLE lphEnum
  43. );
  44. #else
  45. typedef DWORD (APIENTRY *PFN_Mpr_WNetOpenEnum )
  46. (
  47. IN DWORD dwScope,
  48. IN DWORD dwType,
  49. IN DWORD dwUsage,
  50. IN LPNETRESOURCEA lpNetResource,
  51. OUT LPHANDLE lphEnum
  52. );
  53. #endif
  54. typedef DWORD (APIENTRY *PFN_Mpr_WNetCloseEnum )
  55. (
  56. IN HANDLE hEnum
  57. );
  58. #ifdef UNICODE
  59. typedef DWORD (APIENTRY *PFN_Mpr_WNetGetUser )
  60. (
  61. IN LPCWSTR lpName,
  62. OUT LPWSTR lpUserName,
  63. IN OUT LPDWORD lpnLength
  64. );
  65. #else
  66. typedef DWORD (APIENTRY *PFN_Mpr_WNetGetUser )
  67. (
  68. IN LPCSTR lpName,
  69. OUT LPSTR lpUserName,
  70. IN OUT LPDWORD lpnLength
  71. );
  72. #endif
  73. #ifdef UNICODE
  74. typedef DWORD (APIENTRY *PFN_Mpr_WNetGetConnection )
  75. (
  76. IN LPCWSTR lpLocalName,
  77. OUT LPWSTR lpRemoteName,
  78. IN OUT LPDWORD lpnLength
  79. );
  80. #else
  81. typedef DWORD (APIENTRY *PFN_Mpr_WNetGetConnection )
  82. (
  83. IN LPCSTR lpLocalName,
  84. OUT LPSTR lpRemoteName,
  85. IN OUT LPDWORD lpnLength
  86. );
  87. #endif
  88. /******************************************************************************
  89. * Wrapper class for Tapi load/unload, for registration with CResourceManager.
  90. *****************************************************************************/
  91. class CMprApi : public CDllWrapperBase
  92. {
  93. private:
  94. // Member variables (function pointers) pointing to Tapi functions.
  95. // Add new functions here as required.
  96. PFN_Mpr_WNetEnumResource m_pfnWNetEnumResource ;
  97. PFN_Mpr_WNetOpenEnum m_pfnWNetOpenEnum ;
  98. PFN_Mpr_WNetCloseEnum m_pfnWNetCloseEnum ;
  99. PFN_Mpr_WNetGetUser m_pfnWNetGetUser ;
  100. PFN_Mpr_WNetGetConnection m_pfnWNetGetConnection ;
  101. public:
  102. // Constructor and destructor:
  103. CMprApi(LPCTSTR a_tstrWrappedDllName);
  104. ~CMprApi();
  105. // Initialization function to check function pointers.
  106. virtual bool Init();
  107. // Member functions wrapping Tapi functions.
  108. // Add new functions here as required:
  109. #ifdef UNICODE
  110. DWORD WNetEnumResource (
  111. IN HANDLE hEnum,
  112. IN OUT LPDWORD lpcCount,
  113. OUT LPVOID lpBuffer,
  114. IN OUT LPDWORD lpBufferSize
  115. ) ;
  116. #else
  117. DWORD WNetEnumResource (
  118. IN HANDLE hEnum,
  119. IN OUT LPDWORD lpcCount,
  120. OUT LPVOID lpBuffer,
  121. IN OUT LPDWORD lpBufferSize
  122. ) ;
  123. #endif
  124. #ifdef UNICODE
  125. DWORD WNetOpenEnum (
  126. IN DWORD dwScope,
  127. IN DWORD dwType,
  128. IN DWORD dwUsage,
  129. IN LPNETRESOURCEW lpNetResource,
  130. OUT LPHANDLE lphEnum
  131. ) ;
  132. #else
  133. DWORD WNetOpenEnum (
  134. IN DWORD dwScope,
  135. IN DWORD dwType,
  136. IN DWORD dwUsage,
  137. IN LPNETRESOURCEA lpNetResource,
  138. OUT LPHANDLE lphEnum
  139. ) ;
  140. #endif
  141. #ifdef UNICODE
  142. DWORD WNetGetUser (
  143. IN LPCWSTR lpName,
  144. OUT LPWSTR lpUserName,
  145. IN OUT LPDWORD lpnLength
  146. ) ;
  147. #else
  148. DWORD WNetGetUser (
  149. IN LPCSTR lpName,
  150. OUT LPSTR lpUserName,
  151. IN OUT LPDWORD lpnLength
  152. ) ;
  153. #endif
  154. #ifdef UNICODE
  155. DWORD WNetGetConnection (
  156. IN LPCWSTR lpLocalName,
  157. OUT LPWSTR lpRemoteName,
  158. IN OUT LPDWORD lpnLength
  159. ) ;
  160. #else
  161. DWORD WNetGetConnection (
  162. IN LPCSTR lpLocalName,
  163. OUT LPSTR lpRemoteName,
  164. IN OUT LPDWORD lpnLength
  165. ) ;
  166. #endif
  167. DWORD WNetCloseEnum (
  168. IN HANDLE hEnum
  169. ) ;
  170. };
  171. #endif