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.

98 lines
2.6 KiB

  1. #ifndef __WBEM_CMDLINE_CONSUMER__H_
  2. #define __WBEM_CMDLINE_CONSUMER__H_
  3. #include <unk.h>
  4. #include <wbemidl.h>
  5. #include "txttempl.h"
  6. #include <stdio.h>
  7. class CCommandLineConsumer : public CUnk
  8. {
  9. protected:
  10. class XProvider : public CImpl<IWbemEventConsumerProvider,
  11. CCommandLineConsumer>
  12. {
  13. public:
  14. XProvider(CCommandLineConsumer* pObj)
  15. : CImpl<IWbemEventConsumerProvider, CCommandLineConsumer>(pObj){}
  16. HRESULT STDMETHODCALLTYPE FindConsumer(
  17. IWbemClassObject* pLogicalConsumer,
  18. IWbemUnboundObjectSink** ppConsumer);
  19. } m_XProvider;
  20. friend XProvider;
  21. public:
  22. CCommandLineConsumer(CLifeControl* pControl = NULL, IUnknown* pOuter = NULL)
  23. : CUnk(pControl, pOuter), m_XProvider(this)
  24. {}
  25. ~CCommandLineConsumer(){}
  26. void* GetInterface(REFIID riid);
  27. };
  28. class CCommandLineSink : public CUnk
  29. {
  30. protected:
  31. class XSink : public CImpl<IWbemUnboundObjectSink, CCommandLineSink>
  32. {
  33. public:
  34. XSink(CCommandLineSink* pObj) :
  35. CImpl<IWbemUnboundObjectSink, CCommandLineSink>(pObj){}
  36. HRESULT STDMETHODCALLTYPE CreateProcessNT(WCHAR* wsCommandLine, WCHAR* wsTitle, PROCESS_INFORMATION& pi, FILETIME& now);
  37. HRESULT STDMETHODCALLTYPE IndicateToConsumer(
  38. IWbemClassObject* pLogicalConsumer, long lNumObjects,
  39. IWbemClassObject** apObjects);
  40. } m_XSink;
  41. friend XSink;
  42. protected:
  43. WString m_wsExecutable;
  44. CTextTemplate m_CommandLine;
  45. CTextTemplate m_title;
  46. DWORD m_dwCreationFlags;
  47. WString m_wsWorkingDirectory;
  48. WString m_wsDesktop;
  49. // WString m_wsTitle;
  50. DWORD m_dwX;
  51. DWORD m_dwY;
  52. DWORD m_dwXSize;
  53. DWORD m_dwYSize;
  54. DWORD m_dwXNumCharacters;
  55. DWORD m_dwYNumCharacters;
  56. DWORD m_dwFillAttribute;
  57. DWORD m_dwStartFlags;
  58. DWORD m_dwShowWindow;
  59. BOOL m_bInteractive;
  60. DWORD m_dwKillTimeout; // how long to wait before killing process, zero is infinite
  61. PSID m_pSidCreator;
  62. ErrorObj* m_pErrorObj;
  63. HRESULT FindInteractiveInfo();
  64. public:
  65. WString m_wsWindowStation;
  66. public:
  67. CCommandLineSink(CLifeControl* pControl = NULL)
  68. : CUnk(pControl), m_XSink(this), m_pSidCreator(NULL), m_pErrorObj(NULL)
  69. {}
  70. HRESULT Initialize(IWbemClassObject* pLogicalConsumer);
  71. ~CCommandLineSink()
  72. {
  73. delete m_pSidCreator;
  74. if (m_pErrorObj)
  75. m_pErrorObj->Release();
  76. }
  77. void* GetInterface(REFIID riid);
  78. };
  79. #endif