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.

869 lines
27 KiB

  1. // nntpdrv.idl : IDL source for nntpdrv.dll
  2. //
  3. // This file will be processed by the MIDL tool to
  4. // produce the type library (nntpdrv.tlb) and marshalling code.
  5. import "oaidl.idl";
  6. import "ocidl.idl";
  7. //
  8. // -------------- Interfaces implemented by the Server --------------
  9. //
  10. interface INntpServer;
  11. interface INNTPPropertyBag;
  12. interface INewsTreeIterator;
  13. interface INewsTree;
  14. interface INntpComplete;
  15. interface INntpDriver;
  16. interface INntpDriverSearch;
  17. interface INntpSearchResults;
  18. //
  19. // Server access request bits
  20. //
  21. cpp_quote("#define NNTP_ACCESS_READ 0x0001")
  22. cpp_quote("#define NNTP_ACCESS_POST 0x0002")
  23. cpp_quote("#define NNTP_ACCESS_CREATE_SUBFOLDER 0x0004")
  24. cpp_quote("#define NNTP_ACCESS_REMOVE_SUBFOLDER 0x0008")
  25. cpp_quote("#define NNTP_ACCESS_REMOVE_FOLDER 0x0010")
  26. cpp_quote("#define NNTP_ACCESS_REMOVE 0x0020")
  27. cpp_quote("#define NNTP_ACCESS_EDIT_FOLDER 0x0040")
  28. cpp_quote("#define NNTP_ACCESS_EDIT 0x0080")
  29. //
  30. // Connect flag bits
  31. //
  32. cpp_quote("#define NNTP_CONNECT_UPGRADE 0x0001")
  33. //
  34. // Server mode, driver can inquire about server mode to determine'
  35. // what he should do during DecorateNewsTree
  36. //
  37. cpp_quote("#define NNTP_SERVER_NORMAL 0x0001")
  38. cpp_quote("#define NNTP_SERVER_STANDARD_REBUILD 0x0002")
  39. cpp_quote("#define NNTP_SERVER_CLEAN_REBUILD 0x0003")
  40. typedef struct
  41. {
  42. BYTE cLen;
  43. BYTE pbStoreId[256];
  44. } STOREID;
  45. typedef DWORD GROUPID;
  46. //
  47. // This interface exposes server functionality
  48. //
  49. [
  50. object,
  51. uuid(c7bae7b4-dee3-11d1-94cf-00c04fa379f1),
  52. helpstring("INntpDriver Interface"),
  53. ]
  54. interface INntpServer : IUnknown {
  55. //
  56. // find the primary groupid/articleid for an article given the secondary
  57. // groupid/articleid
  58. //
  59. // arguments:
  60. // pgroupSecondary - the property bag for the secondary crosspost
  61. // artidSecondary - the article ID for the secondary crosspost
  62. // ppgroupPrimary - gets filled in with the property bag for the primary
  63. // crosspost. the caller should Release() this when
  64. // they are done with it.
  65. // fStorePrimary - if TRUE then return the primary article for the store
  66. // that owns pgroupSecondary
  67. // partidPrimary - the article id for the primary crosspost
  68. //
  69. // returns (through completion object):
  70. // S_OK - found primary
  71. // S_FALSE - the values given were the primary
  72. // or an error code
  73. //
  74. [local]
  75. void FindPrimaryArticle([in] INNTPPropertyBag *pGroupSecondary,
  76. [in] DWORD artidSecondary,
  77. [out] INNTPPropertyBag **ppgroupPrimary,
  78. [out] DWORD *partidPrimary,
  79. [in] BOOL fStorePrimary,
  80. [in] INntpComplete *pCompletion,
  81. [in] INntpComplete *pProtocolComplete );
  82. //
  83. // Create the entries in the hash tables for a new article.
  84. //
  85. [local]
  86. void CreatePostEntries([in] CHAR *pszMessageId,
  87. [in] DWORD iHeaderLength,
  88. [in] STOREID *pStoreId,
  89. [in] BYTE cGroups,
  90. [in] INNTPPropertyBag **rgpGroups,
  91. [in,out] DWORD *rgArticleIds,
  92. [in] BOOL fAllocArtId,
  93. [in] INntpComplete *pCompletion);
  94. //
  95. // Create the entries in the hash tables for a new article.
  96. //
  97. [local]
  98. void DeleteArticle([in] CHAR *pszMessageId,
  99. [in] INntpComplete *pCompletion);
  100. //
  101. // This tells the driver what rebuild mode the server is in
  102. // The returned value should be NNTP_SERVER_NORMAL, NNTP_SERVER
  103. // _STANDARD_REBUILD or NNTP_SERVER_CLEAN_REBUILD
  104. //
  105. [local]
  106. DWORD QueryServerMode();
  107. //
  108. // Tells whether should skip empty dir when rebuild
  109. //
  110. [local]
  111. BOOL SkipNonLeafDirWhenRebuild();
  112. //
  113. // Should I continue the rebuild ? Anybody has cancelled the rebuild ?
  114. //
  115. [local]
  116. BOOL ShouldContinueRebuild();
  117. //
  118. // Is this message id in the server ( article table ) ?
  119. //
  120. [local]
  121. BOOL MessageIdExist( CHAR *szMessageId );
  122. //
  123. // Set rebuild last error
  124. //
  125. [local]
  126. void SetRebuildLastError( DWORD err );
  127. //
  128. // Obtain article number for each newsgroups.
  129. //
  130. [local]
  131. void AllocArticleNumber([in] BYTE cGroups,
  132. [in] INNTPPropertyBag **rgpGroups,
  133. [in,out] DWORD *rgArticleIds,
  134. [in] INntpComplete *pCompletion);
  135. //
  136. // Return whether this is a Slave server, and the pickup dir
  137. //
  138. [local]
  139. BOOL IsSlaveServer( [out] WCHAR* pwszPickupDir,
  140. [out] LPVOID lpvContext);
  141. };
  142. //
  143. // this property bag is used to represent data in the newsgroups
  144. //
  145. [
  146. object,
  147. uuid(f5ad0d78-af9f-11d1-862e-00c04fb960ea)
  148. ]
  149. interface INNTPPropertyBag : IUnknown {
  150. //
  151. // put a BLOB property into the table. this is also used for string
  152. // properties
  153. //
  154. [local]
  155. HRESULT PutBLOB(
  156. [in] DWORD dwID,
  157. [in] DWORD cbValue,
  158. [in,size_is(cbValue)] BYTE *pbValue);
  159. //
  160. // get a BLOB property from the table. this is also used for string
  161. // properties
  162. //
  163. [local]
  164. HRESULT GetBLOB(
  165. [in] DWORD dwID,
  166. [in] BYTE *pbValue,
  167. [in,out] DWORD *pcbValue);
  168. //
  169. // put a dword property into the table
  170. //
  171. [local]
  172. HRESULT PutDWord(
  173. [in] DWORD dwID,
  174. [in] DWORD dwValue);
  175. //
  176. // get a dword property from the table
  177. //
  178. [local]
  179. HRESULT GetDWord(
  180. [in] DWORD dwID,
  181. [out] DWORD *pdwValue);
  182. //
  183. // put an interface pointer into the table
  184. //
  185. // interfaces can only be used with properties that are runtime only.
  186. //
  187. [local]
  188. HRESULT PutInterface(
  189. [in] DWORD dwID,
  190. [in] IUnknown *punkValue);
  191. //
  192. // get an interface pointer from the table
  193. //
  194. [local]
  195. HRESULT GetInterface(
  196. [in] DWORD dwID,
  197. [out] IUnknown **ppunkValue);
  198. //
  199. // put a bool to the table
  200. //
  201. [local]
  202. HRESULT PutBool(
  203. DWORD dwID,
  204. BOOL fValue );
  205. //
  206. // get a bool from the table
  207. //
  208. HRESULT GetBool(
  209. DWORD dwID,
  210. BOOL *pfValue);
  211. //
  212. // remove a property from the property bag
  213. //
  214. [local]
  215. HRESULT RemoveProperty(
  216. [in] DWORD dwID);
  217. };
  218. [
  219. object,
  220. uuid(53f10148-afa8-11d1-862e-00c04fb960ea)
  221. ]
  222. interface INewsTreeIterator : IUnknown {
  223. //
  224. // are we at the front or back of the list? returns S_OK if we are
  225. // at the beginning or end, and S_FALSE otherwise.
  226. //
  227. [local]
  228. BOOL IsBegin();
  229. [local]
  230. BOOL IsEnd();
  231. //
  232. // go to the next or previousgroup
  233. //
  234. [local]
  235. void Next();
  236. [local]
  237. void Prev();
  238. //
  239. // get this group
  240. //
  241. [local]
  242. HRESULT Current(
  243. [out] INNTPPropertyBag **ppGroup,
  244. INntpComplete *pProtocolComplete
  245. );
  246. };
  247. [
  248. object,
  249. uuid(9d2de8dc-afc4-11d1-862e-00c04fb960ea)
  250. ]
  251. interface INewsTree : IUnknown {
  252. //
  253. // given a group ID find the matching group
  254. //
  255. [local]
  256. HRESULT FindGroupByID(
  257. [in] DWORD dwGroupID,
  258. [out] INNTPPropertyBag **ppNewsgroupProps,
  259. [in] INntpComplete *pProtocolComplete
  260. );
  261. //
  262. // given a group name find the matching group. if the group doesn't
  263. // exist and fCreateIfNotExist is set then a new group will be created.
  264. // the new group won't be available until CommitGroup() is called.
  265. // if the group is Release'd before CommitGroup was called then it
  266. // won't be added.
  267. //
  268. [local]
  269. HRESULT FindOrCreateGroupByName(
  270. [in] LPSTR pszGroupName,
  271. [in] BOOL fCreateIfNotExist,
  272. [out] INNTPPropertyBag **ppNewsgroupProps,
  273. [in] INntpComplete *pProtocolComplete,
  274. [in] GROUPID groupid,
  275. [in] BOOL fSetGroupId
  276. );
  277. //
  278. // add a new group to the newstree
  279. //
  280. [local]
  281. HRESULT CommitGroup(
  282. [in] INNTPPropertyBag *pNewsgroupProps
  283. );
  284. //
  285. // remove an entry
  286. //
  287. [local]
  288. HRESULT RemoveGroupByID(
  289. [in] DWORD dwGroupID);
  290. [local]
  291. HRESULT RemoveGroupByName(
  292. [in] LPSTR pszGroupName,
  293. [in] LPVOID lpContext);
  294. //
  295. // enumerate across the list of keys.
  296. //
  297. [local]
  298. HRESULT GetIterator(
  299. [out] INewsTreeIterator **punkIterator
  300. // BUGBUG -- need to add filtering options
  301. );
  302. //
  303. // this function will be used by drivers to make sure that they
  304. // are adding newsgroups that they properly own.
  305. //
  306. HRESULT LookupVRoot([in] LPSTR pszGroup,
  307. [out] INntpDriver **ppDriver);
  308. //
  309. // Get a pointer to the owning server object
  310. //
  311. [local]
  312. HRESULT GetNntpServer(
  313. [out] INntpServer **ppNntpServer
  314. );
  315. };
  316. //
  317. // IIS side completion object interface
  318. //
  319. [
  320. object,
  321. uuid(5EFC52FC-EADF-11d1-9212-00C04FA322A5),
  322. helpstring("INntpComplete Interface"),
  323. ]
  324. interface INntpComplete : IUnknown
  325. {
  326. // This is the base interface for all IIS side completion
  327. // objects. The base interface has only one interface
  328. // method: SetResult. This method may be overwritten by
  329. // derived class methods to carry out different implementation
  330. // for different completions.
  331. [local] void
  332. SetResult( [in] HRESULT hr );
  333. [local] void
  334. ReleaseBag( INNTPPropertyBag *pPropBag );
  335. };
  336. //
  337. // -------------- Interfaces implemented by the Driver --------------
  338. //
  339. //
  340. // Driver implementaion interface that implements actual
  341. // driver functionality.
  342. // Returned by INntpDriverPrepare after successfully connected
  343. // to Exchange store.
  344. //
  345. [
  346. object,
  347. uuid(ADD1050F-99C5-11D1-9128-00C04FC30A64),
  348. helpstring("INntpDriver Interface"),
  349. ]
  350. interface INntpDriver : IUnknown
  351. {
  352. typedef DWORD ARTICLEID;
  353. ///////////////////////////////////////////////////////////////////////////
  354. // ***** initialize, terminate, config methods:
  355. ///////////////////////////////////////////////////////////////////////////
  356. // Purpose:
  357. // Initialize the driver
  358. // Parameters:
  359. // pszVRootPath - virtual root path this driver interface maps to
  360. // ie. Nntpsvc/1/root/alt
  361. // pLookup - a pointer to the server's ILookup interface
  362. // pNewsTree - a pointer to the server's INewsTree interface
  363. // pdwNDS - Return status of current NNTP driver after Initialize()
  364. // Comments:
  365. // o Register change notification (ie directory pickup)
  366. // o Initialize Epoxy (once per Exchange store type)
  367. // o Detect if the other side of NNTP DLL is running (Exchange only)
  368. // o Initialize other global objects/interfaces (such as IMAIL, Async lib, etc)
  369. // o strVRootPath to obtain directory path (FS) or store name (Exchange) from VRoot
  370. // o Ilookup and InewsTree services are for notification operations on the store
  371. // as well as expiration.
  372. // o From metabase retrieve expiration policy
  373. // o Setup expiration
  374. // o WHAT OTHER PARAMETERS NEEDED/TASKS PERFORMED HERE - POSSIBLY:
  375. // o May setup metabase change notification to pickup expiration policy changes
  376. [local] HRESULT
  377. Initialize( [in] LPCWSTR pszVRootPath,
  378. [in] LPCSTR pszGroupPrefix,
  379. [in] IUnknown *punkMetabase,
  380. [in] INntpServer *pServer,
  381. [in] INewsTree *pINewsTree,
  382. [in] LPVOID lpvContext,
  383. [out] DWORD *pdwNDS,
  384. [in] HANDLE hToken );
  385. // Purpose:
  386. // Detach the driver from protocol and cleanup
  387. // Parameters:
  388. // None
  389. // Comments:
  390. // o Un-register change notification.
  391. // o Un-initialize Epoxy, if last driver interface pointer to Terminate()
  392. // o Terminate expiration
  393. // o Other tasks?
  394. HRESULT
  395. Terminate( [out] DWORD *pdwNDS );
  396. // Purpose:
  397. // Get the status of current NNTP driver
  398. // Parameters:
  399. // pdwNDS - NNTP_DRIVER_STATUS code
  400. // Comments:
  401. // o Used to get status of current NNTP driver, include:
  402. // STORE_UP, STORE_DOWN, EPOXY_ERROR, etc
  403. HRESULT
  404. GetDriverStatus( [out] DWORD *pdwNDS );
  405. ///////////////////////////////////////////////////////////////////////////
  406. // ***** store change notification process method
  407. ///////////////////////////////////////////////////////////////////////////
  408. // Purpose:
  409. // Handle change notification from the store
  410. // Parameters:
  411. // punkSOCChangeList - List of changes originated from store
  412. // Comment
  413. // o Serve as change notification process function dispatcher
  414. // o Owns a list of changes coming from the store
  415. HRESULT
  416. StoreChangeNotify( [in] IUnknown *punkSOCChangeList );
  417. ///////////////////////////////////////////////////////////////////////////
  418. // ***** article posting methods:
  419. ///////////////////////////////////////////////////////////////////////////
  420. // Purpose:
  421. // Commit the post
  422. // Parameters:
  423. // See separate spec from awetmore
  424. // Returned error code from completion object:
  425. // S_OK - Success
  426. // HRESULT_FROM_WIN32( ERROR_FILE_NOT_FOUND ) - Group Access Check Failed because file ( directory ) doesn't exist
  427. // HRESULT_FROM_WIN32( ERROR_PATH_NOT_FOUND ) - Group doesn't physically exist ( during CreateFile )
  428. // HRESULT_FROM_WIN32( ERROR_FILE_EXISTS) - The article with the same article id physically exists ( during CreateFile )
  429. // HRESULT_FROM_WIN32( ERROR_ACCESS_DENIED ) - Access Denied
  430. // Other - Other fatal errors that might cause UnsafeClose();
  431. // Note:
  432. // This also applies to AllocMessage. Since we have no access to IMailMsg
  433. // IDL file, it's doc'd here
  434. [local] void
  435. CommitPost( [in] IUnknown *punkMessage, // IMsg pointer
  436. [in] STOREID *pStoreId,
  437. [in] STOREID *rgOtherStoreIDs,
  438. [in] HANDLE hToken,
  439. [in] INntpComplete *pICompletion,
  440. [in] BOOL fAnonymous );
  441. ///////////////////////////////////////////////////////////////////////////
  442. // ***** article retrieval, delete methods (ARTICLE, BODY, HEAD, etc):
  443. ///////////////////////////////////////////////////////////////////////////
  444. // Purpose:
  445. // Gets an article from the store
  446. // Parameters:
  447. // pNewsGroup - The INewsGroup where article is posted to
  448. // artId - Article ID for this article
  449. // StoreId - STOREID for this article
  450. // It contains FID/MID for Exchange store, but nothing for FS.
  451. // hFile - File handle for the article
  452. // Comment:
  453. // o FS uses pNewsGroup and artId to retrieve articles, no need for StoreId
  454. // o Exchange needs StoreId to give a pair of FID/MID
  455. // o If no FID/MID is found, get group properties from pNewsGroup and try
  456. // to retrieve article by article number.
  457. // o Return an hFile - NEED TO COMEUP WITH AN ASYNC MODEL.
  458. // Return value from completion object:
  459. // o S_OK - Succeeded
  460. // o HRESULT_FROM_WIN32( ERROR_FILE_NOT_FOUND ) - Article doesn't exist
  461. // o HRESULT_FROM_WIN32( ERROR_PATH_NOT_FOUND ) - Group doesn't exist
  462. // o E_ACCESSDENIED - Access denied
  463. // o OTHER: Fatal server error
  464. [local] void
  465. GetArticle( [in] INNTPPropertyBag *pPrimaryGroup,
  466. [in] INNTPPropertyBag *pCurrentGroup,
  467. [in] ARTICLEID PrimaryArtId,
  468. [in] ARTICLEID CurrentArtId,
  469. [in] STOREID StoreId,
  470. [in] HANDLE hToken,
  471. [out] void **pvFileHandleContext,
  472. [in] INntpComplete *pICompletion,
  473. [in] BOOL fAnonymous );
  474. // Purpose:
  475. // This is called when the protocol needs to cancel an article
  476. // Parameters:
  477. // pGroupBag - Group property bag
  478. // cArticles - Number of articles to delete
  479. // rgidArt - Array of article id's to delete ( used by exdriver )
  480. // rgidStore - Array of store id's to delete ( used by fsdriver )
  481. // hToken - Client's access token
  482. // piFailed - To return the index into article array of the first
  483. // failed article
  484. // pICompletion - Completion object
  485. // Return value in completion object:
  486. // S_OK - Succeeded
  487. // S_FASLE - Succeeded but protocol has asked to delete too many
  488. // but the driver can not take them all, see pdwLastSuccess
  489. // for the last successfully deleted article
  490. // NNTP_E_PARTIAL_COMPLETE - No error, but not all messages are deleted
  491. // deletion partly failed in store
  492. // Otherwise, Failed
  493. [local] void
  494. DeleteArticle( [in] INNTPPropertyBag *pGroupBag,
  495. [in] DWORD cArticles,
  496. [in] ARTICLEID rgidArt[],
  497. [in] STOREID rgidStore[],
  498. [in] HANDLE hToken,
  499. [out] DWORD *pdwLastSuccess,
  500. [in] INntpComplete *pICompletion,
  501. [in] BOOL fAnonymous );
  502. ///////////////////////////////////////////////////////////////////////////
  503. // ***** XOVER, XHDR retrieval methods:
  504. ///////////////////////////////////////////////////////////////////////////
  505. // Purpose:
  506. // Gets the XOVER information for a range of articles
  507. // Parameters:
  508. // pNewsGroup - The NewsGroup object to get XOVER data from
  509. // idMinArticle - the first article to get information for
  510. // idMaxArticle - the last article to get information for
  511. // idNextArticle - The next article id that you should start from, if you
  512. // want
  513. // pszHeader - contains a string of header to be retrieved.
  514. // ie. "Subject", "From", For Xover, may use "@Xover", where
  515. // any string started with "@" is special.
  516. // pBuffer - where to put the information (ISSUE: what type is this?
  517. // stream or char *)
  518. // cbin - size of pBuffer
  519. // cbout - total count bytes of returned XOVER data
  520. // Return value from completion object:
  521. // S_OK - Succeeded perfectly
  522. // S_FALSE - Succeeded, but:
  523. // 1. If *idNextArticle > idMaxArticle - no article found
  524. // 2. If *idNextArticle <= idMaxArticle - Buffer too small,
  525. // though some entries have been filled
  526. // HRESULT_FROM_WIN32( ERROR_INSUFFICIENT_BUFFER )
  527. // - Buffer too small, even first article can not be filled
  528. // Other - Other fatal error
  529. [local] void
  530. GetXover( [in] INNTPPropertyBag *pGroupPropBag,
  531. [in] ARTICLEID idMinArticle,
  532. [in] ARTICLEID idMaxArticle,
  533. [out] ARTICLEID *idNextArticle,
  534. [out] CHAR* pBuffer,
  535. [in] DWORD cbin,
  536. [out] DWORD *cbout,
  537. [in] HANDLE hToken,
  538. [in] INntpComplete *pICompletion,
  539. [in] BOOL fAnonymous );
  540. [local] HRESULT
  541. GetXoverCacheDirectory(
  542. [in] INNTPPropertyBag* pGroupPropBag,
  543. [out] CHAR* pBuffer,
  544. [in] DWORD cbIn,
  545. [out] DWORD *pcbOut,
  546. [out] BOOL* fFlatDir
  547. ) ;
  548. // Get XHdr information from the driver - similar to GetXover
  549. [local] void
  550. GetXhdr( [in] INNTPPropertyBag *pGroupPropBag,
  551. [in] ARTICLEID idMinArticle,
  552. [in] ARTICLEID idMaxArticle,
  553. [out] ARTICLEID *idNextArticle,
  554. [in] CHAR* pszHeader,
  555. [out] CHAR* pBuffer,
  556. [in] DWORD cbin,
  557. [out] DWORD *cbOut,
  558. [in] HANDLE hToken,
  559. [in] INntpComplete *pICompletion,
  560. [in] BOOL fAnonymous );
  561. ///////////////////////////////////////////////////////////////////////////
  562. // ***** Store rebuild related methods:
  563. ///////////////////////////////////////////////////////////////////////////
  564. // Purpose:
  565. // Rebuild a news group: pick up every message, parse out its groups/
  566. // articleid's and use INntpServer's post interface to insert xover/
  567. // article entries. It updates group properties such as article counts,
  568. // high/low watermarks too
  569. [local] void
  570. RebuildGroup( [in] INNTPPropertyBag *pPropBag,
  571. [in] HANDLE hToken,
  572. [in] INntpComplete *pIComplete );
  573. ///////////////////////////////////////////////////////////////////////////
  574. // ***** Newsgroup manipulation methods:
  575. ///////////////////////////////////////////////////////////////////////////
  576. // Purpose:
  577. // Get properties from a group.
  578. // Parameters:
  579. // pNewsGroup - Property bag for the news group object
  580. // cProperties - Number of properties to get
  581. // rgidProperties - Array of properties to get
  582. [local] void
  583. DecorateNewsGroupObject( [in] INNTPPropertyBag *pNewsGroup,
  584. [in] DWORD cProperties,
  585. [in] DWORD *rgidProperties,
  586. [in] INntpComplete *pICompletion );
  587. // Purpose:
  588. // Check if client has desired access to this group
  589. // Parameters:
  590. // pNewsGroup - Property bag to the news group
  591. // hToken - The client's access token
  592. // dwDesiredAccess - Access rights that the client desires
  593. // pICompletion - Pointer to completion object
  594. // Return value from completion object:
  595. // S_OK - Client has access
  596. // E_ACCESSDENIED - Access denied
  597. [local] void
  598. CheckGroupAccess( [in] INNTPPropertyBag *pNewsGroup,
  599. [in] HANDLE hToken,
  600. [in] DWORD dwDesiredAccess,
  601. [in] INntpComplete *pICompletion );
  602. // Purpose:
  603. // Set Newsgroup properties into store
  604. // Parameters:
  605. // pNewsGroup - The news group property bag
  606. // cProperties - Number of properties to set
  607. // rgidProperties - Array of properties to set
  608. // pICompletion - Completion object
  609. // Return values:
  610. [local] void
  611. SetGroupProperties( [in] INNTPPropertyBag *pNewsGroup,
  612. [in] DWORD cProperties,
  613. [in] DWORD *rgidProperties,
  614. [in] HANDLE hToken,
  615. [in] INntpComplete *pICompletion,
  616. [in] BOOL fAnonymous );
  617. // Purpose:
  618. // Decorate entire INewsTree object by going to the store and get
  619. // all the necessary properties.
  620. // Parameters:
  621. // punkNewsTree - INewsTree to be decorated
  622. // hToken - hToken for the user
  623. // dwSessionKey - TCP session key
  624. // lpvCompletionObj - Completion object in protocol to handle completion
  625. // pdwNDS - NNTP driver status
  626. [local] void
  627. DecorateNewsTreeObject( [in] HANDLE hToken,
  628. [in] INntpComplete *pICompletion );
  629. // Purpose:
  630. // Create a new group in the store (newgroup)
  631. // Parameters:
  632. // pszGroupName - the group to create
  633. // Comment:
  634. // o Lookup virtual root to construct full path name using pszGroupName
  635. // o Create the directory structure with full path name
  636. [local] void
  637. CreateGroup( [in] INNTPPropertyBag* pGroupBag,
  638. [in] HANDLE hToken,
  639. [in] INntpComplete* pICompletion,
  640. [in] BOOL fAnonymous );
  641. // Purpose:
  642. // Remove a group from the store (rmgroup). This should include a file
  643. // scan operation in the store to delete all articles within the group.
  644. // This may be done the same way as MCIS 2.0, when article cleanup is
  645. // handled by expiration thread. Groups to be removed is queued up.
  646. // Parameters:
  647. // pNewsGroup - Newsgroup to be removed.
  648. [local] void
  649. RemoveGroup( [in] INNTPPropertyBag *pGroupBag,
  650. [in] HANDLE hToken,
  651. [in] INntpComplete *pICompletion,
  652. [in] BOOL fAnonymous );
  653. };
  654. //
  655. // Driver interface to establish connection to Exchange store
  656. //
  657. [
  658. object,
  659. uuid(D61569A0-D3F9-11d1-A58C-00C04FA375BA),
  660. helpstring("INntpDriverPrepare Interface"),
  661. ]
  662. interface INntpDriverPrepare : IUnknown
  663. {
  664. // Purpose:
  665. // Initialize driver specific data structure, ie Epoxy connection, etc.
  666. // Parameters:
  667. // pszVRootPath - virtual root path this driver interface maps to
  668. // ie. Nntpsvc/1/root/alt
  669. // pLookup - a pointer to the server's ILookup interface
  670. // pNewsTree - a pointer to the server's INewsTree interface
  671. // pCompletion - a pointer to the server's ICompletion interface
  672. // Comments:
  673. // o This function is async and returns to the caller without blocking.
  674. // o A seperate thread is spawned out to do any blocking operations.
  675. [local] void
  676. Connect( [in] LPCWSTR pszVRootPath,
  677. [in] LPCSTR pszGroupPrefix,
  678. [in] IUnknown *punkMetabase,
  679. [in] INntpServer* pIServer,
  680. [in] INewsTree* pINewsTree,
  681. [out] INntpDriver** ppIGoodDriver,
  682. [in] INntpComplete* pICompletion,
  683. [in] HANDLE hToken,
  684. [in] DWORD dwFlag );
  685. // Purpose:
  686. // Cancel the pending Connect request
  687. // Parameters:
  688. // None
  689. // Comments:
  690. // o Cancel any outstanding connection requests
  691. // o Other tasks?
  692. [local] HRESULT
  693. CancelConnect();
  694. };
  695. [
  696. object,
  697. uuid(9E2D8DE8-6926-11d2-9F03-00C04F8EF2F1),
  698. helpstring("INntpDriverSearch Interface")
  699. ]
  700. interface INntpDriverSearch : IUnknown
  701. {
  702. [local]
  703. void MakeSearchQuery (
  704. [in] CHAR *pszSearchString,
  705. [in] INNTPPropertyBag *pGroupBag,
  706. [in] BOOL bDeepQuery,
  707. [in] WCHAR *pwszColumns,
  708. [in] WCHAR *pwszSortOrder,
  709. [in] LCID LocaleID,
  710. [in] DWORD cMaxRows,
  711. [in] HANDLE hToken,
  712. [in] BOOL fAnonymous,
  713. [in] INntpComplete *pICompletion,
  714. [out] INntpSearchResults **pINntpSearch,
  715. [in] LPVOID lpvContext);
  716. [local]
  717. void MakeXpatQuery (
  718. [in] CHAR *pszSearchString,
  719. [in] INNTPPropertyBag *pGroupBag,
  720. [in] BOOL bDeepQuery,
  721. [in] WCHAR *pwszColumns,
  722. [in] WCHAR *pwszSortOrder,
  723. [in] LCID LocaleID,
  724. [in] DWORD cMaxRows,
  725. [in] HANDLE hToken,
  726. [in] BOOL fAnonymous,
  727. [in] INntpComplete *pICompletion,
  728. [out] INntpSearchResults **pINntpSearch,
  729. [out] DWORD *pLowArticleID,
  730. [out] DWORD *pHighArticleID,
  731. [in] LPVOID lpvContext);
  732. [local]
  733. BOOL UsesSameSearchDatabase(
  734. [in] INntpDriverSearch *pDriver,
  735. [in] LPVOID lpvContext
  736. );
  737. [local]
  738. void GetDriverInfo(
  739. [out] GUID *pDriverGUID,
  740. [out] void **ppvDriverInfo,
  741. [in] LPVOID lpvContext
  742. );
  743. };
  744. [
  745. object,
  746. uuid(b72a754e-746c-11d2-9f04-00c04f8ef2f1),
  747. helpstring("INntpSearch Interface")
  748. ]
  749. interface INntpSearchResults : IUnknown
  750. {
  751. [local]
  752. void GetResults (
  753. [in,out] DWORD *pcResults,
  754. [out] BOOL *pfMore,
  755. [out] WCHAR **pGroupName,
  756. [out] DWORD *pdwArticleID,
  757. [in] INntpComplete *pICompletion,
  758. [in] HANDLE hToken,
  759. [in] BOOL fAnonymous,
  760. [in] LPVOID lpvContext);
  761. };
  762. [
  763. uuid(ADD104FE-99C5-11D1-9128-00C04FC30A64),
  764. version(1.0),
  765. helpstring("inntpdrv 1.0 Type Library")
  766. ]
  767. library INNTPDRVLib
  768. {
  769. importlib("stdole2.tlb");
  770. [
  771. uuid(ADD10510-99C5-11D1-9128-00C04FC30A64),
  772. helpstring("NntpDriverPrepare Class")
  773. ]
  774. coclass NntpDriverPrepare
  775. {
  776. [default] interface INntpDriverPrepare;
  777. };
  778. };