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.

97 lines
2.9 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1992.
  5. //
  6. // File: srvmain.hxx
  7. //
  8. // Contents: headers shared by COM server implementations
  9. //
  10. // History: 04-Feb-94 Rickhi Created
  11. //
  12. //--------------------------------------------------------------------------
  13. #ifndef _SRVMAIN_HXX_
  14. #define _SRVMAIN_HXX_
  15. //+-------------------------------------------------------------------
  16. //
  17. // Struct: SCLASSINFO
  18. //
  19. // Synopsis: structure used to register class factories. an array of these
  20. // is passed to SrvMain2 which registers them, enters a message
  21. // pump, then revokes and releases them on exit.
  22. //
  23. //+-------------------------------------------------------------------
  24. typedef struct tagSCLASSINFO
  25. {
  26. CLSID clsid; // class to register
  27. DWORD dwClsReg; // registration parameter
  28. DWORD dwCtx; // class context (single/multiple use)
  29. IClassFactory *pCF; // class factory object
  30. DWORD dwReg; // reg key from CoRegisterClassObject
  31. } SCLASSINFO;
  32. // flag values for dwFlags parameter in STHREADINFO (see below)
  33. typedef enum tagSRVFLAGS
  34. {
  35. SRVF_THREADMODEL_UNKNOWN = 0x0,
  36. SRVF_THREADMODEL_APARTMENT = 0x1,
  37. SRVF_THREADMODEL_MULTI = 0x2,
  38. SRVF_REGISTER_RESUME = 0x4 // call CoResumeClassObjects
  39. } SRVFLAGS;
  40. //+-------------------------------------------------------------------
  41. //
  42. // Struct: STHREADINFO
  43. //
  44. // Synopsis: Used to pass execution parameters to threads.
  45. //
  46. //+-------------------------------------------------------------------
  47. typedef struct tagSTHREADINFO
  48. {
  49. HANDLE hEventRun; // thread is done initializing
  50. HANDLE hEventDone; // thread is done cleaning up
  51. HINSTANCE hInstance;
  52. DWORD dwTid; // server thread id
  53. TCHAR *pszWindow; // window name
  54. DWORD dwFlags; // see SRVFLAGS above
  55. ULONG cClasses; // number of classes in SCLASSINFO list
  56. SCLASSINFO *pClsInfo; // class registration info list
  57. } STHREADINFO;
  58. extern "C" const GUID IID_IStdIdentity;
  59. extern void Display(TCHAR *pszFmt, ...);
  60. extern void GlobalRefs(BOOL fAdd);
  61. //+-------------------------------------------------------------------
  62. //
  63. // Function: SrvMain2
  64. //
  65. // Synopsis: Main entry point for a thread.
  66. //
  67. //+-------------------------------------------------------------------
  68. int SrvMain2(STHREADINFO *pThrdInfo);
  69. //+-------------------------------------------------------------------
  70. //
  71. // Function: SrvMain
  72. //
  73. // Synopsis: Alternative entry point for a thread, just packages
  74. // the parameters and calls SrvMain2.
  75. //
  76. //+-------------------------------------------------------------------
  77. extern int SrvMain(
  78. HANDLE hInstance,
  79. REFCLSID rclsid,
  80. DWORD dwClsRegParm,
  81. TCHAR *pwszAppName,
  82. IClassFactory *pCF);
  83. #endif // _SRVMAIN_HXX_