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.

219 lines
6.3 KiB

  1. #ifndef _OPENFILES_DEF_H
  2. #define _OPENFILES_DEF_H
  3. #include <windows.h>
  4. #include <winperf.h>
  5. #include <lmcons.h>
  6. #include <lmerr.h>
  7. #include <dbghelp.h>
  8. #include <psapi.h>
  9. #include <tchar.h>
  10. #include <Winbase.h>
  11. #include <lm.h>
  12. #include <Lmserver.h>
  13. #include <winerror.h>
  14. #include <time.h>
  15. #include <tchar.h>
  16. #include <stdio.h>
  17. #include <crtdbg.h>
  18. #include <atlbase.h>
  19. #define MAX_ACES 64
  20. #define ALLOWED_ACE 0
  21. #define DENIED_ACE 1
  22. #define ACCESS_READ_PERM 0x1200A9
  23. #define ACCESS_CHANGE_PERM 0x1301BF
  24. #define ACCESS_FULL_PERM 0x1F01FF
  25. #define ACCESS_UNKNOWN_PERM 0x0
  26. #define STR_READ _TEXT("R")
  27. #define STR_CHANGE _TEXT("C")
  28. #define STR_FULL _TEXT("F")
  29. // To handle all exceptions
  30. #define ONFAILTHROWERROR(hr) \
  31. { \
  32. if (FAILED(hr)) \
  33. throw _com_issue_error(hr); \
  34. }
  35. #define FPNWCLNTDLL _TEXT("FPNWCLNT.DLL")
  36. inline DWORD GetAccessMask(LPWSTR lpAccessStr)
  37. {
  38. if(!lstrcmpi(lpAccessStr, STR_READ))
  39. return ACCESS_READ_PERM;
  40. else if(!lstrcmpi(lpAccessStr, STR_CHANGE))
  41. return ACCESS_CHANGE_PERM;
  42. else if(!lstrcmpi(lpAccessStr, STR_FULL))
  43. return ACCESS_FULL_PERM;
  44. else
  45. return ACCESS_UNKNOWN_PERM;
  46. }
  47. /**************** structures and prototypes for nw shares ************/
  48. #define FPNWVOL_TYPE_DISKTREE 0
  49. #define NERR_Success 0
  50. #define FPNWFILE_PERM_READ 0x01
  51. #define FPNWFILE_PERM_WRITE 0x02
  52. #define FPNWFILE_PERM_CREATE 0x04
  53. #define FILE_INFO_3 0x03
  54. /*
  55. DWORD
  56. FpnwFileEnum(
  57. IN LPWSTR pServerName OPTIONAL,
  58. IN DWORD dwLevel,
  59. IN LPWSTR pPathName OPTIONAL,
  60. OUT LPBYTE *ppFileInfo,
  61. OUT PDWORD pEntriesRead,
  62. IN OUT PDWORD resumeHandle OPTIONAL
  63. );
  64. */
  65. /*
  66. DWORD
  67. FpnwVolumeEnum(
  68. IN LPWSTR pServerName OPTIONAL,
  69. IN DWORD dwLevel,
  70. OUT LPBYTE *ppVolumeInfo,
  71. OUT PDWORD pEntriesRead,
  72. IN OUT PDWORD resumeHandle OPTIONAL
  73. );
  74. */
  75. /*
  76. DWORD
  77. FpnwVolumeGetInfo(
  78. IN LPWSTR pServerName OPTIONAL,
  79. IN LPWSTR pVolumeName,
  80. IN DWORD dwLevel,
  81. OUT LPBYTE *ppVolumeInfo
  82. );*/
  83. /*
  84. DWORD
  85. FpnwVolumeSetInfo(
  86. IN LPWSTR pServerName OPTIONAL,
  87. IN LPWSTR pVolumeName,
  88. IN DWORD dwLevel,
  89. IN LPBYTE pVolumeInfo
  90. );
  91. */
  92. /*DWORD
  93. FpnwVolumeAdd(
  94. IN LPWSTR pServerName OPTIONAL,
  95. IN DWORD dwLevel,
  96. IN LPBYTE pVolumeInfo
  97. )*/
  98. /*
  99. DWORD
  100. FpnwVolumeDel(
  101. IN LPWSTR pServerName OPTIONAL,
  102. IN LPWSTR pVolumeName
  103. );
  104. */
  105. typedef DWORD (WINAPI *FILEENUMPROC) (LPWSTR,DWORD,LPWSTR,PBYTE*,PDWORD,PDWORD);
  106. typedef DWORD (WINAPI *VOLUMEENUMPROC) (LPWSTR,DWORD,LPBYTE*,PDWORD,PDWORD);
  107. typedef DWORD (WINAPI *VOLUMEGETINFOPROC) (LPWSTR,LPWSTR,DWORD,LPBYTE*);
  108. typedef DWORD (WINAPI *VOLUMESETINFOPROC) (LPWSTR,LPWSTR,DWORD,LPBYTE);
  109. typedef DWORD (WINAPI *VOLUMEADDPROC) (LPWSTR,DWORD,LPBYTE);
  110. typedef DWORD (WINAPI *VOLUMEDELPROC) (LPTSTR,LPTSTR);
  111. typedef enum _FPNW_API_INDEX
  112. {
  113. FPNW_VOLUME_ENUM = 0,
  114. FPNW_FILE_ENUM,
  115. FPNW_API_BUFFER_FREE,
  116. FPNW_VOLUME_DEL,
  117. FPNW_VOLUME_ADD,
  118. FPNW_FILE_CLOSE,
  119. FPNW_VOLUME_GET_INFO,
  120. FPNW_VOLUME_SET_INFO
  121. }FPNW_API_INDEX;
  122. //
  123. // This is the level 1 structure for FpnwVolumeAdd, FpnwVolumeDel, FpnwVolumeEnum,
  124. // FpnwVolumeGetInfo, & FpnwVolumeSetInfo.
  125. //
  126. typedef struct _FPNWVolumeInfo
  127. {
  128. LPWSTR lpVolumeName; // Name of the volume
  129. DWORD dwType; // Specifics of the volume. FPNWVOL_TYPE_???
  130. DWORD dwMaxUses; // Maximum number of connections that are
  131. // allowed to the volume
  132. DWORD dwCurrentUses; // Current number of connections to the volume
  133. LPWSTR lpPath; // Path of the volume
  134. } FPNWVOLUMEINFO, *PFPNWVOLUMEINFO;
  135. //
  136. // This is the level 2 structure for FpnwVolumeAdd, FpnwVolumeDel, FpnwVolumeEnum,
  137. // FpnwVolumeGetInfo, & FpnwVolumeSetInfo.
  138. // Note that this is not supported on the FPNW beta.
  139. //
  140. typedef struct _FPNWVolumeInfo_2
  141. {
  142. LPWSTR lpVolumeName; // Name of the volume
  143. DWORD dwType; // Specifics of the volume. FPNWVOL_TYPE_???
  144. DWORD dwMaxUses; // Maximum number of connections that are
  145. // allowed to the volume
  146. DWORD dwCurrentUses; // Current number of connections to the volume
  147. LPWSTR lpPath; // Path of the volume
  148. DWORD dwFileSecurityDescriptorLength; // reserved, this is calculated
  149. PSECURITY_DESCRIPTOR FileSecurityDescriptor;
  150. } FPNWVOLUMEINFO_2, *PFPNWVOLUMEINFO_2;
  151. // fpnwapi.h
  152. typedef struct _FPNWFileInfo
  153. {
  154. DWORD dwFileId; // File identification number
  155. LPWSTR lpPathName; // Full path name of this file
  156. LPWSTR lpVolumeName; // Volume name this file is on
  157. DWORD dwPermissions; // Permission mask: FPNWFILE_PERM_READ,
  158. // FPNWFILE_PERM_WRITE,
  159. // FPNWFILE_PERM_CREATE...
  160. DWORD dwLocks; // Number of locks on this file
  161. LPWSTR lpUserName; // The name of the user that established the
  162. // connection and opened the file
  163. BYTE WkstaAddress[12]; // The workstation address which opened the file
  164. DWORD dwAddressType; // Address type: IP, IPX
  165. } FPNWFILEINFO, *PFPNWFILEINFO;
  166. /****************** end structures and prototypes for nw shares ********************/
  167. /****************** structures and prototypes for apple talk ***********************/
  168. typedef DWORD (WINAPI *CONNECTPROC) (LPWSTR,DWORD*);
  169. typedef DWORD (WINAPI *FILEENUMPROCMAC) (DWORD,PBYTE*,DWORD,LPDWORD,LPDWORD,LPDWORD);
  170. typedef struct _AFP_FILE_INFO
  171. {
  172. DWORD afpfile_id; // Id of the open file fork
  173. DWORD afpfile_open_mode; // Mode in which file is opened
  174. DWORD afpfile_num_locks; // Number of locks on the file
  175. DWORD afpfile_fork_type; // Fork type
  176. LPWSTR afpfile_username; // File opened by this user. max UNLEN
  177. LPWSTR afpfile_path; // Absolute canonical path to the file
  178. } AFP_FILE_INFO, *PAFP_FILE_INFO;
  179. // Used as RPC binding handle to server
  180. typedef DWORD AFP_SERVER_HANDLE;
  181. typedef DWORD *PAFP_SERVER_HANDLE;
  182. /****************** end structures and prototypes for apple talk ***********************/
  183. #endif