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.

632 lines
16 KiB

  1. #ifndef _INC_CSCAPI
  2. #define _INC_CSCAPI
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. // flags returned in the status field for files and folders.
  7. // NB!!!! these bit definitions match exactly with those in shdcom.h
  8. #define FLAG_CSC_COPY_STATUS_DATA_LOCALLY_MODIFIED 0x0001
  9. #define FLAG_CSC_COPY_STATUS_ATTRIB_LOCALLY_MODIFIED 0x0002
  10. #define FLAG_CSC_COPY_STATUS_TIME_LOCALLY_MODIFIED 0x0004
  11. #define FLAG_CSC_COPY_STATUS_STALE 0x0008
  12. #define FLAG_CSC_COPY_STATUS_LOCALLY_DELETED 0x0010
  13. #define FLAG_CSC_COPY_STATUS_SPARSE 0x0020
  14. #define FLAG_CSC_COPY_STATUS_ORPHAN 0x0100
  15. #define FLAG_CSC_COPY_STATUS_SUSPECT 0x0200
  16. #define FLAG_CSC_COPY_STATUS_LOCALLY_CREATED 0x0400
  17. #define FLAG_CSC_COPY_STATUS_IS_FILE 0x80000000
  18. #define FLAG_CSC_COPY_STATUS_FILE_IN_USE 0x40000000
  19. // Flags returned in the status field for shares
  20. #define FLAG_CSC_SHARE_STATUS_MODIFIED_OFFLINE 0x0001
  21. #define FLAG_CSC_SHARE_STATUS_CONNECTED 0x0800
  22. #define FLAG_CSC_SHARE_STATUS_FILES_OPEN 0x0400
  23. #define FLAG_CSC_SHARE_STATUS_FINDS_IN_PROGRESS 0x0200
  24. #define FLAG_CSC_SHARE_STATUS_DISCONNECTED_OP 0x8000
  25. #define FLAG_CSC_SHARE_MERGING 0x4000
  26. #define FLAG_CSC_SHARE_STATUS_MANUAL_REINT 0x0000 // No automatic file by file reint (Persistent)
  27. #define FLAG_CSC_SHARE_STATUS_AUTO_REINT 0x0040 // File by file reint is OK (Persistent)
  28. #define FLAG_CSC_SHARE_STATUS_VDO 0x0080 // no need to flow opens (Persistent)
  29. #define FLAG_CSC_SHARE_STATUS_NO_CACHING 0x00c0 // client should not cache this share (Persistent)
  30. #define FLAG_CSC_SHARE_STATUS_CACHING_MASK 0x00c0 // type of caching
  31. #define FLAG_CSC_ACCESS_MASK 0x003F0000
  32. #define FLAG_CSC_USER_ACCESS_MASK 0x00030000
  33. #define FLAG_CSC_GUEST_ACCESS_MASK 0x000C0000
  34. #define FLAG_CSC_OTHER_ACCESS_MASK 0x00300000
  35. #define FLAG_CSC_USER_ACCESS_SHIFT_COUNT 16
  36. #define FLAG_CSC_GUEST_ACCESS_SHIFT_COUNT 18
  37. #define FLAG_CSC_OTHER_ACCESS_SHIFT_COUNT 20
  38. #define FLAG_CSC_READ_ACCESS 0x00000001
  39. #define FLAG_CSC_WRITE_ACCESS 0x00000002
  40. // Hint flags Definitions:
  41. #define FLAG_CSC_HINT_PIN_USER 0x01 // When this bit is set, the item is being pinned for the user
  42. // Note that there is only one pincount allotted for user.
  43. #define FLAG_CSC_HINT_PIN_INHERIT_USER 0x02 // When this flag is set on a folder, all descendents subsequently
  44. // Created in this folder get pinned for the user
  45. #define FLAG_CSC_HINT_PIN_INHERIT_SYSTEM 0x04 // When this flag is set on a folder, all descendents
  46. // Subsequently created in this folder get pinned for the
  47. // system
  48. #define FLAG_CSC_HINT_CONSERVE_BANDWIDTH 0x08 // When this flag is set on a folder, for executables and
  49. // Other related file, CSC tries to conserver bandwidth
  50. // By not flowing opens when these files are fully
  51. #define FLAG_CSC_HINT_PIN_SYSTEM 0x10 // This flag indicates it is pinned for the system
  52. #define FLAG_CSC_HINT_COMMAND_MASK 0xf0000000
  53. #define FLAG_CSC_HINT_COMMAND_ALTER_PIN_COUNT 0x80000000 // Increments/decrements pin count
  54. // Database status bits
  55. #define FLAG_DATABASESTATUS_DIRTY 0x00000001
  56. #define FLAG_DATABASESTATUS_ENCRYPTION_MASK 0x00000006
  57. #define FLAG_DATABASESTATUS_UNENCRYPTED 0x00000000 // new fileinodes will NOT be encrypted
  58. #define FLAG_DATABASESTATUS_PARTIALLY_UNENCRYPTED 0x00000004
  59. #define FLAG_DATABASESTATUS_ENCRYPTED 0x00000002 // new fileinodes will be encrypted
  60. #define FLAG_DATABASESTATUS_PARTIALLY_ENCRYPTED 0x00000006
  61. // definitions for callback reason
  62. #define CSCPROC_REASON_BEGIN 1
  63. #define CSCPROC_REASON_MORE_DATA 2
  64. #define CSCPROC_REASON_END 3
  65. // Definitions for callback return values:
  66. #define CSCPROC_RETURN_CONTINUE 1
  67. #define CSCPROC_RETURN_SKIP 2
  68. #define CSCPROC_RETURN_ABORT 3
  69. #define CSCPROC_RETURN_FORCE_INWARD 4 // applies only while merging
  70. #define CSCPROC_RETURN_FORCE_OUTWARD 5 // applies only while merging
  71. #define CSCPROC_RETURN_RETRY 6
  72. typedef DWORD (WINAPI *LPCSCPROCW)(
  73. LPCWSTR lpszName,
  74. DWORD dwStatus,
  75. DWORD dwHintFlags,
  76. DWORD dwPinCount,
  77. WIN32_FIND_DATAW *lpFind32,
  78. DWORD dwReason,
  79. DWORD dwParam1,
  80. DWORD dwParam2,
  81. DWORD_PTR dwContext
  82. );
  83. typedef DWORD (WINAPI *LPCSCPROCA)(
  84. LPCSTR lpszName,
  85. DWORD dwStatus,
  86. DWORD dwHintFlags,
  87. DWORD dwPinCount,
  88. WIN32_FIND_DATAA *lpFind32,
  89. DWORD dwReason,
  90. DWORD dwParam1,
  91. DWORD dwParam2,
  92. DWORD_PTR dwContext
  93. );
  94. BOOL
  95. WINAPI
  96. CSCIsCSCEnabled(
  97. VOID
  98. );
  99. BOOL
  100. WINAPI
  101. CSCFindClose(
  102. IN HANDLE hFind
  103. );
  104. BOOL
  105. WINAPI
  106. CSCPinFileA(
  107. IN LPCSTR lpszFileName,
  108. IN DWORD dwHintFlags,
  109. OUT LPDWORD lpdwStatus,
  110. OUT LPDWORD lpdwPinCount,
  111. OUT LPDWORD lpdwHintFlags
  112. );
  113. BOOL
  114. WINAPI
  115. CSCUnpinFileA(
  116. IN LPCSTR lpszFileName,
  117. IN DWORD dwHintFlags,
  118. OUT LPDWORD lpdwStatus,
  119. OUT LPDWORD lpdwPinCount,
  120. OUT LPDWORD lpdwHintFlags
  121. );
  122. BOOL
  123. WINAPI
  124. CSCQueryFileStatusA(
  125. IN LPCSTR lpszFileName,
  126. OUT LPDWORD lpdwStatus,
  127. OUT LPDWORD lpdwPinCount,
  128. OUT LPDWORD lpdwHintFlags
  129. );
  130. BOOL
  131. WINAPI
  132. CSCQueryFileStatusExA(
  133. IN LPCSTR lpszFileName,
  134. OUT LPDWORD lpdwStatus,
  135. OUT LPDWORD lpdwPinCount,
  136. OUT LPDWORD lpdwHintFlags,
  137. OUT LPDWORD lpdwUserPerms,
  138. OUT LPDWORD lpdwOtherPerms
  139. );
  140. BOOL
  141. WINAPI
  142. CSCQueryShareStatusA(
  143. IN LPCSTR lpszFileName,
  144. OUT LPDWORD lpdwStatus,
  145. OUT LPDWORD lpdwPinCount,
  146. OUT LPDWORD lpdwHintFlags,
  147. OUT LPDWORD lpdwUserPerms,
  148. OUT LPDWORD lpdwOtherPerms
  149. );
  150. HANDLE
  151. WINAPI
  152. CSCFindFirstFileA(
  153. IN LPCSTR lpszFileName, // if NULL, returns the shares cached
  154. OUT WIN32_FIND_DATA *lpFind32,
  155. OUT LPDWORD lpdwStatus, // returns FLAG_CSC_SHARE_STATUS_XXX for shares
  156. // FLAG_CSC_STATUS_XXX for the rest
  157. OUT LPDWORD lpdwPinCount,
  158. OUT LPDWORD lpdwHintFlags,
  159. OUT FILETIME *lpOrgFileTime
  160. );
  161. BOOL
  162. WINAPI
  163. CSCFindNextFileA(
  164. IN HANDLE hFind,
  165. OUT WIN32_FIND_DATA *lpFind32,
  166. OUT LPDWORD lpdwStatus,
  167. OUT LPDWORD lpdwPinCount,
  168. OUT LPDWORD lpdwHintFlags,
  169. OUT FILETIME *lpOrgFileTime
  170. );
  171. BOOL
  172. WINAPI
  173. CSCDeleteA(
  174. IN LPCSTR lpszFileName
  175. );
  176. BOOL
  177. WINAPI
  178. CSCFillSparseFilesA(
  179. IN LPCSTR lpszShareName,
  180. IN BOOL fFullSync,
  181. IN LPCSCPROCA lpprocFillProgress,
  182. IN DWORD_PTR dwContext
  183. );
  184. BOOL
  185. WINAPI
  186. CSCMergeShareA(
  187. IN LPCSTR lpszShareName,
  188. IN LPCSCPROCA lpfnMergeProgress,
  189. IN DWORD_PTR dwContext
  190. );
  191. BOOL
  192. WINAPI
  193. CSCCopyReplicaA(
  194. IN LPCSTR lpszFullPath,
  195. OUT LPSTR *lplpszLocalName
  196. );
  197. BOOL
  198. WINAPI
  199. CSCEnumForStatsA(
  200. IN LPCSTR lpszShareName,
  201. IN LPCSCPROCA lpfnEnumProgress,
  202. IN DWORD_PTR dwContext
  203. );
  204. BOOL
  205. WINAPI
  206. CSCEnumForStatsExA(
  207. IN LPCSTR lpszShareName,
  208. IN LPCSCPROCA lpfnEnumProgress,
  209. IN DWORD_PTR dwContext
  210. );
  211. BOOL
  212. WINAPI
  213. CSCPinFileW(
  214. LPCWSTR lpszFileName,
  215. DWORD dwHintFlags,
  216. LPDWORD lpdwStatus,
  217. LPDWORD lpdwPinCount,
  218. LPDWORD lpdwHintFlags
  219. );
  220. BOOL
  221. WINAPI
  222. CSCUnpinFileW(
  223. LPCWSTR lpszFileName,
  224. DWORD dwHintFlags,
  225. LPDWORD lpdwStatus,
  226. LPDWORD lpdwPinCount,
  227. LPDWORD lpdwHintFlags
  228. );
  229. BOOL
  230. WINAPI
  231. CSCQueryFileStatusW(
  232. LPCWSTR lpszFileName,
  233. LPDWORD lpdwStatus,
  234. LPDWORD lpdwPinCount,
  235. LPDWORD lpdwHintFlags
  236. );
  237. BOOL
  238. WINAPI
  239. CSCQueryFileStatusExW(
  240. LPCWSTR lpszFileName,
  241. LPDWORD lpdwStatus,
  242. LPDWORD lpdwPinCount,
  243. LPDWORD lpdwHintFlags,
  244. LPDWORD lpdwUserPerms,
  245. LPDWORD lpdwOtherPerms
  246. );
  247. BOOL
  248. WINAPI
  249. CSCQueryShareStatusW(
  250. LPCWSTR lpszFileName,
  251. LPDWORD lpdwStatus,
  252. LPDWORD lpdwPinCount,
  253. LPDWORD lpdwHintFlags,
  254. LPDWORD lpdwUserPerms,
  255. LPDWORD lpdwOtherPerms
  256. );
  257. HANDLE
  258. WINAPI
  259. CSCFindFirstFileW(
  260. LPCWSTR lpszFileName,
  261. WIN32_FIND_DATAW *lpFind32,
  262. LPDWORD lpdwStatus,
  263. LPDWORD lpdwPinCount,
  264. LPDWORD lpdwHintFlags,
  265. FILETIME *lpOrgFileTime
  266. );
  267. HANDLE
  268. WINAPI
  269. CSCFindFirstFileForSidW(
  270. LPCWSTR lpszFileName,
  271. PSID pSid,
  272. WIN32_FIND_DATAW *lpFind32,
  273. LPDWORD lpdwStatus,
  274. LPDWORD lpdwPinCount,
  275. LPDWORD lpdwHintFlags,
  276. FILETIME *lpOrgFileTime
  277. );
  278. BOOL
  279. WINAPI
  280. CSCFindNextFileW(
  281. HANDLE hFind,
  282. WIN32_FIND_DATAW *lpFind32,
  283. LPDWORD lpdwStatus,
  284. LPDWORD lpdwPinCount,
  285. LPDWORD lpdwHintFlags,
  286. FILETIME *lpOrgFileTime
  287. );
  288. BOOL
  289. WINAPI
  290. CSCDeleteW(
  291. IN LPCWSTR lpszFileName
  292. );
  293. BOOL
  294. WINAPI
  295. CSCFillSparseFilesW(
  296. IN LPCWSTR lpszShareName,
  297. IN BOOL fFullSync,
  298. IN LPCSCPROCW lpprocFillProgress,
  299. IN DWORD_PTR dwContext
  300. );
  301. BOOL
  302. WINAPI
  303. CSCMergeShareW(
  304. IN LPCWSTR lpszShareName,
  305. IN LPCSCPROCW lpfnMergeProgress,
  306. IN DWORD_PTR dwContext
  307. );
  308. BOOL
  309. WINAPI
  310. CSCCopyReplicaW(
  311. IN LPCWSTR lpszFullPath,
  312. OUT LPWSTR *lplpszLocalName
  313. );
  314. BOOL
  315. WINAPI
  316. CSCEnumForStatsW(
  317. IN LPCWSTR lpszShareName,
  318. IN LPCSCPROCW lpfnEnumProgress,
  319. IN DWORD_PTR dwContext
  320. );
  321. BOOL
  322. WINAPI
  323. CSCEnumForStatsExW(
  324. IN LPCWSTR lpszShareName,
  325. IN LPCSCPROCW lpfnEnumProgress,
  326. IN DWORD_PTR dwContext
  327. );
  328. BOOL
  329. WINAPI
  330. CSCFreeSpace(
  331. DWORD nFileSizeHigh,
  332. DWORD nFileSizeLow
  333. );
  334. BOOL
  335. WINAPI
  336. CSCIsServerOfflineA(
  337. IN LPCSTR lpszServerName,
  338. OUT BOOL *lpfOffline
  339. );
  340. BOOL
  341. WINAPI
  342. CSCIsServerOfflineW(
  343. IN LPCWSTR lpszServerName,
  344. OUT BOOL *lpfOffline
  345. );
  346. BOOL
  347. WINAPI
  348. CSCGetSpaceUsageA(
  349. OUT LPSTR lptzLocation,
  350. IN DWORD dwSize,
  351. OUT LPDWORD lpdwMaxSpaceHigh,
  352. OUT LPDWORD lpdwMaxSpaceLow,
  353. OUT LPDWORD lpdwCurrentSpaceHigh,
  354. OUT LPDWORD lpdwCurrentSpaceLow,
  355. OUT LPDWORD lpcntTotalFiles,
  356. OUT LPDWORD lpcntTotalDirs
  357. );
  358. BOOL
  359. WINAPI
  360. CSCGetSpaceUsageW(
  361. OUT LPWSTR lptzLocation,
  362. IN DWORD dwSize,
  363. OUT LPDWORD lpdwMaxSpaceHigh,
  364. OUT LPDWORD lpdwMaxSpaceLow,
  365. OUT LPDWORD lpdwCurrentSpaceHigh,
  366. OUT LPDWORD lpdwCurrentSpaceLow,
  367. OUT LPDWORD lpcntTotalFiles,
  368. OUT LPDWORD lpcntTotalDirs
  369. );
  370. BOOL
  371. WINAPI
  372. CSCSetMaxSpace(
  373. DWORD nFileSizeHigh,
  374. DWORD nFileSizeLow
  375. );
  376. BOOL
  377. WINAPI
  378. CSCTransitionServerOnlineW(
  379. IN LPCWSTR lpszServerName
  380. );
  381. BOOL
  382. WINAPI
  383. CSCTransitionServerOnlineA(
  384. IN LPCSTR lpszServerName
  385. );
  386. BOOL
  387. WINAPI
  388. CSCCheckShareOnlineW(
  389. IN LPCWSTR lpszShareName
  390. );
  391. BOOL
  392. WINAPI
  393. CSCCheckShareOnlineExW(
  394. IN LPCWSTR lpszShareName,
  395. IN DWORD *lpdwSpeed
  396. );
  397. BOOL
  398. WINAPI
  399. CSCCheckShareOnlineA(
  400. IN LPCSTR lpszShareName
  401. );
  402. BOOL
  403. WINAPI
  404. CSCDoLocalRenameW(
  405. IN LPCWSTR lpszSource,
  406. IN LPCWSTR lpszDestination,
  407. IN BOOL fReplaceFile
  408. );
  409. BOOL
  410. WINAPI
  411. CSCDoLocalRenameA(
  412. IN LPCSTR lpszSource,
  413. IN LPCSTR lpszDestination,
  414. IN BOOL fReplaceFile
  415. );
  416. BOOL
  417. WINAPI
  418. CSCDoLocalRenameExA(
  419. IN LPCSTR lpszSource,
  420. IN LPCSTR lpszDestination,
  421. IN WIN32_FIND_DATAA *lpFin32,
  422. IN BOOL fMarkAsLocal,
  423. IN BOOL fReplaceFileIfExists
  424. );
  425. BOOL
  426. WINAPI
  427. CSCDoLocalRenameExW(
  428. IN LPCWSTR lpszSource,
  429. IN LPCWSTR lpszDestination,
  430. IN WIN32_FIND_DATAW *lpFin32,
  431. IN BOOL fMarkAsLocal,
  432. IN BOOL fReplaceFileIfExists
  433. );
  434. BOOL
  435. WINAPI
  436. CSCDoEnableDisable(
  437. BOOL fEnable
  438. );
  439. BOOL
  440. WINAPI
  441. CSCBeginSynchronizationW(
  442. IN LPCWSTR lpszShareName,
  443. LPDWORD lpdwSpeed,
  444. LPDWORD lpdwContext
  445. );
  446. BOOL
  447. WINAPI
  448. CSCEndSynchronizationW(
  449. IN LPCWSTR lpszShareName,
  450. DWORD dwContext
  451. );
  452. BOOL
  453. WINAPI
  454. CSCEncryptDecryptDatabase(
  455. IN BOOL fEncrypt,
  456. IN LPCSCPROCW lpfnEnumProgress,
  457. IN DWORD_PTR dwContext
  458. );
  459. BOOL
  460. WINAPI
  461. CSCQueryDatabaseStatus(
  462. ULONG *pulStatus,
  463. ULONG *pulErrors
  464. );
  465. BOOL
  466. WINAPI
  467. CSCPurgeUnpinnedFiles(
  468. ULONG Timeout,
  469. ULONG *pulnFiles,
  470. ULONG *pulnYoungFiles
  471. );
  472. BOOL
  473. WINAPI
  474. CSCShareIdToShareName(
  475. ULONG ShareId,
  476. PBYTE Buffer,
  477. PDWORD pdwBufSize
  478. );
  479. #ifdef UNICODE
  480. #define CSCPinFile CSCPinFileW
  481. #define CSCUnpinFile CSCUnpinFileW
  482. #define CSCQueryFileStatus CSCQueryFileStatusW
  483. #define CSCQueryFileStatusEx CSCQueryFileStatusExW
  484. #define CSCQueryShareStatus CSCQueryShareStatusW
  485. #define CSCFindFirstFile CSCFindFirstFileW
  486. #define CSCFindFirstFileForSid CSCFindFirstFileForSidW
  487. #define CSCFindNextFile CSCFindNextFileW
  488. #define CSCDelete CSCDeleteW
  489. #define CSCFillSparseFiles CSCFillSparseFilesW
  490. #define CSCMergeShare CSCMergeShareW
  491. #define CSCCopyReplica CSCCopyReplicaW
  492. #define CSCEnumForStats CSCEnumForStatsW
  493. #define CSCIsServerOffline CSCIsServerOfflineW
  494. #define LPCSCPROC LPCSCPROCW
  495. #define CSCGetSpaceUsage CSCGetSpaceUsageW
  496. #define CSCTransitionServerOnline CSCTransitionServerOnlineW
  497. #define CSCCheckShareOnline CSCCheckShareOnlineW
  498. #define CSCCheckShareOnlineEx CSCCheckShareOnlineExW
  499. #define CSCDoLocalRename CSCDoLocalRenameW
  500. #define CSCDoLocalRenameEx CSCDoLocalRenameExW
  501. #define CSCEnumForStatsEx CSCEnumForStatsExW
  502. #define CSCBeginSynchronization CSCBeginSynchronizationW
  503. #define CSCEndSynchronization CSCEndSynchronizationW
  504. #else
  505. #define CSCPinFile CSCPinFileA
  506. #define CSCUnpinFile CSCUnpinFileA
  507. #define CSCQueryFileStatus CSCQueryFileStatusA
  508. #define CSCQueryFileStatusEx CSCQueryFileStatusExA
  509. #define CSCQueryShareStatus CSCQueryShareStatusA
  510. #define CSCFindFirstFile CSCFindFirstFileA
  511. #define CSCFindFirstFileForSid CSCFindFirstFileForSidA
  512. #define CSCFindNextFile CSCFindNextFileA
  513. #define CSCDelete CSCDeleteA
  514. #define CSCFillSparseFiles CSCFillSparseFilesA
  515. #define CSCMergeShare CSCMergeShareA
  516. #define CSCCopyReplica CSCCopyReplicaA
  517. #define CSCEnumForStats CSCEnumForStatsA
  518. #define CSCIsServerOffline CSCIsServerOfflineA
  519. #define LPCSCPROC LPCSCPROCA
  520. #define CSCGetSpaceUsage CSCGetSpaceUsageA
  521. #define CSCTransitionServerOnline CSCTransitionServerOnlineA
  522. #define CSCCheckShareOnline CSCCheckShareOnlineA
  523. #define CSCCheckShareOnlineEx CSCCheckShareOnlineExA
  524. #define CSCDoLocalRename CSCDoLocalRenameA
  525. #define CSCEnumForStatsEx CSCEnumForStatsExA
  526. #define CSCDoLocalRenameEx CSCDoLocalRenameExA
  527. #endif
  528. #ifdef __cplusplus
  529. } /* ... extern "C" */
  530. #endif
  531. #endif // _INC_CSCAPI