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.

967 lines
22 KiB

  1. /*++
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. global.h
  5. Abstract:
  6. This file contains globals and prototypes for user mode webdav client.
  7. Author:
  8. Andy Herron (andyhe) 30-Mar-1999
  9. Rohan Kumar [RohanK] 01-Sept-1999
  10. Environment:
  11. User Mode - Win32
  12. Revision History:
  13. --*/
  14. #ifndef _DAVGLOBAL_H
  15. #define _DAVGLOBAL_H
  16. #pragma once
  17. #include <winsock2.h>
  18. #include <align.h>
  19. #include <winbasep.h>
  20. #include "validc.h"
  21. //
  22. // If the following line is commented, the WinInet calls that are made will be
  23. // synchronous and we use the Win32 thread pool to do the management. If its
  24. // not commented, then we use WinInet asynchronously.
  25. //
  26. // #define DAV_USE_WININET_ASYNCHRONOUSLY 1
  27. //
  28. // svcmain.c will #include this file with GLOBAL_DATA_ALLOCATE defined.
  29. // That will cause each of these variables to be allocated.
  30. //
  31. #ifdef GLOBAL_DATA_ALLOCATE
  32. #undef EXTERN
  33. #define EXTERN
  34. #define GLOBAL_DATA_ALLOCATED
  35. #undef INIT_GLOBAL
  36. #define INIT_GLOBAL(v) =v
  37. #else
  38. #define EXTERN extern
  39. #define INIT_GLOBAL(v)
  40. #endif
  41. #define DAV_MAXTHREADCOUNT_DEFAULT 6
  42. #define DAV_THREADCOUNT_DEFAULT 2
  43. //
  44. // Define all global variables here.
  45. //
  46. EXTERN HANDLE DavRedirDeviceHandle INIT_GLOBAL(INVALID_HANDLE_VALUE);
  47. EXTERN CRITICAL_SECTION g_DavServiceLock;
  48. EXTERN BOOLEAN g_DavServiceLockSet INIT_GLOBAL(FALSE);
  49. EXTERN HINSTANCE g_hinst;
  50. EXTERN BOOL g_RpcActive INIT_GLOBAL(FALSE);
  51. EXTERN BOOL g_RedirLoaded INIT_GLOBAL(FALSE);
  52. EXTERN BOOL g_registeredService INIT_GLOBAL(FALSE);
  53. EXTERN BOOL g_WorkersActive INIT_GLOBAL(FALSE);
  54. EXTERN SERVICE_STATUS_HANDLE g_hStatus;
  55. EXTERN SERVICE_STATUS g_status;
  56. EXTERN ULONG DavInitialThreadCount;
  57. EXTERN ULONG DavMaxThreadCount;
  58. EXTERN PUMRX_USERMODE_REFLECT_BLOCK DavReflectorHandle INIT_GLOBAL(NULL);
  59. EXTERN WSADATA g_wsaData;
  60. EXTERN BOOLEAN g_socketinit;
  61. EXTERN BOOL g_LUIDDeviceMapsEnabled;
  62. EXTERN UNICODE_STRING RedirDeviceName;
  63. //
  64. // This handle is set using InternetOpen function. The process passes this
  65. // handle to subsequent functions like InternetConnect. Its maintained as a
  66. // global to avoid creating such a handle on every call which goes to the
  67. // server.
  68. //
  69. extern HINTERNET IHandle;
  70. //
  71. // A synchronous version of the Internet handle. This is used to satisfy some
  72. // if the NP APIs without going to the kernel.
  73. //
  74. extern HINTERNET ISyncHandle;
  75. //
  76. // Dav Use Table. This table stores the "net use" connections made by the users
  77. // per LogonId.
  78. //
  79. extern DAV_USERS_OBJECT DavUseObject;
  80. //
  81. // Number of users logged on to the system. The Critical section below it
  82. // synchronizes the acces to this variable.
  83. //
  84. extern ULONG DavNumberOfLoggedOnUsers;
  85. extern CRITICAL_SECTION DavLoggedOnUsersLock;
  86. extern CRITICAL_SECTION DavPassportLock;
  87. //
  88. // The "wait hint time" told to the service control manager when the DAV
  89. // service is starting.
  90. //
  91. #define DAV_WAIT_HINT_TIME 60000 // 60 Seconds
  92. //
  93. // Error codes special to DAV. Defined in RFC 2518 (Section 10). Its interesting
  94. // to note that the value DAV_STATUS_INSUFFICIENT_STORAGE (below) has a higher
  95. // value than HTTP_STATUS_LAST defined in WinInet.h. So, this value (507)
  96. // becomes the highest possible return status from a Http/Dav server.
  97. //
  98. #define DAV_MULTI_STATUS 207
  99. #define DAV_STATUS_UNPROCESSABLE_ENTITY 422
  100. #define DAV_STATUS_LOCKED 423
  101. #define DAV_STATUS_FAILED_DEPENDENCY 424
  102. #define DAV_STATUS_INSUFFICIENT_STORAGE 507
  103. //
  104. // The dummy share that is added when a user does a "net use * http://server".
  105. // We allow this since this implies mapping a drive to the root of the DAV
  106. // server.
  107. //
  108. #define DAV_DUMMY_SHARE L"DavWWWRoot"
  109. //
  110. // The different states of a server entry.
  111. //
  112. typedef enum _SERVER_ENTRY_STATES {
  113. //
  114. // Some thread is currently initializing this server entry.
  115. //
  116. ServerEntryInitializing = 0,
  117. //
  118. // The initialization was unsuccessful and this server is not being
  119. // considered a DAV server.
  120. //
  121. ServerEntryInitializationError,
  122. //
  123. // The server entry has been initializeed and is ready to use.
  124. //
  125. ServerEntryInitialized
  126. } SERVER_ENTRY_STATES;
  127. //
  128. // The Server Hash Table entry.
  129. //
  130. typedef struct _HASH_SERVER_ENTRY {
  131. //
  132. // Name.
  133. //
  134. PWCHAR ServerName;
  135. //
  136. // Server ID. This ID is sent up by the kernel and is unique per server.
  137. //
  138. ULONG ServerID;
  139. //
  140. // The state of the server entry.
  141. //
  142. SERVER_ENTRY_STATES ServerEntryState;
  143. //
  144. // This event is set by the thread which creates and initializes a server
  145. // after it has initialized it. This is to wake up any threads which could
  146. // have been waiting for the initialization to finish.
  147. //
  148. HANDLE ServerEventHandle;
  149. //
  150. // If the initialization was unsuccessful, the error status is filled in
  151. // this varriable.
  152. //
  153. ULONG ErrorStatus;
  154. //
  155. // Is it a HTTP server ?
  156. //
  157. BOOL isHttpServer;
  158. //
  159. // Does it support the DAV extensions ?
  160. //
  161. BOOL isDavServer;
  162. //
  163. // Is it the Microsoft IIS ?
  164. //
  165. BOOL isMSIIS;
  166. //
  167. // Is it an Office Web Server?
  168. //
  169. BOOL isOfficeServer;
  170. //
  171. // Is it a TAHOE Server?
  172. //
  173. BOOL isTahoeServer;
  174. //
  175. // Does it support PROPPATCH ?
  176. //
  177. BOOL fSupportsProppatch;
  178. //
  179. // If the creation of the SrvCall failed because the credentials were not
  180. // correct (in other words, the user was not authorized) then we set this
  181. // to TRUE.
  182. //
  183. BOOL credentialFailure;
  184. //
  185. // Pointer to the per user list.
  186. //
  187. LIST_ENTRY PerUserEntry;
  188. //
  189. // The next entry.
  190. //
  191. LIST_ENTRY ServerListEntry;
  192. //
  193. // We need to keep a reference count on this ServerEntry.
  194. //
  195. ULONG ServerEntryRefCount;
  196. //
  197. // Size of this entry including the server name.
  198. //
  199. ULONG EntrySize;
  200. //
  201. // The timer value used in the delayed SrvCall finalization.
  202. //
  203. time_t TimeValueInSec;
  204. //
  205. // This is set to TRUE if the worker thread tried to finalize this server
  206. // hash entry. If this server entry is moved from "to be finalized" list
  207. // to the hash table, this value is checked. If its TRUE, it implies that
  208. // the reference counts on the user entries were decremented by the worker
  209. // thread and have to be incremented back again. It also implies that the
  210. // state of the user entry was set to closing and has to be reset.
  211. //
  212. BOOL HasItBeenScavenged;
  213. BOOL CookieIsNotUsed;
  214. //
  215. // This should be the last field.
  216. //
  217. WCHAR StrBuffer[1];
  218. } HASH_SERVER_ENTRY, *PHASH_SERVER_ENTRY;
  219. //
  220. // TimeValueInSec is set to this value if it should not be removed from the
  221. // Server hash table.
  222. //
  223. #define DONT_EXPIRE -1
  224. //
  225. // Whenever we encounter a server that does not speak the DAV protocol in the
  226. // DavrDoesServerDoDav function, we add it to the NonDAVServerList. An entry
  227. // is kept on this list for ServerNotFoundCacheLifeTimeInSec (a global read
  228. // from the registry during service start-up). Before going on the network
  229. // to figure out whether a server does DAV, we look in the list to see if we
  230. // have already seen this server (which does not do DAV) and fail the call.
  231. //
  232. extern LIST_ENTRY NonDAVServerList;
  233. extern CRITICAL_SECTION NonDAVServerListLock;
  234. //
  235. // The ServerEntry that is created and added to the NonDAVServerList each time
  236. // we encounter a server that does not speak the DAV protocol in the
  237. //
  238. //
  239. typedef struct _NON_DAV_SERVER_ENTRY {
  240. LIST_ENTRY listEntry;
  241. //
  242. // The name of the server which does not speak WebDAV.
  243. //
  244. PWCHAR ServerName;
  245. //
  246. // The time of creation of this entry.
  247. //
  248. time_t TimeValueInSec;
  249. } NON_DAV_SERVER_ENTRY, *PNON_DAV_SERVER_ENTRY;
  250. //
  251. // The delay in sec that the user mode adds (to the finalization of the SrvCall)
  252. // after the kernel mode does the finalization of the SrvCall.
  253. //
  254. #define DAV_SERV_CACHE_VALUE L"ServerNotFoundCacheLifeTimeInSec"
  255. extern ULONG ServerNotFoundCacheLifeTimeInSec;
  256. //
  257. // Should we accept/claim the OfficeWebServers and TahoeWebServers?
  258. //
  259. #define DAV_ACCEPT_TAHOE_OFFICE_SERVERS L"AcceptOfficeAndTahoeServers"
  260. extern ULONG AcceptOfficeAndTahoeServers;
  261. //
  262. // Should we LOCK (using the DAV LOCK Verb) the file on the server on the
  263. // CreateFile path when needed? To know when exactly a LOCK is sent to the
  264. // server, look at the (LOCKing) comments in the davcreat.c file.
  265. //
  266. #define DAV_SUPPORT_LOCKING_OF_FILES L"SupportLocking"
  267. extern ULONG DavSupportLockingOfFiles;
  268. //
  269. // The maximum file size that is allowed by the WebDAV Redir. We keep a limit
  270. // on the file size to avoid being attacked by a rogue server. A rogue server
  271. // could keep on sending infinite amount of data which can cause the WebClient
  272. // service to use 100% of the CPU.
  273. //
  274. #define DAV_FILE_SIZE_LIMIT L"FileSizeLimitInBytes"
  275. extern ULONG DavFileSizeLimitInBytes;
  276. //
  277. // The maximum attributes size that is allowed by the WebDAV Redir. We keep a
  278. // limit on this size to avoid being attacked by a rogue server. A rogue server
  279. // could keep on sending infinite amount of data which can cause the WebClient
  280. // service to use 100% of the CPU. This attribute limit covers all the
  281. // PROPFIND and PROPPATCH responses. For PROPFINDs with Depth 1 we make the
  282. // limit a multiple of DavFileAttributesLimitInBytes (10 times).
  283. //
  284. #define DAV_ATTRIBUTES_SIZE_LIMIT L"FileAttributesLimitInBytes"
  285. extern ULONG DavFileAttributesLimitInBytes;
  286. //
  287. // The Global HashTable containing the HashServerEntries and the lock used while
  288. // accessing it. The server table has 512 entries because each entry is 8 bytes
  289. // and so the table size is 4096 bytes (1 page).
  290. //
  291. #define SERVER_TABLE_SIZE 512
  292. #define MAX_NUMBER_OF_SERVER_ENTRIES_PER_HASH_ID (((DWORD)(-1))/SERVER_TABLE_SIZE)
  293. //
  294. // The hash table containing server entries. When a CreateSrvCall requests comes
  295. // up, this table is checked to see if the server entry exists. if it does not
  296. // a new entry is created and added to the list.
  297. //
  298. extern LIST_ENTRY ServerHashTable[SERVER_TABLE_SIZE];
  299. //
  300. // This critical section synchronizes access to the ServerHashTable.
  301. //
  302. extern CRITICAL_SECTION HashServerEntryTableLock;
  303. //
  304. // This is a counter that gets incremented everytime a new server entry is
  305. // created in the hash table. This defines the unique server id for the entry.
  306. // The id values are never reused.
  307. //
  308. extern ULONG ServerIDCount;
  309. //
  310. // Mentioned below are the custom OFFICE and TAHOE headers which will be
  311. // returned in the response to a PROPFIND request.
  312. //
  313. extern WCHAR *DavTahoeCustomHeader;
  314. extern WCHAR *DavOfficeCustomHeader;
  315. //
  316. // This list contains the following types of server entries:
  317. // 1. The server entires for whom the SrvCall finalization has been received
  318. // from the kernel mode.
  319. // 2. Server entries which failed during the Creation of SrvCall (after the
  320. // memory was allocated for the entry) and,
  321. // This list is maintained for two reasons:
  322. // 1. To delay the finalization of the SrvCall in user mode. Instead of
  323. // finalizing these entries right away (after receiving the request from the
  324. // kernel), we keep them around for a certain time (say t sec). If a request
  325. // for creating a SrvCall for this server comes up again in these t sec, then
  326. // we just move this entry back to the ServerHashTable. This helps us in
  327. // avoiding network calls and,
  328. // 2. To do negative caching. If a machine (for which the CreateSrvCall request
  329. // came up) is not a DAV server, we maintain this info for a while (t sec).
  330. // If another SrvCall request for the same server comes up in this t sec,
  331. // we can return error without going to the net. This is what we mean by
  332. // negative caching.
  333. // A worker thread periodically goes over the list and checks the time each
  334. // entry has spent in the list. If the time exceeds a certain threshold (t sec
  335. // as defined above), it is removed from the list and finalized. The lock used
  336. // to synchronize access to this list is the same one used to aceess the
  337. // ServerHashEntry table.
  338. //
  339. extern LIST_ENTRY ToBeFinalizedServerEntries;
  340. //
  341. // The different states of a user entry.
  342. //
  343. typedef enum _USER_ENTRY_STATES {
  344. //
  345. // This user entry has been created, but not initialized.
  346. //
  347. UserEntryAllocated = 0,
  348. //
  349. // Some thread is currently initializing this entry.
  350. //
  351. UserEntryInitializing,
  352. //
  353. // The initialization was unsuccessful.
  354. //
  355. UserEntryInitializationError,
  356. //
  357. // The entry has been initialized and is ready to use.
  358. //
  359. UserEntryInitialized,
  360. //
  361. // The entry is going to be freed soon. If the entry is in this state,
  362. // no one should be using it.
  363. //
  364. UserEntryClosing
  365. } USER_ENTRY_STATES;
  366. //
  367. // The "Per User Entry" data structure. A list of such entries is maintained
  368. // per server entry in the server hash table (see below).
  369. //
  370. typedef struct _PER_USER_ENTRY {
  371. //
  372. // Unique logon/user ID for this session.
  373. //
  374. LUID LogonID;
  375. //
  376. // The server hash entry off which this user entry is hanging.
  377. //
  378. PHASH_SERVER_ENTRY ServerHashEntry;
  379. //
  380. // Pointer to the next "per user entry" for this server.
  381. //
  382. LIST_ENTRY UserEntry;
  383. //
  384. // The InternetConnect handle.
  385. //
  386. HINTERNET DavConnHandle;
  387. //
  388. // The state of this user entry. The thread that creates this user entry
  389. // sets its state to "UserEntryInitializing" before it initializes it.
  390. // This is done so that any other thread that comes in looking for this
  391. // entry when its in the middle of its initialization process can wait.
  392. //
  393. USER_ENTRY_STATES UserEntryState;
  394. //
  395. // This event is set by the thread which creates and initializes a user
  396. // after it has initialized it. This is to wake up any threads which could
  397. // have been waiting for the initialization to finish.
  398. //
  399. HANDLE UserEventHandle;
  400. //
  401. // The reference count value of this entry. This value is used in managing
  402. // the resource.
  403. //
  404. ULONG UserEntryRefCount;
  405. //
  406. // If the initialization was unsuccessful, the error status is filled in
  407. // this varriable.
  408. //
  409. ULONG ErrorStatus;
  410. //
  411. // The passport cookie for the this user/server pair.
  412. //
  413. PWCHAR Cookie;
  414. PWCHAR UserName;
  415. PWCHAR Password;
  416. DWORD BlockSizeInBytes;
  417. } PER_USER_ENTRY, *PPER_USER_ENTRY;
  418. #define PASSWORD_SEED 0x25
  419. #include <davrpc.h>
  420. #include "debug.h"
  421. //
  422. // Function prototypes go here.
  423. //
  424. DWORD
  425. ReadDWord(
  426. HKEY KeyHandle,
  427. LPTSTR lpValueName,
  428. DWORD DefaultValue
  429. );
  430. DWORD
  431. SetupRpcServer(
  432. VOID
  433. );
  434. DWORD
  435. StopRpcServer(
  436. VOID
  437. );
  438. VOID
  439. UpdateServiceStatus (
  440. DWORD dwState
  441. );
  442. NET_API_STATUS
  443. WsLoadDriver(
  444. IN LPWSTR DriverNameString
  445. );
  446. NET_API_STATUS
  447. WsMapStatus(
  448. IN NTSTATUS NtStatus
  449. );
  450. DWORD
  451. DavReportEventW(
  452. DWORD EventID,
  453. DWORD EventType,
  454. DWORD NumStrings,
  455. DWORD DataLength,
  456. LPWSTR *Strings,
  457. LPVOID Data
  458. );
  459. NET_API_STATUS
  460. WsLoadRedir(
  461. VOID
  462. );
  463. NET_API_STATUS
  464. WsUnloadRedir(
  465. VOID
  466. );
  467. DWORD
  468. DavInitWorkerThreads(
  469. IN ULONG InitialThreadCount,
  470. IN ULONG MaxThreadCount
  471. );
  472. DWORD
  473. DavTerminateWorkerThreads(
  474. VOID
  475. );
  476. ULONG
  477. DavInit(
  478. VOID
  479. );
  480. VOID
  481. DavClose(
  482. VOID
  483. );
  484. ULONG
  485. DavHashTheServerName(
  486. PWCHAR ServerName
  487. );
  488. BOOL
  489. DavIsThisServerInTheTable(
  490. IN PWCHAR ServerName,
  491. OUT PHASH_SERVER_ENTRY *ServerHashEntry
  492. );
  493. BOOL
  494. DavIsServerInFinalizeList(
  495. IN PWCHAR ServerName,
  496. OUT PHASH_SERVER_ENTRY *ServerHashEntry,
  497. IN BOOL ReactivateIfExists
  498. );
  499. VOID
  500. DavInitializeAndInsertTheServerEntry(
  501. IN OUT PHASH_SERVER_ENTRY ServerHashEntry,
  502. IN PWCHAR ServerName,
  503. IN ULONG EntrySize
  504. );
  505. VOID
  506. DavFinalizeToBeFinalizedList(
  507. VOID
  508. );
  509. DWORD
  510. DavPostWorkItem(
  511. LPTHREAD_START_ROUTINE Function,
  512. PDAV_USERMODE_WORKITEM DavContext
  513. );
  514. ULONG
  515. InitializeTheSocketInterface(
  516. VOID
  517. );
  518. NTSTATUS
  519. CleanupTheSocketInterface(
  520. VOID
  521. );
  522. DWORD
  523. DavAsyncCreateSrvCall(
  524. PDAV_USERMODE_WORKITEM DavWorkItem,
  525. BOOLEAN CalledByCallBackThread
  526. );
  527. VOID
  528. DavAsyncCreateSrvCallCompletion(
  529. PDAV_USERMODE_WORKITEM DavWorkItem
  530. );
  531. DWORD
  532. DavAsyncCreate(
  533. PDAV_USERMODE_WORKITEM DavWorkItem,
  534. BOOLEAN CalledByCallBackThread
  535. );
  536. VOID
  537. DavAsyncCreateCompletion(
  538. PDAV_USERMODE_WORKITEM DavWorkItem
  539. );
  540. DWORD
  541. DavAsyncQueryDirectory(
  542. PDAV_USERMODE_WORKITEM DavWorkItem,
  543. BOOLEAN CalledByCallBackThread
  544. );
  545. VOID
  546. DavAsyncQueryDirectoryCompletion(
  547. PDAV_USERMODE_WORKITEM DavWorkItem
  548. );
  549. DWORD
  550. DavAsyncCreateVNetRoot(
  551. PDAV_USERMODE_WORKITEM DavWorkItem,
  552. BOOLEAN CalledByCallBackThread
  553. );
  554. VOID
  555. DavAsyncCreateVNetRootCompletion(
  556. PDAV_USERMODE_WORKITEM DavWorkItem
  557. );
  558. DWORD
  559. DavAsyncReName(
  560. PDAV_USERMODE_WORKITEM DavWorkItem,
  561. BOOLEAN CalledByCallBackThread
  562. );
  563. VOID
  564. DavAsyncReNameCompletion(
  565. PDAV_USERMODE_WORKITEM DavWorkItem
  566. );
  567. DWORD
  568. DavAsyncSetFileInformation(
  569. PDAV_USERMODE_WORKITEM DavWorkItem,
  570. BOOLEAN CalledByCallBackThread
  571. );
  572. VOID
  573. DavAsyncSetFileInformationCompletion(
  574. PDAV_USERMODE_WORKITEM DavWorkItem
  575. );
  576. DWORD
  577. DavAsyncClose(
  578. PDAV_USERMODE_WORKITEM DavWorkItem,
  579. BOOLEAN CalledByCallBackThread
  580. );
  581. VOID
  582. DavAsyncCloseCompletion(
  583. PDAV_USERMODE_WORKITEM DavWorkItem
  584. );
  585. ULONG
  586. DavQueryPassportCookie(
  587. IN HINTERNET RequestHandle,
  588. IN OUT PWCHAR *Cookie
  589. );
  590. VOID
  591. DavDumpHttpResponseHeader(
  592. HINTERNET OpenHandle
  593. );
  594. VOID
  595. DavDumpHttpResponseData(
  596. HINTERNET OpenHandle
  597. );
  598. ULONG
  599. DavQueryAndParseResponse(
  600. HINTERNET DavOpenHandle
  601. );
  602. ULONG
  603. DavQueryAndParseResponseEx(
  604. IN HINTERNET DavOpenHandle,
  605. OUT PULONG HttpResponseStatus OPTIONAL
  606. );
  607. VOID
  608. DavRemoveDummyShareFromFileName(
  609. PWCHAR FileName
  610. );
  611. ULONG
  612. DavMapHttpErrorToDosError(
  613. ULONG HttpResponseStatus
  614. );
  615. //
  616. // The callback function used in asynchronous requests.
  617. //
  618. VOID
  619. _stdcall
  620. DavHandleAsyncResponse(
  621. HINTERNET IHandle,
  622. DWORD_PTR CallBackContext,
  623. DWORD InternetStatus,
  624. LPVOID StatusInformation,
  625. DWORD StatusInformationLength
  626. );
  627. DWORD
  628. WINAPI
  629. DavCommonDispatch(
  630. LPVOID Context
  631. );
  632. DWORD
  633. DavAsyncCommonStates(
  634. PDAV_USERMODE_WORKITEM DavWorkItem,
  635. BOOLEAN CalledByCallBackThread
  636. );
  637. BOOL
  638. DavDoesUserEntryExist(
  639. IN PWCHAR ServerName,
  640. IN ULONG ServerID,
  641. IN PLUID LogonID,
  642. OUT PPER_USER_ENTRY *PerUserEntry,
  643. OUT PHASH_SERVER_ENTRY *ServerHashEntry
  644. );
  645. BOOL
  646. DavFinalizePerUserEntry(
  647. PPER_USER_ENTRY *PUE
  648. );
  649. ULONG
  650. DavFsSetTheDavCallBackContext(
  651. IN OUT PDAV_USERMODE_WORKITEM pDavWorkItem
  652. );
  653. VOID
  654. DavFsFinalizeTheDavCallBackContext(
  655. IN PDAV_USERMODE_WORKITEM pDavWorkItem
  656. );
  657. DWORD
  658. DavUnLockTheFileOnTheServer(
  659. IN PDAV_USERMODE_WORKITEM DavWorkItem
  660. );
  661. //
  662. // Functions exposed to the usermode reflector library.
  663. //
  664. ULONG
  665. DavFsCreate(
  666. PDAV_USERMODE_WORKITEM DavWorkItem
  667. );
  668. ULONG
  669. DavFsCreateSrvCall(
  670. PDAV_USERMODE_WORKITEM DavWorkItem
  671. );
  672. ULONG
  673. DavFsCreateVNetRoot(
  674. PDAV_USERMODE_WORKITEM DavWorkItem
  675. );
  676. ULONG
  677. DavFsFinalizeSrvCall(
  678. PDAV_USERMODE_WORKITEM DavWorkItem
  679. );
  680. ULONG
  681. DavFsFinalizeVNetRoot(
  682. PDAV_USERMODE_WORKITEM DavWorkItem
  683. );
  684. ULONG
  685. DavFsFinalizeFobx(
  686. PDAV_USERMODE_WORKITEM DavWorkItem
  687. );
  688. ULONG
  689. DavFsQueryDirectory(
  690. PDAV_USERMODE_WORKITEM DavWorkItem
  691. );
  692. ULONG
  693. DavFsQueryVolumeInformation(
  694. PDAV_USERMODE_WORKITEM DavWorkItem
  695. );
  696. DWORD
  697. DavAsyncQueryVolumeInformation(
  698. PDAV_USERMODE_WORKITEM DavWorkItem,
  699. BOOLEAN CalledByCallBackThread
  700. );
  701. VOID
  702. DavAsyncQueryVolumeInformationCompletion(
  703. PDAV_USERMODE_WORKITEM DavWorkItem
  704. );
  705. ULONG
  706. DavFsReName(
  707. PDAV_USERMODE_WORKITEM DavWorkItem
  708. );
  709. ULONG
  710. DavFsSetFileInformation(
  711. PDAV_USERMODE_WORKITEM DavWorkItem
  712. );
  713. ULONG
  714. DavFsClose(
  715. PDAV_USERMODE_WORKITEM DavWorkItem
  716. );
  717. ULONG
  718. DavFsLockRefresh(
  719. PDAV_USERMODE_WORKITEM DavWorkItem
  720. );
  721. NTSTATUS
  722. DavMapErrorToNtStatus(
  723. DWORD dwWininetError
  724. );
  725. NTSTATUS
  726. DavDosErrorToNtStatus(
  727. DWORD dwError
  728. );
  729. VOID
  730. DavObtainServerProperties(
  731. PWCHAR lpInParseData,
  732. BOOL *lpfIsHttpServer,
  733. BOOL *lpfIsIIs,
  734. BOOL *lpfIsDavServer
  735. );
  736. DWORD
  737. DavTestProppatch(
  738. PDAV_USERMODE_WORKITEM DavWorkItem,
  739. HINTERNET hDavConnect,
  740. LPWSTR lpPathName
  741. );
  742. DWORD
  743. DavSetBasicInformation(
  744. PDAV_USERMODE_WORKITEM DavWorkItem,
  745. HINTERNET hDavConnect,
  746. LPWSTR PathName,
  747. BOOL fCreationTimeChanged,
  748. BOOL fLastAccessTimeChanged,
  749. BOOL fLastModifiedTimeChanged,
  750. BOOL fFileAttributesChanged,
  751. IN LARGE_INTEGER *lpCreationTime,
  752. IN LARGE_INTEGER *lpLastAccessTime,
  753. IN LARGE_INTEGER *lpLastModifiedTime,
  754. DWORD dwFileAttributes
  755. );
  756. DWORD
  757. DavReportEventInEventLog(
  758. DWORD EventType,
  759. DWORD EventId,
  760. DWORD NumberOfStrings,
  761. PWCHAR *EventStrings
  762. );
  763. DWORD
  764. DavFormatAndLogError(
  765. PDAV_USERMODE_WORKITEM DavWorkItem,
  766. DWORD Win32Status
  767. );
  768. DWORD
  769. DavParseXmlResponse(
  770. HINTERNET DavOpenHandle,
  771. DAV_FILE_ATTRIBUTES *pDavFileAttributesIn,
  772. DWORD *pNumFileEntries
  773. );
  774. DWORD
  775. DavAttachPassportCookie(
  776. PDAV_USERMODE_WORKITEM DavWorkItem,
  777. HINTERNET DavOpenHandle,
  778. PWCHAR *PassportCookie
  779. );
  780. DWORD
  781. DavInternetSetOption(
  782. PDAV_USERMODE_WORKITEM DavWorkItem,
  783. HINTERNET DavOpenHandle
  784. );
  785. #endif // DAVGLOBAL_H