Source code of Windows XP (NT5)
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.

2428 lines
59 KiB

  1. /*++
  2. Copyright (c) 1994-1998 Microsoft Corporation
  3. Module Name :
  4. inetmgr.h
  5. Abstract:
  6. Main program object and class definitions
  7. Author:
  8. Ronald Meijer (ronaldm)
  9. Project:
  10. Internet Services Manager
  11. Revision History:
  12. --*/
  13. #ifndef _INETMGR_H_
  14. #define _INETMGR_H_
  15. #ifndef __AFXWIN_H__
  16. #error include 'stdafx.h' before including this file for PCH
  17. #endif
  18. #include <lmcons.h>
  19. #include <wtypes.h>
  20. #include <iis64.h>
  21. extern "C"
  22. {
  23. typedef unsigned hyper ULONGLONG;
  24. #include "svcloc.h"
  25. }
  26. #include "comprop.h"
  27. #include "svrinfo.h"
  28. #include "resource.h" // main symbols
  29. LPOLESTR
  30. CoTaskDupString(
  31. IN LPCOLESTR szString
  32. );
  33. #define CoTaskStringFree(szString)\
  34. if (szString) CoTaskMemFree(szString);
  35. HRESULT
  36. BuildResURL(
  37. OUT CString & str,
  38. IN HINSTANCE hSourceInstance = (HINSTANCE)-1
  39. );
  40. struct INTERNAL
  41. /*++
  42. Routine Description:
  43. Internal information structure. This is used to get the private information
  44. from the data object.
  45. Public Interface:
  46. INTERNAL : Constructor
  47. ~INTERNAL : Destructor
  48. --*/
  49. {
  50. INTERNAL()
  51. : m_type(CCT_UNINITIALIZED),
  52. m_cookie(-1)
  53. {
  54. ::ZeroMemory(&m_clsid, sizeof(CLSID));
  55. };
  56. ~INTERNAL() {}
  57. DATA_OBJECT_TYPES m_type; // What context is the data object.
  58. MMC_COOKIE m_cookie; // What object the cookie represents
  59. CString m_string; //
  60. CLSID m_clsid; // Class ID of who created this data object
  61. INTERNAL & operator=(const INTERNAL& rhs)
  62. {
  63. if (&rhs == this)
  64. {
  65. return *this;
  66. }
  67. //
  68. // Deep copy the information
  69. //
  70. m_type = rhs.m_type;
  71. m_cookie = rhs.m_cookie;
  72. m_string = rhs.m_string;
  73. CopyMemory(&m_clsid, &rhs.m_clsid, sizeof(CLSID));
  74. return *this;
  75. }
  76. BOOL operator==(const INTERNAL& rhs) { return rhs.m_string == m_string; }
  77. };
  78. //
  79. // Menu Commands, listed in toolbar order.
  80. //
  81. // IMPORTANT! -- this must be kept in sync with MenuItemDefs
  82. // in iisobj.cpp
  83. //
  84. enum
  85. {
  86. IDM_INVALID, /* invalid command ID */
  87. IDM_CONNECT,
  88. IDM_DISCOVER,
  89. IDM_START,
  90. IDM_STOP,
  91. IDM_PAUSE,
  92. /**/
  93. IDM_TOOLBAR /* Toolbar commands start here */
  94. };
  95. //
  96. // Additional menu commands that do not show up in the toolbar
  97. //
  98. enum
  99. {
  100. IDM_EXPLORE = IDM_TOOLBAR,
  101. IDM_OPEN,
  102. IDM_BROWSE,
  103. IDM_CONFIGURE,
  104. IDM_DISCONNECT,
  105. IDM_METABACKREST,
  106. IDM_SHUTDOWN,
  107. IDM_NEW_VROOT,
  108. IDM_NEW_INSTANCE,
  109. IDM_VIEW_TASKPAD,
  110. IDM_TASK_SECURITY_WIZARD,
  111. //
  112. // Don't move this last one -- it will be used
  113. // as an offset for service specific new instance
  114. // commands
  115. //
  116. IDM_NEW_EX_INSTANCE
  117. };
  118. //
  119. // Background colour mask of our own toolbar bitmaps.
  120. //
  121. #define TB_COLORMASK RGB(192,192,192) // Lt. Gray
  122. //
  123. // Default discovery wait time
  124. //
  125. #define DEFAULT_WAIT_TIME (30000L) // 30 seconds
  126. class CServiceInfo : public CObjectPlus
  127. /*++
  128. Class Description:
  129. Service info descriptor class. This is used for downlevel ISM objects.
  130. Public Interface:
  131. CServiceInfo : Constructor
  132. ~CServiceInfo : Destructor
  133. QueryInstanceHandle : Get the instance handle of the config dll
  134. for this service
  135. QueryISMVersion : Get the ISM version the config DLL was written
  136. for.
  137. QueryDiscoveryMask : Get the inetsloc discovery mask
  138. QueryButtonBkMask : Get the background mask for the toolbar button
  139. QueryButtonBitmapID : Get the toolbar button resource ID
  140. QueryServiceBkMask : Get the background mask for the view
  141. QueryServiceBitmapID : Get the view bitmap resource ID
  142. QueryServiceID : Get the service ID assigned to this service
  143. GetShortName : Get the short name of the service
  144. GetLongName : Get the full name of the service
  145. UseInetSlocDiscover : TRUE if the service uses inetsloc discovery
  146. CanControlService : TRUE if the service is controllable
  147. CanPauseService : TRUE if the service is pausable
  148. UseNormalColorMapping : TRUE if normal colour mapping should be used
  149. SupportsInstances : TRUE if the service has instances
  150. SupportsChildren : TRUE if the service has children
  151. UnderstandsInstanceCodes : TRUE if instance ID codes are understood.
  152. HasWebProtocol : TRYE if the service supports a web protocol name
  153. IsSelected : TRUE if the service type is selected in the
  154. toolbar.
  155. SelectService : Set the selection state of the service
  156. QueryReturnCode : Get the error return code of the service
  157. InitializedOK : TRUE if the service config DLL was initialized
  158. OK.
  159. ISMQueryServiceInfo : Call the query service info API
  160. ISMDiscoverServers : Call the discover servers API
  161. ISMQueryServerInfo : Call the query server info API
  162. ISMChangeServiceState : Call the change service state API
  163. ISMConfigureServers : Call the configure server API
  164. ISMEnumerateInstances : Call the enumerate instances API
  165. ISMConfigureChild : Call the configure child API
  166. --*/
  167. {
  168. protected:
  169. //
  170. // ISM Method prototype
  171. //
  172. typedef HRESULT (APIENTRY * pfnISMMethod)(...);
  173. //
  174. // ISM Method Definition
  175. //
  176. typedef struct tagISM_METHOD_DEF
  177. {
  178. int iID;
  179. BOOL fMustHave;
  180. LPCSTR lpszMethodName;
  181. } ISM_METHOD_DEF;
  182. //
  183. // VTable entry IDs
  184. //
  185. enum
  186. {
  187. ISM_QUERY_SERVICE_INFO,
  188. ISM_DISCOVER_SERVERS,
  189. ISM_QUERY_SERVER_INFO,
  190. ISM_CHANGE_SERVICE_STATE,
  191. ISM_CONFIGURE,
  192. ISM_BIND,
  193. ISM_UNBIND,
  194. ISM_CONFIGURE_CHILD,
  195. ISM_ENUMERATE_INSTANCES,
  196. ISM_ENUMERATE_CHILDREN,
  197. ISM_ADD_INSTANCE,
  198. ISM_DELETE_INSTANCE,
  199. ISM_ADD_CHILD,
  200. ISM_DELETE_CHILD,
  201. ISM_RENAME_CHILD,
  202. ISM_QUERY_INSTANCE_INFO,
  203. ISM_QUERY_CHILD_INFO,
  204. ISM_MMC_CONFIGURE,
  205. ISM_MMC_CONFIGURE_CHILD,
  206. ISM_SECURITY_WIZARD,
  207. /* Don't move this one */
  208. ISM_NUM_METHODS
  209. };
  210. //
  211. // ISM Method VTable Definition
  212. //
  213. static ISM_METHOD_DEF s_imdMethods[ISM_NUM_METHODS];
  214. //
  215. // Construction/Destruction
  216. //
  217. public:
  218. //
  219. // Construct with DLL Name and a sequential unique
  220. // ID Number.
  221. //
  222. CServiceInfo(
  223. IN int nID,
  224. IN LPCTSTR lpDLLName
  225. );
  226. ~CServiceInfo();
  227. //
  228. // Access Functions
  229. //
  230. public:
  231. //
  232. // Get the instance handle
  233. //
  234. HINSTANCE QueryInstanceHandle() const { return m_hModule; }
  235. //
  236. // Get the ISM version number
  237. //
  238. DWORD QueryISMVersion() const { return m_si.dwVersion; }
  239. //
  240. // Get the discovery mask
  241. //
  242. ULONGLONG QueryDiscoveryMask() const { return m_si.ullDiscoveryMask; }
  243. //
  244. // Get toolbar background button mask for this service
  245. //
  246. COLORREF QueryButtonBkMask() const { return m_si.rgbButtonBkMask; }
  247. //
  248. // Get toolbar button bitmap id for this service
  249. //
  250. UINT QueryButtonBitmapID() const { return m_si.nButtonBitmapID; }
  251. //
  252. // Get the colour background mask for this service
  253. //
  254. COLORREF QueryServiceBkMask() const { return m_si.rgbServiceBkMask; }
  255. //
  256. // Get the resource ID for the service bitmap for this service
  257. //
  258. UINT QueryServiceBitmapID() const { return m_si.nServiceBitmapID; }
  259. //
  260. // Return TRUE if the service has 32x32 bitmap id
  261. //
  262. BOOL HasLargeServiceBitmapID() const { return m_si.nLargeServiceBitmapID != 0; }
  263. //
  264. // Get the large service bitmap background colour mask
  265. //
  266. COLORREF QueryLargeServiceBkMask() const { return m_si.rgbLargeServiceBkMask; }
  267. //
  268. // Get the resource ID of the large service bitmap
  269. //
  270. UINT QueryLargeServiceBitmapID() const { return m_si.nLargeServiceBitmapID; }
  271. //
  272. // Get the colour background mask for the child bitmap
  273. //
  274. COLORREF QueryChildBkMask() const { return m_si.rgbChildBkMask; }
  275. //
  276. // Get the bitmap ID for a child node
  277. //
  278. UINT QueryChildBitmapID() const { return m_si.nChildBitmapID; }
  279. //
  280. // Get the background colour mask for the large child bitmap
  281. //
  282. COLORREF QueryLargeChildBkMask() const { return m_si.rgbLargeChildBkMask; }
  283. //
  284. // Get the resource ID for the large child bitmap
  285. //
  286. UINT QueryLargeChildBitmapID() const { return m_si.nLargeChildBitmapID; }
  287. //
  288. // Get the ID assigned to this service
  289. //
  290. int QueryServiceID() const { return m_nID; }
  291. //
  292. // Get the short name for this service
  293. //
  294. LPCTSTR GetShortName() const { return m_si.atchShortName; }
  295. //
  296. // Get the longer name for this service
  297. //
  298. LPCTSTR GetLongName() const { return m_si.atchLongName; }
  299. //
  300. // Get the protocol for this service (if any)
  301. //
  302. LPCTSTR GetProtocol() const { return m_si.atchProtocol; }
  303. //
  304. // Get the metabase service name (if any)
  305. //
  306. LPCTSTR GetMetabaseName() const { return m_si.atchMetaBaseName; }
  307. //
  308. // Access Service Type Functions
  309. //
  310. public:
  311. //
  312. // TRUE if the service is a downlevel replacement service
  313. //
  314. BOOL RequiresSuperDll() const { return !m_strSupDLLName.IsEmpty(); }
  315. BOOL IsSuperDllFor(CServiceInfo * pTarget) const;
  316. BOOL HasSuperDll() const { return m_psiMaster != NULL; }
  317. void AssignSuperDll(CServiceInfo * pTarget);
  318. CServiceInfo * GetSuperDll();
  319. LPCTSTR QueryDllName() const { return m_strDLLName; }
  320. BOOL UseInetSlocDiscover() const;
  321. //
  322. // Return TRUE if the service is controllable
  323. //
  324. BOOL CanControlService() const;
  325. //
  326. // Return TRUE if the service is pausable
  327. //
  328. BOOL CanPauseService() const;
  329. //
  330. // Return TRUE if the service and toolbar bitmaps use default
  331. // background colour mapping (the background colour masks
  332. // will be ignored)
  333. //
  334. BOOL UseNormalColorMapping() const;
  335. //
  336. // True if the service supports file and directory properties
  337. //
  338. BOOL SupportsFileSystem() const;
  339. //
  340. // Does the service support Instances
  341. //
  342. BOOL SupportsInstances() const;
  343. //
  344. // Does the service support children
  345. //
  346. BOOL SupportsChildren() const;
  347. //
  348. // TRUE if the service supports the security wizard
  349. //
  350. BOOL SupportsSecurityWizard() const;
  351. //
  352. // Does the service understance instance ID codes
  353. // -- eventhough it may not actually support
  354. // instances
  355. //
  356. BOOL UnderstandsInstanceCodes() const;
  357. //
  358. // TRUE if the service supports prot://address browsing
  359. //
  360. BOOL HasWebProtocol() const;
  361. //
  362. // Use MMC property pages to show the property sheet for this
  363. // service?
  364. //
  365. BOOL SupportsMMC() const;
  366. //
  367. // Does the service support the extended K2 services?
  368. //
  369. BOOL IsK2Service() const;
  370. //
  371. // Is this service currently selected to be in
  372. // the service view?
  373. //
  374. BOOL IsSelected() const { return m_fIsSelected; }
  375. //
  376. // Select/Deselect this service
  377. //
  378. void SelectService(
  379. IN BOOL fSelected = TRUE
  380. );
  381. //
  382. // Get error return code
  383. //
  384. HRESULT QueryReturnCode() const { return m_hrReturnCode; }
  385. //
  386. // Was the module loaded, and all function ptrs initialised?
  387. //
  388. BOOL InitializedOK() const { return SUCCEEDED(m_hrReturnCode); }
  389. //
  390. // The bitmap indices refer to the index in inetmgr's
  391. // master image list where they are stored, and have nothing
  392. // to do with the resource IDs
  393. //
  394. public:
  395. //
  396. // Get the inetmgr assigned index for the service bitmap
  397. //
  398. int QueryBitmapIndex() const { return m_iBmpID; }
  399. //
  400. // Get the inetmgr assigned index for the child
  401. //
  402. int QueryChildBitmapIndex() const { return m_iBmpChildID; }
  403. //
  404. // Assign the service bitmap index
  405. //
  406. void SetBitmapIndex(IN int iID);
  407. //
  408. // Assign the child bitmap index
  409. //
  410. void SetChildBitmapIndex(IN int iID);
  411. //
  412. // ISM API Functions
  413. //
  414. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  415. public:
  416. //
  417. // Return service-specific information back to
  418. // to the application. This function is called
  419. // by the service manager immediately after
  420. // LoadLibary();
  421. //
  422. DWORD ISMQueryServiceInfo(
  423. OUT ISMSERVICEINFO * psi // Service information returned.
  424. );
  425. //
  426. // Perform a discovery (if not using inetsloc discovery)
  427. // The application will call this API the first time with
  428. // a BufferSize of 0, which should return the required buffer
  429. // size. Next it will attempt to allocate a buffer of that
  430. // size, and then pass a pointer to that buffer to the api.
  431. //
  432. DWORD ISMDiscoverServers(
  433. OUT ISMSERVERINFO * psi, // Server info buffer.
  434. IN OUT DWORD * pdwBufferSize, // Size required/available.
  435. OUT int * cServers // Number of servers in buffer.
  436. );
  437. //
  438. // Get information on a single server with regards to
  439. // this service.
  440. //
  441. DWORD ISMQueryServerInfo(
  442. IN LPCTSTR lpszServerName, // Name of server.
  443. OUT ISMSERVERINFO * psi // Server information returned.
  444. );
  445. //
  446. // Change the state of the service (started, stopped, paused) for the
  447. // listed servers.
  448. //
  449. DWORD ISMChangeServiceState(
  450. IN int nNewState, // INetService* definition.
  451. OUT int * pnCurrentState, // Current state information
  452. IN DWORD dwInstance, // /* K2 */ -- Instance number
  453. // (0 - for non-instance)
  454. IN LPCTSTR lpszServers // Double NULL terminated list of servers.
  455. );
  456. //
  457. // The big-one: Show the configuration dialog or
  458. // property sheets, whatever, and allow the user
  459. // to make changes as needed.
  460. //
  461. DWORD ISMConfigureServers(
  462. IN HWND hWnd, // Main app window handle
  463. IN DWORD dwInstance, // /* K2 */ -- Instance number
  464. // (0 - for non-instance)
  465. IN LPCTSTR lpszServers // Double NULL terminated list of servers
  466. );
  467. ///////////////////////////////////////////////////////////////////////////
  468. // //
  469. // K2 Methods Below //
  470. // //
  471. ///////////////////////////////////////////////////////////////////////////
  472. //
  473. // Bind to a server, and return a HANDLE. This handle is
  474. // merely an opaque identifier that's meaningful to the
  475. // service configuration module.
  476. //
  477. HRESULT ISMBind(
  478. IN LPCTSTR lpszServer, // Server name
  479. OUT HANDLE *phServer // Returns handle
  480. );
  481. //
  482. // Sever the connection. The service configuration
  483. // module does whatever needs to be done to cleanup
  484. //
  485. HRESULT ISMUnbind(
  486. IN HANDLE hServer // Server handle
  487. );
  488. //
  489. // Enumerate instances
  490. //
  491. HRESULT ISMEnumerateInstances(
  492. IN HANDLE hServer, // Server handle
  493. IN OUT ISMINSTANCEINFO * pii, // Instance info buffer
  494. IN OUT HANDLE * pdwEnum // Enumeration handle
  495. );
  496. //
  497. // Add an instance
  498. //
  499. HRESULT ISMAddInstance(
  500. IN HANDLE hServer, // Server handle
  501. IN DWORD dwSourceInstance, // Source instance ID to clone
  502. OUT ISMINSTANCEINFO * pii, // Instance info buffer. May be NULL
  503. IN DWORD dwBufferSize // Size of buffer
  504. );
  505. //
  506. // Delete an instance
  507. //
  508. HRESULT ISMDeleteInstance(
  509. IN HANDLE hServer, // Server handle
  510. IN DWORD dwInstance // Instance to be deleted
  511. );
  512. //
  513. // Get instance specific information.
  514. //
  515. HRESULT ISMQueryInstanceInfo(
  516. IN HANDLE hServer, // Server handle
  517. IN BOOL fInherit, // TRUE to inherit, FALSE otherwise
  518. OUT ISMINSTANCEINFO * pii, // Instance info buffer
  519. IN DWORD dwInstance // Instance number
  520. );
  521. //
  522. // Enumerate children.
  523. //
  524. HRESULT ISMEnumerateChildren(
  525. IN HANDLE hServer, // Server handle
  526. IN OUT ISMCHILDINFO * pii, // Child info buffer
  527. IN OUT HANDLE * phEnum, // Enumeration handle
  528. IN DWORD dwInstance, // Instance
  529. IN LPCTSTR lpszParent // Parent path
  530. );
  531. //
  532. // Add a child
  533. //
  534. HRESULT ISMAddChild(
  535. IN HANDLE hServer, // Server handle
  536. OUT ISMCHILDINFO * pii, // Child info buffer
  537. IN DWORD dwBufferSize, // Size of info buffer
  538. IN DWORD dwInstance, // Parent instance
  539. IN LPCTSTR lpszParent // Parent path
  540. );
  541. //
  542. // Delete a child
  543. //
  544. HRESULT ISMDeleteChild(
  545. IN HANDLE hServer, // Server handle
  546. IN DWORD dwInstance, // Parent instance
  547. IN LPCTSTR lpszParent, // Parent path
  548. IN LPCTSTR lpszAlias // Alias of child to be deleted
  549. );
  550. //
  551. // Rename a child
  552. //
  553. HRESULT ISMRenameChild(
  554. IN HANDLE hServer, // Server handle
  555. IN DWORD dwInstance, // Parent instance
  556. IN LPCTSTR lpszParent, // Parent path
  557. IN LPCTSTR lpszAlias, // Alias of child to be renamed
  558. IN LPCTSTR lpszNewName // New alias of child
  559. );
  560. //
  561. // Configure Child
  562. //
  563. HRESULT ISMConfigureChild(
  564. IN HANDLE hServer, // Server handle
  565. IN HWND hWnd, // Main app window handle
  566. IN DWORD dwAttributes, // Child attributes
  567. IN DWORD dwInstance, // Parent instance
  568. IN LPCTSTR lpszParent, // Parent path
  569. IN LPCTSTR lpszAlias // Child alias
  570. );
  571. //
  572. // Get child-specific info
  573. //
  574. HRESULT ISMQueryChildInfo(
  575. IN HANDLE hServer, // Server handle
  576. IN BOOL fInherit, // TRUE to inherit, FALSE otherwise
  577. OUT ISMCHILDINFO * pii, // Child info buffer
  578. IN DWORD dwInstance, // Parent instance
  579. IN LPCTSTR lpszParent, // Parent Path ("" for root)
  580. IN LPCTSTR lpszAlias // Alias of child to be deleted
  581. );
  582. //
  583. // Configure servers using MMC property pages
  584. //
  585. HRESULT ISMMMCConfigureServers(
  586. IN HANDLE hServer, // Server handle
  587. IN PVOID lpfnProvider, // MMC Parameter
  588. IN LPARAM param, // MMC Parameter
  589. IN LONG_PTR handle, // MMC Parameter
  590. IN DWORD dwInstance // Instance number
  591. );
  592. //
  593. // Configure Child using MMC property pages
  594. //
  595. HRESULT ISMMMCConfigureChild(
  596. IN HANDLE hServer, // Server handle
  597. IN PVOID lpfnProvider, // MMC Parameter
  598. IN LPARAM param, // MMC Parameter
  599. IN LONG_PTR handle, // MMC Parameter
  600. IN DWORD dwAttributes, // Child attributes
  601. IN DWORD dwInstance, // Parent instance
  602. IN LPCTSTR lpszParent, // Parent path
  603. IN LPCTSTR lpszAlias // Child alias
  604. );
  605. //
  606. // Launch security wizard
  607. //
  608. HRESULT ISMSecurityWizard(
  609. HANDLE hServer, // Server handle
  610. DWORD dwInstance, // Instance number
  611. LPCTSTR lpszParent, // Parent path
  612. LPCTSTR lpszAlias // Child alias name
  613. );
  614. //
  615. // Function Pointers
  616. //
  617. protected:
  618. #ifdef USE_VTABLE
  619. //
  620. // ISM Method VTable
  621. //
  622. pfnISMMethod m_rgpfnISMMethods[ISM_NUM_METHODS];
  623. #else // !USE_VTABLE
  624. //
  625. // ISM Api Function pointers
  626. //
  627. pfnQueryServiceInfo m_pfnQueryServiceInfo;
  628. pfnDiscoverServers m_pfnDiscoverServers;
  629. pfnQueryServerInfo m_pfnQueryServerInfo;
  630. pfnChangeServiceState m_pfnChangeServiceState;
  631. pfnConfigure m_pfnConfigure;
  632. pfnBind m_pfnBind;
  633. pfnUnbind m_pfnUnbind;
  634. pfnConfigureChild m_pfnConfigureChild;
  635. pfnEnumerateInstances m_pfnEnumerateInstances;
  636. pfnEnumerateChildren m_pfnEnumerateChildren;
  637. pfnAddInstance m_pfnAddInstance;
  638. pfnDeleteInstance m_pfnDeleteInstance;
  639. pfnAddChild m_pfnAddChild;
  640. pfnDeleteChild m_pfnDeleteChild;
  641. pfnRenameChild m_pfnRenameChild;
  642. pfnQueryInstanceInfo m_pfnQueryInstanceInfo;
  643. pfnQueryChildInfo m_pfnQueryChildInfo;
  644. pfnISMMMCConfigureServers m_pfnISMMMCConfigureServers;
  645. pfnISMMMCConfigureChild m_pfnISMMMCConfigureChild;
  646. pfnISMSecurityWizard m_pfnISMSecurityWizard;
  647. #endif // USE_VTABLE
  648. protected:
  649. static LPCTSTR s_cszSupcfg;
  650. protected:
  651. CServiceInfo * m_psiMaster;
  652. private:
  653. int m_nID; // Service ID
  654. int m_iBmpID; // Bitmap ID index
  655. int m_iBmpChildID; // Child bitmap ID index
  656. CString m_strDLLName; // DLL Name
  657. CString m_strSupDLLName; // Superceed configuration DLL name.
  658. ISMSERVICEINFO m_si; // Service Info.
  659. HINSTANCE m_hModule; // Library handle
  660. HRESULT m_hrReturnCode;
  661. BOOL m_fIsSelected;
  662. };
  663. class CNewInstanceCmd : public CObjectPlus
  664. /*++
  665. Class Description:
  666. New instance command object. MMC adds these items at the machine
  667. node level for create new.
  668. Public Interface:
  669. CNewInstanceCmd : Constructor
  670. GetServiceInfo : Get the service info object
  671. GetMenuCommand : Get the menu command that describes this object
  672. GetTTText : Get the tool tips text
  673. --*/
  674. {
  675. public:
  676. CNewInstanceCmd(
  677. IN CServiceInfo * pServiceInfo
  678. );
  679. public:
  680. CServiceInfo * GetServiceInfo() { return m_pServiceInfo; }
  681. CString & GetMenuCommand() { return m_strMenuCommand; }
  682. CString & GetTTText() { return m_strTTText; }
  683. HINSTANCE QueryInstanceHandle();
  684. private:
  685. CServiceInfo * m_pServiceInfo;
  686. CString m_strMenuCommand;
  687. CString m_strTTText;
  688. };
  689. class CServerInfo : public CObjectPlus
  690. {
  691. /*++
  692. Class Description:
  693. Server info class. Each object describes a single server/service
  694. relationship.
  695. Public Interface:
  696. CServerInfo : Various constructors
  697. ~CServerInfo : Destructor
  698. operator= : Assignment operator
  699. CompareByServer : Comparison function to compare server names
  700. CompareByService : Comparison function to compare services
  701. operator == : Comparison operator
  702. CleanServerName : Static function to clean up a computer/hostname
  703. ConfigureServer : Configure instance on this this server
  704. ConfigureChild : Configure child on this server
  705. ChangeServiceState : Change the server or instance state
  706. QueryServerName : Return the API-suitable name
  707. QueryServerDisplayName : Get the display name of the server
  708. GetServerComment : Get the server comment
  709. GetServiceStatePtr : Get service state pointer
  710. QueryServiceState : Find out service state (running,
  711. paused, stopped, unknown)
  712. IsServiceRunning : TRUE if the service is running
  713. IsServiceStopped : TRUE if the service is stopped
  714. IsServicePaused : TRUE if the service is paused
  715. IsServiceStatusUnknown : TRUE if the service status cannot be determined
  716. IsConfigurable : TRUE if the service is configurable
  717. QueryInstanceHandle : Get the config DLL instance handle
  718. IsServiceSelected : TRUE if the service is selected in the toolbar
  719. GetServiceName : Get the (short) service name.
  720. QueryServiceID : Get ID code assigned to the config DLL
  721. CanControlService : TRUE if this service controllable
  722. CanPauseService : TRUE if this service is pausable
  723. SupportsInstances : TRUE if the service supports instances
  724. SupportsChildren : TRUE if the service supports children
  725. UnderstandsInstanceCodes : TRUE if the service understands instance IDs
  726. QueryServiceBitmapID : Get the bitmap resource ID of the service
  727. Refresh : Refresh information
  728. --*/
  729. //
  730. // Construction/Destruction
  731. //
  732. public:
  733. //
  734. // Construct with a server name. This is typically
  735. // in response to a single connection attempt.
  736. //
  737. CServerInfo(
  738. IN LPCTSTR lpszServerName, // Name of this server
  739. OUT ISMSERVERINFO * psi, // Server info
  740. IN CServiceInfo * pServiceInfo // service that found it.
  741. );
  742. //
  743. // Construct with information from the inetsloc discover
  744. // process.
  745. //
  746. CServerInfo(
  747. IN LPCSTR lpszServerName, // Name of this server
  748. IN LPINET_SERVICE_INFO lpisi, // Discovery information
  749. IN CObListPlus & oblServices // List of installed services
  750. );
  751. //
  752. // Copy constructor
  753. //
  754. CServerInfo(
  755. IN const CServerInfo &si
  756. );
  757. ~CServerInfo();
  758. //
  759. // Assignment operator
  760. //
  761. const CServerInfo & operator=(
  762. IN const CServerInfo &si
  763. );
  764. //
  765. // Comparison Functions and operators
  766. //
  767. int CompareByServer(IN CServerInfo * psi) const;
  768. //
  769. // Compare server names
  770. //
  771. BOOL MatchServerName(IN LPCTSTR lpszServerName) const;
  772. //
  773. // Compare two services
  774. //
  775. int CompareByService(IN CServerInfo * psi);
  776. //
  777. // Compare two service
  778. //
  779. BOOL operator ==(
  780. IN CServerInfo & si
  781. );
  782. public:
  783. //
  784. // Utility function to clean up a computer/hostname
  785. //
  786. static LPCTSTR CleanServerName(
  787. IN CString & str
  788. );
  789. //
  790. // Server Info Access Functions
  791. //
  792. public:
  793. //
  794. // Perform configuration on this server
  795. //
  796. DWORD ConfigureServer(
  797. IN HWND hWnd, // Window handle
  798. IN DWORD dwInstance = MASTER_INSTANCE // Instance number
  799. );
  800. //
  801. // Configure servers using MMC property pages
  802. //
  803. HRESULT MMMCConfigureServer(
  804. IN PVOID lpfnProvider, // MMC Parameter
  805. IN LPARAM param, // MMC Parameter
  806. IN LONG_PTR handle, // MMC Parameter
  807. IN DWORD dwInstance // Instance number
  808. );
  809. //
  810. // Perform configuration on a child
  811. //
  812. HRESULT ConfigureChild(
  813. IN HWND hWnd, // Window handle
  814. IN DWORD dwAttributes, // Child attributes
  815. IN DWORD dwInstance, // Parent instance
  816. IN LPCTSTR lpszParent, // Parent path
  817. IN LPCTSTR lpszAlias // Child alias
  818. );
  819. //
  820. // Perform configuration on a child using MMC property pages
  821. //
  822. HRESULT MMCConfigureChild(
  823. IN PVOID lpfnProvider, // MMC parameter
  824. IN LPARAM param, // MMC parameter
  825. IN LONG_PTR handle, // MMC parameter
  826. IN DWORD dwAttributes, // Child attributes
  827. IN DWORD dwInstance, // Instance number
  828. IN LPCTSTR lpszParent, // Parent path
  829. IN LPCTSTR lpszAlias // Child alias
  830. );
  831. //
  832. // Rename a child node
  833. //
  834. HRESULT RenameChild(
  835. IN DWORD dwInstance, // Parent instance
  836. IN LPCTSTR lpszParent, // Parent path
  837. IN LPCTSTR lpszAlias, // Alias of child to be renamed
  838. IN LPCTSTR lpszNewName // New alias of child
  839. );
  840. //
  841. // Add a child
  842. //
  843. HRESULT AddChild(
  844. IN ISMCHILDINFO * pii, // Child info buffer or NULL
  845. IN DWORD dwBufferSize, // Size of info buffer
  846. IN DWORD dwInstance, // Parent instance
  847. IN LPCTSTR lpszParent // Parent Path ("" for root)
  848. );
  849. //
  850. // Delete a child
  851. //
  852. HRESULT DeleteChild(
  853. IN DWORD dwInstance, // Parent instance
  854. IN LPCTSTR lpszParent, // Parent Path ("" for root)
  855. IN LPCTSTR lpszAlias // Alias of child to be deleted
  856. );
  857. //
  858. // Get instance specific information
  859. //
  860. HRESULT QueryInstanceInfo(
  861. IN BOOL fInherit, // TRUE to inherit,
  862. // FALSE otherwise
  863. OUT ISMINSTANCEINFO * pii, // Returns instance info
  864. IN DWORD dwInstance // Instance number
  865. );
  866. //
  867. // Get child specific information
  868. //
  869. HRESULT QueryChildInfo(
  870. IN BOOL fInherit, // TRUE to inherit,
  871. // FALSE otherwise
  872. OUT ISMCHILDINFO * pii, // Returns child info
  873. IN DWORD dwInstance, // Instance number
  874. IN LPCTSTR lpszParent, // Parent path
  875. IN LPCTSTR lpszAlias // Alias name
  876. );
  877. //
  878. // Add an instance
  879. //
  880. HRESULT AddInstance(
  881. OUT ISMINSTANCEINFO * pii, // Instance info buffer or NULL
  882. IN DWORD dwBufferSize // Size of buffer
  883. );
  884. //
  885. // Delete an instance
  886. //
  887. HRESULT DeleteInstance(
  888. IN DWORD dwInstance // Instance to be deleted
  889. );
  890. //
  891. // Enumerate children.
  892. //
  893. HRESULT ISMEnumerateChildren(
  894. IN OUT ISMCHILDINFO * pii, // Child info buffer
  895. IN OUT HANDLE * phEnum, // Enumeration handle
  896. IN DWORD dwInstance, // Instance
  897. IN LPCTSTR lpszParent // Parent path
  898. );
  899. //
  900. // Enumerate instances
  901. //
  902. HRESULT ISMEnumerateInstances(
  903. IN OUT ISMINSTANCEINFO * pii, // Instance info buffer
  904. IN OUT HANDLE * pdwEnum // Enumeration handle
  905. );
  906. //
  907. // Launch security wizard
  908. //
  909. HRESULT ISMSecurityWizard(
  910. DWORD dwInstance, // Instance number
  911. LPCTSTR lpszParent, // Parent path
  912. LPCTSTR lpszAlias // Child alias name
  913. );
  914. //
  915. // Change service state
  916. //
  917. DWORD ChangeServiceState(
  918. IN int nNewState, // New state to set
  919. OUT int * pnCurrentState, // Returns current state
  920. IN DWORD dwInstance = MASTER_INSTANCE // Instance number
  921. );
  922. //
  923. // Return the API-suitable name (with
  924. // backslashes)
  925. //
  926. LPCTSTR QueryServerName() const { return (LPCTSTR)m_strServerName; }
  927. //
  928. // Return the name without backslashes,
  929. // suitable for display.
  930. //
  931. LPCTSTR QueryServerDisplayName() const;
  932. //
  933. // Obtain the server comment
  934. //
  935. CString & GetServerComment() { return m_strComment; }
  936. //
  937. // Allow modification
  938. //
  939. int * GetServiceStatePtr() { return &m_nServiceState; }
  940. //
  941. // Find out service state (running, stopped, paused)
  942. //
  943. int QueryServiceState() const { return m_nServiceState; }
  944. //
  945. // Return TRUE if the service is currently running
  946. //
  947. BOOL IsServiceRunning() const;
  948. //
  949. // Return TRUE if the service is currently stopped
  950. //
  951. BOOL IsServiceStopped() const;
  952. //
  953. // Return TRUE if the service is currently paused
  954. //
  955. BOOL IsServicePaused() const;
  956. //
  957. // Return TRUE if the service status is unknown
  958. //
  959. BOOL IsServiceStatusUnknown() const;
  960. //
  961. // Were we able to match it up to one of our installed services?
  962. //
  963. BOOL IsConfigurable() const { return m_pService != NULL; }
  964. //
  965. // Service Info Access Functions
  966. //
  967. public:
  968. //
  969. // Attempt to rebind lost connection...
  970. //
  971. HRESULT ISMRebind();
  972. //
  973. // Get the service info object
  974. //
  975. CServiceInfo * GetServiceInfo() { return m_pService; }
  976. //
  977. // Get the short name for this service
  978. //
  979. LPCTSTR GetShortName() const;
  980. //
  981. // Get the longer name for this service
  982. //
  983. LPCTSTR GetLongName() const;
  984. //
  985. // Get Server Handle
  986. //
  987. HANDLE GetHandle() { return m_hServer; }
  988. //
  989. // Get the protocol for this service (if any)
  990. //
  991. LPCTSTR GetProtocol() const;
  992. //
  993. // Get the metabase name for this service (if any)
  994. //
  995. LPCTSTR GetMetabaseName() const;
  996. //
  997. // Get the instance handle for the dll
  998. //
  999. HINSTANCE QueryInstanceHandle();
  1000. //
  1001. // Check to see if we're in the service mask -- that
  1002. // is, is the button depressed, and should we show
  1003. // this service in the view?
  1004. //
  1005. BOOL IsServiceSelected() const;
  1006. //
  1007. // Get the (short) service name.
  1008. //
  1009. LPCTSTR GetServiceName() const;
  1010. //
  1011. // Get the assigned service ID
  1012. //
  1013. int QueryServiceID() const;
  1014. //
  1015. // Get the assigned bitmap index for this service
  1016. //
  1017. int QueryBitmapIndex() const;
  1018. //
  1019. // Get the assigned child bitmap index
  1020. //
  1021. int QueryChildBitmapIndex() const;
  1022. //
  1023. // Is this service controllable?
  1024. //
  1025. BOOL CanControlService() const;
  1026. //
  1027. // Is the service pausable?
  1028. //
  1029. BOOL CanPauseService() const;
  1030. //
  1031. // Does the service support instances?
  1032. //
  1033. BOOL SupportsInstances() const;
  1034. //
  1035. // Does the service support children?
  1036. //
  1037. BOOL SupportsChildren() const;
  1038. //
  1039. // Use file system?
  1040. //
  1041. BOOL SupportsFileSystem() const;
  1042. //
  1043. // TRUE if the service supports a security wizard
  1044. //
  1045. BOOL SupportsSecurityWizard() const;
  1046. //
  1047. // Does the service understance instance ID codes
  1048. // -- eventhough it may not actually support
  1049. // instances
  1050. //
  1051. BOOL UnderstandsInstanceCodes() const;
  1052. //
  1053. // TRUE if the service supports prot://address browsing
  1054. //
  1055. BOOL HasWebProtocol() const;
  1056. //
  1057. // Use MMC property pages to show the property sheet for this
  1058. // service?
  1059. //
  1060. BOOL SupportsMMC() const;
  1061. //
  1062. // Does the service support the extended K2 services?
  1063. //
  1064. BOOL IsK2Service() const;
  1065. //
  1066. // Get the service bitmap ID (used for display
  1067. // in some views)
  1068. //
  1069. UINT QueryServiceBitmapID() const;
  1070. //
  1071. // Refresh information
  1072. //
  1073. DWORD Refresh();
  1074. protected:
  1075. //
  1076. // Given the inetsloc mask, return the service this
  1077. // fits. Return NULL if the service was not found.
  1078. //
  1079. static CServiceInfo * FindServiceByMask(
  1080. ULONGLONG ullTarget,
  1081. CObListPlus & oblServices
  1082. );
  1083. private:
  1084. //
  1085. // Name is maintained in API friendly format
  1086. //
  1087. CString m_strServerName;
  1088. //
  1089. // Maintain server handle for K2 services
  1090. //
  1091. HANDLE m_hServer;
  1092. //
  1093. // comment
  1094. //
  1095. CString m_strComment;
  1096. //
  1097. // Service state (started/stopped/paused)
  1098. //
  1099. int m_nServiceState;
  1100. //
  1101. // A pointer referring back to the service that
  1102. // it belongs to. This class does not own
  1103. // this pointer.
  1104. //
  1105. CServiceInfo * m_pService;
  1106. };
  1107. class CSnapinApp : public CWinApp
  1108. /*++
  1109. Class Description:
  1110. Main app object
  1111. Public Interface:
  1112. InitInstance : Instance initiation handler
  1113. ExitInstance : Exit instance handler
  1114. --*/
  1115. {
  1116. //
  1117. // Initialization
  1118. //
  1119. public:
  1120. CSnapinApp();
  1121. public:
  1122. virtual BOOL InitInstance();
  1123. virtual int ExitInstance();
  1124. //
  1125. // Access
  1126. //
  1127. public:
  1128. void SetHelpPath(CServerInfo * pItem = NULL);
  1129. LPCTSTR QueryInetMgrHelpPath() const { return m_strInetMgrHelpPath; }
  1130. protected:
  1131. //{{AFX_MSG(CSnapinApp)
  1132. afx_msg void OnHelp();
  1133. afx_msg void OnContextHelp();
  1134. //}}AFX_MSG
  1135. DECLARE_MESSAGE_MAP()
  1136. private:
  1137. LPCTSTR m_lpOriginalHelpPath;
  1138. CString m_strHelpPath;
  1139. CString m_strInetMgrHelpPath;
  1140. };
  1141. //
  1142. // Inline Expansion
  1143. //
  1144. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  1145. inline BOOL CServiceInfo::IsSuperDllFor(CServiceInfo * pTarget) const
  1146. {
  1147. return pTarget->m_strSupDLLName.CompareNoCase(m_strDLLName) == 0;
  1148. }
  1149. inline void CServiceInfo::AssignSuperDll(CServiceInfo * pTarget)
  1150. {
  1151. ASSERT(m_psiMaster == NULL);
  1152. m_psiMaster = pTarget;
  1153. }
  1154. inline CServiceInfo * CServiceInfo::GetSuperDll()
  1155. {
  1156. ASSERT(m_psiMaster != NULL);
  1157. return m_psiMaster;
  1158. }
  1159. inline BOOL CServiceInfo::UseInetSlocDiscover() const
  1160. {
  1161. return (m_si.flServiceInfoFlags & ISMI_INETSLOCDISCOVER) != 0;
  1162. }
  1163. inline BOOL CServiceInfo::CanControlService() const
  1164. {
  1165. return (m_si.flServiceInfoFlags & ISMI_CANCONTROLSERVICE) != 0;
  1166. }
  1167. inline BOOL CServiceInfo::CanPauseService() const
  1168. {
  1169. return (m_si.flServiceInfoFlags & ISMI_CANPAUSESERVICE) != 0;
  1170. }
  1171. inline BOOL CServiceInfo::UseNormalColorMapping() const
  1172. {
  1173. return (m_si.flServiceInfoFlags & ISMI_NORMALTBMAPPING) != 0;
  1174. }
  1175. inline BOOL CServiceInfo::SupportsFileSystem() const
  1176. {
  1177. return (m_si.flServiceInfoFlags & ISMI_FILESYSTEM) != 0;
  1178. }
  1179. inline BOOL CServiceInfo::SupportsSecurityWizard() const
  1180. {
  1181. return (m_si.flServiceInfoFlags & ISMI_SECURITYWIZARD) != 0;
  1182. }
  1183. inline BOOL CServiceInfo::SupportsInstances() const
  1184. {
  1185. return (m_si.flServiceInfoFlags & ISMI_INSTANCES) != 0;
  1186. }
  1187. inline BOOL CServiceInfo::SupportsChildren() const
  1188. {
  1189. return (m_si.flServiceInfoFlags & ISMI_CHILDREN) != 0;
  1190. }
  1191. inline BOOL CServiceInfo::UnderstandsInstanceCodes() const
  1192. {
  1193. return (m_si.flServiceInfoFlags & ISMI_UNDERSTANDINSTANCE) != 0;
  1194. }
  1195. inline BOOL CServiceInfo::HasWebProtocol() const
  1196. {
  1197. return (m_si.flServiceInfoFlags & ISMI_HASWEBPROTOCOL) != 0;
  1198. }
  1199. inline BOOL CServiceInfo::SupportsMMC() const
  1200. {
  1201. #ifdef USE_VTABLE
  1202. return m_rgpfnISMMethods[ISM_MMC_CONFIGURE] != NULL;
  1203. #else
  1204. return m_pfnISMMMCConfigureServers != NULL;
  1205. #endif // USE_VTABLE
  1206. }
  1207. inline BOOL CServiceInfo::IsK2Service() const
  1208. {
  1209. #ifdef USE_VTABLE
  1210. return m_rgpfnISMMethods[ISM_BIND] != NULL;
  1211. #else
  1212. return m_pfnBind != NULL;
  1213. #endif // USE_VTABLE
  1214. }
  1215. inline void CServiceInfo::SelectService(BOOL fSelected)
  1216. {
  1217. m_fIsSelected = fSelected;
  1218. }
  1219. #ifdef USE_VTABLE
  1220. //
  1221. // Helper Macros to access VTable
  1222. //
  1223. #define ISM_VTABLE_ENTRY(iID)\
  1224. (m_rgpfnISMMethods[iID] != NULL)
  1225. #define ISM_NO_VTABLE_ENTRY(iID)\
  1226. (m_rgpfnISMMethods[iID] == NULL)
  1227. #define ASSERT_VTABLE_ENTRY(iID)\
  1228. ASSERT(iID >= 0 && iID < ISM_NUM_METHODS);\
  1229. ASSERT(ISM_VTABLE_ENTRY(iID));
  1230. #define ISM_VTABLE(iID)\
  1231. (*m_rgpfnISMMethods[iID])
  1232. inline DWORD CServiceInfo::ISMDiscoverServers(
  1233. OUT ISMSERVERINFO * psi,
  1234. IN OUT DWORD * pdwBufferSize,
  1235. OUT int * pcServers
  1236. )
  1237. {
  1238. ASSERT_VTABLE_ENTRY(ISM_DISCOVER_SERVERS);
  1239. return ISM_VTABLE(ISM_DISCOVER_SERVERS)(
  1240. psi,
  1241. pdwBufferSize,
  1242. pcServers
  1243. );
  1244. }
  1245. inline DWORD CServiceInfo::ISMChangeServiceState(
  1246. IN int nNewState,
  1247. OUT int * pnCurrentState,
  1248. IN DWORD dwInstance,
  1249. IN LPCTSTR lpszServers
  1250. )
  1251. {
  1252. ASSERT_VTABLE_ENTRY(ISM_CHANGE_SERVICE_STATE);
  1253. return ISM_VTABLE(ISM_CHANGE_SERVICE_STATE)(
  1254. nNewState,
  1255. pnCurrentState,
  1256. dwInstance,
  1257. lpszServers
  1258. );
  1259. }
  1260. inline DWORD CServiceInfo::ISMConfigureServers(
  1261. IN HWND hWnd,
  1262. IN DWORD dwInstance,
  1263. IN LPCTSTR lpszServers
  1264. )
  1265. {
  1266. ASSERT_VTABLE_ENTRY(ISM_CONFIGURE);
  1267. return ISM_VTABLE(ISM_CONFIGURE)(
  1268. hWnd,
  1269. dwInstance,
  1270. lpszServers
  1271. );
  1272. }
  1273. inline HRESULT CServiceInfo::ISMBind(
  1274. IN LPCTSTR lpszServer,
  1275. OUT HANDLE *phServer
  1276. )
  1277. {
  1278. ASSERT_VTABLE_ENTRY(ISM_BIND);
  1279. return ISM_VTABLE(ISM_BIND)(lpszServer, phServer);
  1280. }
  1281. inline HRESULT CServiceInfo::ISMUnbind(
  1282. IN HANDLE hServer
  1283. )
  1284. {
  1285. ASSERT_VTABLE_ENTRY(ISM_UNBIND);
  1286. return ISM_VTABLE(ISM_UNBIND)(hServer);
  1287. }
  1288. inline HRESULT CServiceInfo::ISMEnumerateInstances(
  1289. IN HANDLE hServer,
  1290. IN OUT ISMINSTANCEINFO * pii,
  1291. IN OUT HANDLE * phEnum
  1292. )
  1293. {
  1294. ASSERT_VTABLE_ENTRY(ISM_ENUMERATE_INSTANCES);
  1295. return ISM_VTABLE(ISM_ENUMERATE_INSTANCES)(
  1296. hServer,
  1297. pii,
  1298. phEnum
  1299. );
  1300. }
  1301. inline HRESULT CServiceInfo::ISMAddInstance(
  1302. IN HANDLE hServer,
  1303. IN DWORD dwSourceInstance,
  1304. OUT ISMINSTANCEINFO * pii,
  1305. IN DWORD dwBufferSize
  1306. )
  1307. {
  1308. ASSERT_VTABLE_ENTRY(ISM_ADD_INSTANCE);
  1309. return ISM_VTABLE(ISM_ADD_INSTANCE)(
  1310. hServer,
  1311. dwSourceInstance,
  1312. pii,
  1313. dwBufferSize
  1314. );
  1315. }
  1316. inline HRESULT CServiceInfo::ISMDeleteInstance(
  1317. IN HANDLE hServer,
  1318. IN DWORD dwInstance
  1319. )
  1320. {
  1321. ASSERT_VTABLE_ENTRY(ISM_DELETE_INSTANCE);
  1322. return ISM_VTABLE(ISM_DELETE_INSTANCE)(
  1323. hServer,
  1324. dwInstance
  1325. );
  1326. }
  1327. inline HRESULT CServiceInfo::ISMQueryInstanceInfo(
  1328. IN HANDLE hServer,
  1329. IN BOOL fInherit,
  1330. OUT ISMINSTANCEINFO * pii,
  1331. IN DWORD dwInstance
  1332. )
  1333. {
  1334. ASSERT_VTABLE_ENTRY(ISM_QUERY_INSTANCE_INFO);
  1335. return ISM_VTABLE(ISM_QUERY_INSTANCE_INFO)(
  1336. hServer,
  1337. fInherit,
  1338. pii,
  1339. dwInstance
  1340. );
  1341. }
  1342. inline HRESULT CServiceInfo::ISMEnumerateChildren(
  1343. IN HANDLE hServer,
  1344. IN OUT ISMCHILDINFO * pii,
  1345. IN OUT HANDLE * pdwEnum,
  1346. IN DWORD dwInstance,
  1347. IN LPCTSTR lpszParent
  1348. )
  1349. {
  1350. ASSERT_VTABLE_ENTRY(ISM_ENUMERATE_CHILDREN);
  1351. return ISM_VTABLE(ISM_ENUMERATE_CHILDREN)(
  1352. hServer,
  1353. pii,
  1354. pdwEnum,
  1355. dwInstance,
  1356. lpszParent
  1357. );
  1358. }
  1359. inline HRESULT CServiceInfo::ISMQueryChildInfo(
  1360. IN HANDLE hServer,
  1361. IN BOOL fInherit,
  1362. OUT ISMCHILDINFO * pii,
  1363. IN DWORD dwInstance,
  1364. IN LPCTSTR lpszParent,
  1365. IN LPCTSTR lpszAlias
  1366. )
  1367. {
  1368. ASSERT_VTABLE_ENTRY(ISM_QUERY_CHILD_INFO);
  1369. return ISM_VTABLE(ISM_QUERY_CHILD_INFO)(
  1370. hServer,
  1371. fInherit,
  1372. pii,
  1373. dwInstance,
  1374. lpszParent,
  1375. lpszAlias
  1376. );
  1377. }
  1378. inline HRESULT CServiceInfo::ISMConfigureChild(
  1379. IN HANDLE hServer,
  1380. IN HWND hWnd,
  1381. IN DWORD dwAttributes,
  1382. IN DWORD dwInstance,
  1383. IN LPCTSTR lpszParent,
  1384. IN LPCTSTR lpszAlias
  1385. )
  1386. {
  1387. ASSERT_VTABLE_ENTRY(ISM_CONFIGURE_CHILD);
  1388. return ISM_VTABLE(ISM_CONFIGURE_CHILD)(
  1389. hServer,
  1390. hWnd,
  1391. dwAttributes,
  1392. dwInstance,
  1393. lpszParent,
  1394. lpszAlias
  1395. );
  1396. }
  1397. inline HRESULT CServiceInfo::ISMAddChild(
  1398. IN HANDLE hServer,
  1399. OUT ISMCHILDINFO * pii,
  1400. IN DWORD dwBufferSize,
  1401. IN DWORD dwInstance,
  1402. IN LPCTSTR lpszParent
  1403. )
  1404. {
  1405. ASSERT_VTABLE_ENTRY(ISM_ADD_CHILD);
  1406. return ISM_VTABLE(ISM_ADD_CHILD)(
  1407. hServer,
  1408. pii,
  1409. dwBufferSize,
  1410. dwInstance,
  1411. lpszParent
  1412. );
  1413. }
  1414. inline HRESULT CServiceInfo::ISMSecurityWizard(
  1415. HANDLE hServer,
  1416. DWORD dwInstance,
  1417. LPCTSTR lpszParent,
  1418. LPCTSTR lpszAlias
  1419. )
  1420. {
  1421. ASSERT_VTABLE_ENTRY(ISM_SECURITY_WIZARD);
  1422. return ISM_VTABLE(ISM_SECURITY_WIZARD)(
  1423. hServer,
  1424. dwInstance,
  1425. lpszParent,
  1426. lpszAlias
  1427. );
  1428. }
  1429. inline HRESULT CServiceInfo::ISMDeleteChild(
  1430. IN HANDLE hServer,
  1431. IN DWORD dwInstance,
  1432. IN LPCTSTR lpszParent,
  1433. IN LPCTSTR lpszAlias
  1434. )
  1435. {
  1436. ASSERT_VTABLE_ENTRY(ISM_DELETE_CHILD);
  1437. return ISM_VTABLE(ISM_DELETE_CHILD)(
  1438. hServer,
  1439. dwInstance,
  1440. lpszParent,
  1441. lpszAlias
  1442. );
  1443. }
  1444. inline HRESULT CServiceInfo::ISMRenameChild(
  1445. IN HANDLE hServer,
  1446. IN DWORD dwInstance,
  1447. IN LPCTSTR lpszParent,
  1448. IN LPCTSTR lpszAlias,
  1449. IN LPCTSTR lpszNewAlias
  1450. )
  1451. {
  1452. ASSERT_VTABLE_ENTRY(ISM_RENAME_CHILD);
  1453. return ISM_VTABLE(ISM_RENAME_CHILD)(
  1454. hServer,
  1455. dwInstance,
  1456. lpszParent,
  1457. lpszAlias,
  1458. lpszNewAlias
  1459. );
  1460. }
  1461. inline HRESULT CServiceInfo::ISMMMCConfigureServers(
  1462. IN HANDLE hServer,
  1463. IN PVOID lpfnProvider,
  1464. IN LPARAM param,
  1465. IN LONG_PTR handle,
  1466. IN DWORD dwInstance
  1467. )
  1468. {
  1469. ASSERT_VTABLE_ENTRY(ISM_MMC_CONFIGURE);
  1470. return ISM_VTABLE(ISM_MMC_CONFIGURE)(
  1471. hServer,
  1472. lpfnProvider,
  1473. param,
  1474. handle,
  1475. dwInstance
  1476. );
  1477. }
  1478. inline HRESULT CServiceInfo::ISMMMCConfigureChild(
  1479. IN HANDLE hServer,
  1480. IN PVOID lpfnProvider,
  1481. IN LPARAM param,
  1482. IN LONG_PTR handle,
  1483. IN DWORD dwAttributes,
  1484. IN DWORD dwInstance,
  1485. IN LPCTSTR lpszParent,
  1486. IN LPCTSTR lpszAlias
  1487. )
  1488. {
  1489. ASSERT_VTABLE_ENTRY(ISM_MMC_CONFIGURE_CHILD);
  1490. return ISM_VTABLE(ISM_MMC_CONFIGURE_CHILD)(
  1491. hServer,
  1492. lpfnProvider,
  1493. param,
  1494. handle,
  1495. dwAttributes,
  1496. dwInstance,
  1497. lpszParent,
  1498. lpszAlias
  1499. );
  1500. }
  1501. #else ! USE_VTABLE
  1502. inline DWORD CServiceInfo::ISMDiscoverServers(
  1503. OUT ISMSERVERINFO * psi,
  1504. IN OUT DWORD * pdwBufferSize,
  1505. OUT int * pcServers
  1506. )
  1507. {
  1508. ASSERT(m_pfnDiscoverServers != NULL);
  1509. return (*m_pfnDiscoverServers)(psi, pdwBufferSize, pcServers);
  1510. }
  1511. inline DWORD CServiceInfo::ISMChangeServiceState(
  1512. IN int nNewState,
  1513. OUT int * pnCurrentState,
  1514. IN DWORD dwInstance,
  1515. IN LPCTSTR lpszServers
  1516. )
  1517. {
  1518. ASSERT(m_pfnChangeServiceState != NULL);
  1519. return (*m_pfnChangeServiceState)(
  1520. nNewState,
  1521. pnCurrentState,
  1522. dwInstance,
  1523. lpszServers
  1524. );
  1525. }
  1526. inline DWORD CServiceInfo::ISMConfigureServers(
  1527. IN HWND hWnd,
  1528. IN DWORD dwInstance,
  1529. IN LPCTSTR lpszServers
  1530. )
  1531. {
  1532. ASSERT(m_pfnConfigure != NULL);
  1533. return (*m_pfnConfigure)(hWnd, dwInstance, lpszServers);
  1534. }
  1535. inline HRESULT CServiceInfo::ISMBind(
  1536. IN LPCTSTR lpszServer,
  1537. OUT HANDLE *phServer
  1538. )
  1539. {
  1540. ASSERT(m_pfnBind != NULL);
  1541. return (*m_pfnBind)(lpszServer, phServer);
  1542. }
  1543. inline HRESULT CServiceInfo::ISMUnbind(
  1544. IN HANDLE hServer
  1545. )
  1546. {
  1547. ASSERT(m_pfnUnbind != NULL);
  1548. return (*m_pfnUnbind)(hServer);
  1549. }
  1550. inline HRESULT CServiceInfo::ISMEnumerateInstances(
  1551. IN HANDLE hServer,
  1552. IN OUT ISMINSTANCEINFO * pii,
  1553. IN OUT HANDLE * phEnum
  1554. )
  1555. {
  1556. ASSERT(m_pfnEnumerateInstances != NULL);
  1557. return (*m_pfnEnumerateInstances)(hServer, pii, phEnum);
  1558. }
  1559. inline HRESULT CServiceInfo::ISMEnumerateChildren(
  1560. IN HANDLE hServer,
  1561. IN OUT ISMCHILDINFO * pii,
  1562. IN OUT HANDLE * phEnum,
  1563. IN DWORD dwInstance,
  1564. IN LPCTSTR lpszParent
  1565. )
  1566. {
  1567. ASSERT(m_pfnEnumerateChildren != NULL);
  1568. return (*m_pfnEnumerateChildren)(
  1569. hServer,
  1570. pii,
  1571. phEnum,
  1572. dwInstance,
  1573. lpszParent
  1574. );
  1575. }
  1576. inline HRESULT CServiceInfo::ISMConfigureChild(
  1577. IN HANDLE hServer,
  1578. IN HWND hWnd,
  1579. IN DWORD dwAttributes,
  1580. IN DWORD dwInstance,
  1581. IN LPCTSTR lpszParent,
  1582. IN LPCTSTR lpszAlias
  1583. )
  1584. {
  1585. ASSERT(m_pfnConfigureChild != NULL);
  1586. return (*m_pfnConfigureChild)(
  1587. hServer,
  1588. hWnd,
  1589. dwAttributes,
  1590. dwInstance,
  1591. lpszParent,
  1592. lpszAlias
  1593. );
  1594. }
  1595. inline HRESULT CServiceInfo::ISMAddInstance(
  1596. IN HANDLE hServer,
  1597. IN DWORD dwSourceInstance,
  1598. OUT ISMINSTANCEINFO * pii,
  1599. IN DWORD dwBufferSize
  1600. )
  1601. {
  1602. ASSERT(m_pfnAddInstance != NULL);
  1603. return (*m_pfnAddInstance)(hServer, dwSourceInstance, pii, dwBufferSize);
  1604. }
  1605. inline HRESULT CServiceInfo::ISMDeleteInstance(
  1606. IN HANDLE hServer,
  1607. IN DWORD dwInstance
  1608. )
  1609. {
  1610. ASSERT(m_pfnDeleteInstance != NULL);
  1611. return (*m_pfnDeleteInstance)(hServer, dwInstance);
  1612. }
  1613. inline HRESULT CServiceInfo::ISMQueryInstanceInfo(
  1614. IN HANDLE hServer,
  1615. IN BOOL fInherit,
  1616. OUT ISMINSTANCEINFO * pii,
  1617. IN DWORD dwInstance
  1618. )
  1619. {
  1620. ASSERT(m_pfnQueryInstanceInfo != NULL);
  1621. return (*m_pfnQueryInstanceInfo)(hServer, fInherit, pii, dwInstance);
  1622. }
  1623. inline HRESULT CServiceInfo::ISMQueryChildInfo(
  1624. IN HANDLE hServer,
  1625. IN BOOL fInherit,
  1626. OUT ISMCHILDINFO * pii,
  1627. IN DWORD dwInstance,
  1628. IN LPCTSTR lpszParent,
  1629. IN LPCTSTR lpszAlias
  1630. )
  1631. {
  1632. ASSERT(m_pfnQueryChildInfo != NULL);
  1633. return (*m_pfnQueryChildInfo)(
  1634. hServer,
  1635. fInherit,
  1636. pii,
  1637. dwInstance,
  1638. lpszParent,
  1639. lpszAlias
  1640. );
  1641. }
  1642. inline HRESULT CServiceInfo::ISMAddChild(
  1643. IN HANDLE hServer,
  1644. OUT ISMCHILDINFO * pii,
  1645. IN DWORD dwBufferSize,
  1646. IN DWORD dwInstance,
  1647. IN LPCTSTR lpszParent
  1648. )
  1649. {
  1650. ASSERT(m_pfnAddChild != NULL);
  1651. return (*m_pfnAddChild)(
  1652. hServer,
  1653. pii,
  1654. dwBufferSize,
  1655. dwInstance,
  1656. lpszParent
  1657. );
  1658. }
  1659. inline HRESULT CServiceInfo::ISMSecurityWizard(
  1660. HANDLE hServer,
  1661. DWORD dwInstance,
  1662. LPCTSTR lpszParent,
  1663. LPCTSTR lpszAlias
  1664. )
  1665. {
  1666. ASSERT(m_pfnISMSecurityWizard != NULL);
  1667. return (*m_pfnISMSecurityWizard)(
  1668. hServer,
  1669. dwInstance,
  1670. lpszParent,
  1671. lpszAlias
  1672. );
  1673. }
  1674. inline HRESULT CServiceInfo::ISMDeleteChild(
  1675. IN HANDLE hServer,
  1676. IN DWORD dwInstance,
  1677. IN LPCTSTR lpszParent,
  1678. IN LPCTSTR lpszAlias
  1679. )
  1680. {
  1681. ASSERT(m_pfnDeleteChild != NULL);
  1682. return (*m_pfnDeleteChild)(hServer, dwInstance, lpszParent, lpszAlias);
  1683. }
  1684. inline HRESULT CServiceInfo::ISMRenameChild(
  1685. IN HANDLE hServer,
  1686. IN DWORD dwInstance,
  1687. IN LPCTSTR lpszParent,
  1688. IN LPCTSTR lpszAlias,
  1689. IN LPCTSTR lpszNewAlias
  1690. )
  1691. {
  1692. ASSERT(m_pfnDeleteChild != NULL);
  1693. return (*m_pfnRenameChild)(
  1694. hServer,
  1695. dwInstance,
  1696. lpszParent,
  1697. lpszAlias,
  1698. lpszNewAlias
  1699. );
  1700. }
  1701. inline HRESULT CServiceInfo::ISMMMCConfigureServers(
  1702. IN HANDLE hServer,
  1703. IN PVOID lpfnProvider,
  1704. IN LPARAM param,
  1705. IN LONG_PTR handle,
  1706. IN DWORD dwInstance
  1707. )
  1708. {
  1709. ASSERT(m_pfnISMMMCConfigureServers != NULL);
  1710. return (*m_pfnISMMMCConfigureServers)(
  1711. hServer,
  1712. lpfnProvider,
  1713. param,
  1714. handle,
  1715. dwInstance
  1716. );
  1717. }
  1718. inline HRESULT CServiceInfo::ISMMMCConfigureChild(
  1719. IN HANDLE hServer,
  1720. IN PVOID lpfnProvider,
  1721. IN LPARAM param,
  1722. IN LONG_PTR handle,
  1723. IN DWORD dwAttributes,
  1724. IN DWORD dwInstance,
  1725. IN LPCTSTR lpszParent,
  1726. IN LPCTSTR lpszAlias
  1727. )
  1728. {
  1729. ASSERT(m_pfnISMMMCConfigureChild != NULL);
  1730. return (*m_pfnISMMMCConfigureChild)(
  1731. hServer,
  1732. lpfnProvider,
  1733. param,
  1734. handle,
  1735. dwAttributes,
  1736. dwInstance,
  1737. lpszParent,
  1738. lpszAlias
  1739. );
  1740. }
  1741. #endif // USE_VTABLE
  1742. //
  1743. // Assign the service bitmap index
  1744. //
  1745. inline void CServiceInfo::SetBitmapIndex(int iID)
  1746. {
  1747. m_iBmpID = iID;
  1748. }
  1749. //
  1750. // Assign the child bitmap index
  1751. //
  1752. inline void CServiceInfo::SetChildBitmapIndex(int iID)
  1753. {
  1754. m_iBmpChildID = iID;
  1755. }
  1756. inline HINSTANCE CNewInstanceCmd::QueryInstanceHandle()
  1757. {
  1758. return GetServiceInfo()->QueryInstanceHandle();
  1759. }
  1760. inline int CServerInfo::CompareByServer(CServerInfo * psi) const
  1761. {
  1762. return ::lstrcmpi(
  1763. QueryServerDisplayName(),
  1764. psi->QueryServerDisplayName()
  1765. );
  1766. }
  1767. inline BOOL CServerInfo::MatchServerName(LPCTSTR lpszServerName) const
  1768. {
  1769. return ::lstrcmpi(QueryServerDisplayName(), lpszServerName) == 0;
  1770. }
  1771. inline int CServerInfo::CompareByService(CServerInfo * psi)
  1772. {
  1773. return ::lstrcmpi(GetServiceName(), psi->GetServiceName());
  1774. }
  1775. inline HRESULT CServerInfo::ConfigureChild(
  1776. IN HWND hWnd,
  1777. IN DWORD dwAttributes,
  1778. IN DWORD dwInstance,
  1779. IN LPCTSTR lpszParent,
  1780. IN LPCTSTR lpszAlias
  1781. )
  1782. {
  1783. ASSERT(m_pService);
  1784. return m_pService->ISMConfigureChild(
  1785. m_hServer,
  1786. hWnd,
  1787. dwAttributes,
  1788. dwInstance,
  1789. lpszParent,
  1790. lpszAlias
  1791. );
  1792. }
  1793. inline HRESULT CServerInfo::MMCConfigureChild(
  1794. IN PVOID lpfnProvider,
  1795. IN LPARAM param,
  1796. IN LONG_PTR handle,
  1797. IN DWORD dwAttributes,
  1798. IN DWORD dwInstance,
  1799. IN LPCTSTR lpszParent,
  1800. IN LPCTSTR lpszAlias
  1801. )
  1802. {
  1803. ASSERT(m_pService);
  1804. return m_pService->ISMMMCConfigureChild(
  1805. m_hServer,
  1806. lpfnProvider,
  1807. param,
  1808. handle,
  1809. dwAttributes,
  1810. dwInstance,
  1811. lpszParent,
  1812. lpszAlias
  1813. );
  1814. }
  1815. inline HRESULT CServerInfo::RenameChild(
  1816. DWORD dwInstance,
  1817. LPCTSTR lpszParent,
  1818. LPCTSTR lpszAlias,
  1819. LPCTSTR lpszNewName
  1820. )
  1821. {
  1822. ASSERT(m_pService);
  1823. return m_pService->ISMRenameChild(
  1824. m_hServer,
  1825. dwInstance,
  1826. lpszParent,
  1827. lpszAlias,
  1828. lpszNewName
  1829. );
  1830. }
  1831. inline HRESULT CServerInfo::AddChild(
  1832. ISMCHILDINFO * pii,
  1833. DWORD dwBufferSize,
  1834. DWORD dwInstance,
  1835. LPCTSTR lpszParent
  1836. )
  1837. {
  1838. ASSERT(m_pService);
  1839. return m_pService->ISMAddChild(
  1840. m_hServer,
  1841. pii,
  1842. dwBufferSize,
  1843. dwInstance,
  1844. lpszParent
  1845. );
  1846. }
  1847. inline HRESULT CServerInfo::ISMSecurityWizard(
  1848. DWORD dwInstance, // Instance number
  1849. LPCTSTR lpszParent, // Parent path
  1850. LPCTSTR lpszAlias // Child alias name
  1851. )
  1852. {
  1853. ASSERT(m_pService);
  1854. return m_pService->ISMSecurityWizard(
  1855. m_hServer,
  1856. dwInstance,
  1857. lpszParent,
  1858. lpszAlias
  1859. );
  1860. }
  1861. inline HRESULT CServerInfo::DeleteChild(
  1862. DWORD dwInstance,
  1863. LPCTSTR lpszParent,
  1864. LPCTSTR lpszAlias
  1865. )
  1866. {
  1867. ASSERT(m_pService);
  1868. return m_pService->ISMDeleteChild(
  1869. m_hServer,
  1870. dwInstance,
  1871. lpszParent,
  1872. lpszAlias
  1873. );
  1874. }
  1875. inline HRESULT CServerInfo::QueryInstanceInfo(
  1876. BOOL fInherit,
  1877. ISMINSTANCEINFO * pii,
  1878. DWORD dwInstance
  1879. )
  1880. {
  1881. ASSERT(m_pService);
  1882. return m_pService->ISMQueryInstanceInfo(
  1883. m_hServer,
  1884. fInherit,
  1885. pii,
  1886. dwInstance
  1887. );
  1888. }
  1889. inline HRESULT CServerInfo::QueryChildInfo(
  1890. BOOL fInherit,
  1891. ISMCHILDINFO * pii,
  1892. DWORD dwInstance,
  1893. LPCTSTR lpszParent,
  1894. LPCTSTR lpszAlias
  1895. )
  1896. {
  1897. ASSERT(m_pService);
  1898. return m_pService->ISMQueryChildInfo(
  1899. m_hServer,
  1900. fInherit,
  1901. pii,
  1902. dwInstance,
  1903. lpszParent,
  1904. lpszAlias
  1905. );
  1906. }
  1907. inline HRESULT CServerInfo::AddInstance(
  1908. ISMINSTANCEINFO * pii,
  1909. DWORD dwBufferSize
  1910. )
  1911. {
  1912. ASSERT(m_pService);
  1913. return m_pService->ISMAddInstance(
  1914. m_hServer,
  1915. 0L, // Source instance
  1916. pii,
  1917. dwBufferSize
  1918. );
  1919. }
  1920. inline HRESULT CServerInfo::DeleteInstance(
  1921. DWORD dwInstance
  1922. )
  1923. {
  1924. ASSERT(m_pService);
  1925. return m_pService->ISMDeleteInstance(m_hServer, dwInstance);
  1926. }
  1927. inline HRESULT CServerInfo::ISMEnumerateChildren(
  1928. ISMCHILDINFO * pii,
  1929. HANDLE * phEnum,
  1930. DWORD dwInstance,
  1931. LPCTSTR lpszParent
  1932. )
  1933. {
  1934. ASSERT(m_pService);
  1935. return m_pService->ISMEnumerateChildren(
  1936. m_hServer,
  1937. pii,
  1938. phEnum,
  1939. dwInstance,
  1940. lpszParent
  1941. );
  1942. }
  1943. inline HRESULT CServerInfo::ISMEnumerateInstances(
  1944. ISMINSTANCEINFO * pii,
  1945. HANDLE * pdwEnum
  1946. )
  1947. {
  1948. ASSERT(m_pService);
  1949. return m_pService->ISMEnumerateInstances(m_hServer, pii, pdwEnum);
  1950. }
  1951. inline LPCTSTR CServerInfo::QueryServerDisplayName() const
  1952. {
  1953. #ifdef ENFORCE_NETBIOS
  1954. return ((LPCTSTR)m_strServerName) + 2;
  1955. #else
  1956. return (LPCTSTR)m_strServerName;
  1957. #endif // ENFORCE_NETBIOS
  1958. }
  1959. inline BOOL CServerInfo::IsServiceRunning() const
  1960. {
  1961. return m_nServiceState == INetServiceRunning;
  1962. }
  1963. inline BOOL CServerInfo::IsServiceStopped() const
  1964. {
  1965. return m_nServiceState == INetServiceStopped;
  1966. }
  1967. inline BOOL CServerInfo::IsServicePaused() const
  1968. {
  1969. return m_nServiceState == INetServicePaused;
  1970. }
  1971. inline BOOL CServerInfo::IsServiceStatusUnknown() const
  1972. {
  1973. return m_nServiceState == INetServiceUnknown;
  1974. }
  1975. inline HINSTANCE CServerInfo::QueryInstanceHandle()
  1976. {
  1977. ASSERT(m_pService != NULL);
  1978. return m_pService->QueryInstanceHandle();
  1979. }
  1980. inline BOOL CServerInfo::IsServiceSelected() const
  1981. {
  1982. ASSERT(m_pService != NULL);
  1983. return m_pService->IsSelected();
  1984. }
  1985. inline LPCTSTR CServerInfo::GetServiceName() const
  1986. {
  1987. ASSERT(m_pService != NULL);
  1988. return m_pService->GetShortName();
  1989. }
  1990. inline int CServerInfo::QueryServiceID() const
  1991. {
  1992. ASSERT(m_pService != NULL);
  1993. return m_pService->QueryServiceID();
  1994. }
  1995. inline int CServerInfo::QueryBitmapIndex() const
  1996. {
  1997. ASSERT(m_pService != NULL);
  1998. return m_pService->QueryBitmapIndex();
  1999. }
  2000. inline int CServerInfo::QueryChildBitmapIndex() const
  2001. {
  2002. ASSERT(m_pService != NULL);
  2003. return m_pService->QueryChildBitmapIndex();
  2004. }
  2005. inline LPCTSTR CServerInfo::GetShortName() const
  2006. {
  2007. ASSERT(m_pService != NULL);
  2008. return m_pService->GetShortName();
  2009. }
  2010. inline LPCTSTR CServerInfo::GetLongName() const
  2011. {
  2012. ASSERT(m_pService != NULL);
  2013. return m_pService->GetLongName();
  2014. }
  2015. inline LPCTSTR CServerInfo::GetProtocol() const
  2016. {
  2017. ASSERT(m_pService != NULL);
  2018. return m_pService->GetProtocol();
  2019. }
  2020. inline LPCTSTR CServerInfo::GetMetabaseName() const
  2021. {
  2022. ASSERT(m_pService != NULL);
  2023. return m_pService->GetMetabaseName();
  2024. }
  2025. inline BOOL CServerInfo::CanControlService() const
  2026. {
  2027. ASSERT(m_pService != NULL);
  2028. return m_pService->CanControlService();
  2029. }
  2030. inline BOOL CServerInfo::CanPauseService() const
  2031. {
  2032. ASSERT(m_pService != NULL);
  2033. return m_pService->CanPauseService();
  2034. }
  2035. inline BOOL CServerInfo::SupportsInstances() const
  2036. {
  2037. ASSERT(m_pService != NULL);
  2038. return m_pService->SupportsInstances();
  2039. }
  2040. inline BOOL CServerInfo::SupportsChildren() const
  2041. {
  2042. ASSERT(m_pService != NULL);
  2043. return m_pService->SupportsChildren();
  2044. }
  2045. inline BOOL CServerInfo::SupportsFileSystem() const
  2046. {
  2047. ASSERT(m_pService != NULL);
  2048. return m_pService->SupportsFileSystem();
  2049. }
  2050. inline BOOL CServerInfo::SupportsSecurityWizard() const
  2051. {
  2052. ASSERT(m_pService != NULL);
  2053. return m_pService->SupportsSecurityWizard();
  2054. }
  2055. inline BOOL CServerInfo::UnderstandsInstanceCodes() const
  2056. {
  2057. ASSERT(m_pService != NULL);
  2058. return m_pService->UnderstandsInstanceCodes();
  2059. }
  2060. inline BOOL CServerInfo::HasWebProtocol() const
  2061. {
  2062. ASSERT(m_pService != NULL);
  2063. return m_pService->HasWebProtocol();
  2064. }
  2065. inline BOOL CServerInfo::SupportsMMC() const
  2066. {
  2067. ASSERT(m_pService != NULL);
  2068. return m_pService->SupportsMMC();
  2069. }
  2070. inline BOOL CServerInfo::IsK2Service() const
  2071. {
  2072. ASSERT(m_pService != NULL);
  2073. return m_pService->IsK2Service();
  2074. }
  2075. inline UINT CServerInfo::QueryServiceBitmapID() const
  2076. {
  2077. ASSERT(m_pService != NULL);
  2078. return m_pService->QueryServiceBitmapID();
  2079. }
  2080. extern CSnapinApp theApp;
  2081. #include "iisobj.h"
  2082. #include "menuex.h"
  2083. #endif // _INETMGR_H