home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / mscoree.idl < prev    next >
Encoding:
Text File  |  2000-06-23  |  16.0 KB  |  375 lines

  1. /**************************************************************************************
  2.  **                                                                                  **
  3.  ** Mscoree.idl - interface definitions for mscoree.dll                              **
  4.  **                                                                                  **
  5.  ** Copyright (c) 1996-2000 Microsoft Corporation.  All Rights Reserved.             **
  6.  **                                                                                  **
  7.  **************************************************************************************/
  8.  
  9. //
  10. // Interface descriptions
  11. //
  12. import "unknwn.idl";
  13. import "gchost.idl";
  14. import "ivalidator.idl";
  15.  
  16. // LIBID mscoree
  17. cpp_quote("extern const GUID __declspec(selectany) LIBID_mscoree = {0x5477469e,0x83b1,0x11d2,{0x8b,0x49,0x00,0xa0,0xc9,0xb7,0xc9,0xc4}};")
  18.  
  19. // CLSID CorRuntimeHost : uuid(CB2F6723-AB3A-11d2-9C40-00C04FA30A3E)
  20. cpp_quote("extern const GUID  __declspec(selectany) CLSID_CorRuntimeHost = { 0xcb2f6723, 0xab3a, 0x11d2, { 0x9c, 0x40, 0x00, 0xc0, 0x4f, 0xa3, 0x0a, 0x3e } };")
  21.  
  22. // CLSID ComCallUnmarshall
  23. cpp_quote("extern const GUID __declspec(selectany) CLSID_ComCallUnmarshal = {0x3F281000,0xE95A,0x11d2,{0x88,0x6B,0x00,0xC0,0x4F,0x86,0x9F,0x04}};")
  24.  
  25. // IID IObjectHandle : uuid(C460E2B4-E199-412a-8456-84DC3E4838C3)
  26. cpp_quote("extern const GUID __declspec(selectany) IID_IObjectHandle = { 0xc460e2b4, 0xe199, 0x412a, { 0x84, 0x56, 0x84, 0xdc, 0x3e, 0x48, 0x38, 0xc3 } };")
  27.  
  28.  
  29. // IID IManagedObject : uuid(C3FCC19E-A970-11d2-8B5A-00A0C9B7C9C4)
  30. cpp_quote("extern const GUID  __declspec(selectany) IID_IManagedObject = { 0xc3fcc19e, 0xa970, 0x11d2, { 0x8b, 0x5a, 0x00, 0xa0, 0xc9, 0xb7, 0xc9, 0xc4 } };")
  31.  
  32. // IID ICorRuntimeHost : uuid(CB2F6722-AB3A-11d2-9C40-00C04FA30A3E)
  33. cpp_quote("extern const GUID  __declspec(selectany) IID_ICorRuntimeHost = { 0xcb2f6722, 0xab3a, 0x11d2, { 0x9c, 0x40, 0x00, 0xc0, 0x4f, 0xa3, 0x0a, 0x3e } };")
  34.  
  35. // IID ICorThreadpool : uuid(84680D3A-B2C1-46e8-ACC2-DBC0A359159A)
  36. cpp_quote("extern const GUID  __declspec(selectany) IID_ICorThreadpool = { 0x84680D3A, 0xB2C1, 0x46e8, {0xAC, 0xC2, 0xDB, 0xC0, 0xA3, 0x59, 0x15, 0x9A } };")
  37.  
  38. #pragma midl_echo("STDAPI GetCORSystemDirectory(LPWSTR pbuffer, DWORD  cchBuffer, DWORD* dwlength);")
  39. #pragma midl_echo("STDAPI GetCORVersion(LPWSTR pbuffer, DWORD cchBuffer, DWORD* dwlength);")
  40. #pragma midl_echo("STDAPI CorBindToRuntime(LPWSTR pwszVersion, LPWSTR pwszBuildFlavor, REFCLSID rclsid, REFIID riid, LPVOID FAR *ppv);")
  41. #pragma midl_echo("STDAPI CorBindToCurrentRuntime(LPCWSTR pwszFileName, REFCLSID rclsid, REFIID riid, LPVOID FAR *ppv);")
  42. #pragma midl_echo("STDAPI RunDll32ShimW(HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow);")
  43. #pragma midl_echo("STDAPI LoadLibraryShim(LPCWSTR szDllName, LPCWSTR szVersion, LPVOID pvReserved, HMODULE *phModDll);")
  44. #pragma midl_echo("STDAPI GetRealProcAddress(LPCSTR pwszProcName, VOID** ppv);")
  45. #pragma midl_echo("void STDMETHODCALLTYPE CorExitProcess();")
  46.  
  47. typedef enum {
  48.     STARTUP_CONCURRENT_GC = 0x1
  49. } STARTUP_FLAGS;
  50.  
  51. //*****************************************************************************
  52. // Interface for Object Handles
  53. //*****************************************************************************
  54. [
  55.     object,
  56.     oleautomation,
  57.     uuid(C460E2B4-E199-412a-8456-84DC3E4838C3),
  58.     helpstring("Object Handle Interface"),
  59.     pointer_default(unique)
  60. ]
  61. interface IObjectHandle : IUnknown
  62. {
  63.         HRESULT Unwrap([out, retval] VARIANT *ppv);
  64. };
  65.  
  66.  
  67.  
  68.  
  69. //*****************************************************************************
  70. // Interface for Setting runtime configuration
  71. //*****************************************************************************
  72. // {5C2B07A7-1E98-11d3-872F-00C04F79ED0D}
  73. //cpp_quote("extern const GUID  __declspec(selectany) IID_AppDomainBinding= { 0x5c2b07a7, 0x1e98, 0x11d3, { 0x87, 0x2f, 0x00, 0xc0, 0x4f, 0x79, 0xed, 0x0d } };")
  74. [
  75.         uuid(5C2B07A7-1E98-11d3-872F-00C04F79ED0D),
  76.         version(1.0), 
  77.         helpstring("Application Domain call back"),
  78.         pointer_default(unique),
  79.         local
  80. interface IAppDomainBinding : IUnknown
  81. {
  82.     // TODO: this should return a AppDomain interface
  83.     // The event is invoked everytime a domain is created 
  84.     HRESULT OnAppDomain([in] IUnknown* pAppdomain);
  85. }
  86.  
  87.  
  88. //*****************************************************************************
  89. // Interface for participating in the scheduling of threads that would
  90. // otherwise be blocked for a GC
  91. //*****************************************************************************
  92. [
  93.         uuid(F31D1788-C397-4725-87A5-6AF3472C2791),
  94.         version(1.0),
  95.         helpstring("Control over threads blocked in GC"),
  96.         pointer_default(unique),
  97.         local
  98. ]
  99. interface IGCThreadControl : IUnknown
  100. {
  101.         // Notification that the thread making the call is about to block, perhaps for
  102.         // a GC or other suspension.  This gives the host an opportunity to re-schedule
  103.         // the thread for unmanaged tasks.
  104.         HRESULT ThreadIsBlockingForSuspension();
  105.  
  106.         // Notification that the runtime is beginning a thread suspension for a GC or
  107.         // other suspension.  Do not reschedule this thread!
  108.         HRESULT SuspensionStarting();
  109.  
  110.         // Notification that the runtime is resuming threads after a GC or other
  111.         // suspension.  Do not reschedule this thread!
  112.         HRESULT SuspensionEnding(DWORD Generation);
  113. }
  114.  
  115. //*****************************************************************************
  116. // Interface for accessing threadpool 
  117. //*****************************************************************************
  118. typedef VOID (__stdcall *WAITORTIMERCALLBACK)(PVOID, BOOL); 
  119. typedef DWORD (__stdcall *LPTHREAD_START_ROUTINE)(LPVOID lpThreadParameter);
  120. cpp_quote("#ifdef UNDER_CE")
  121. typedef VOID (*LPOVERLAPPED_COMPLETION_ROUTINE)(DWORD dwErrorCode,
  122.                                                 DWORD dwNumberOfBytesTransfered,
  123.                                                 LPVOID lpOverlapped);
  124. cpp_quote("#endif // UNDER_CE")
  125. [
  126.         uuid(84680D3A-B2C1-46e8-ACC2-DBC0A359159A),
  127.         version(1.0),
  128.         helpstring("Threadpool interface"),
  129.         pointer_default(unique),
  130.         local
  131. ]
  132. interface ICorThreadpool : IUnknown
  133. {
  134.                 HRESULT CorRegisterWaitForSingleObject([in] HANDLE* phNewWaitObject,
  135.                                             [in] HANDLE hWaitObject,
  136.                                             [in] WAITORTIMERCALLBACK Callback,
  137.                                             [in] PVOID Context,
  138.                                             [in] ULONG timeout,
  139.                                             [in] BOOL  executeOnlyOnce,
  140.                                                                                         [out] BOOL* result  );
  141.  
  142.                 HRESULT CorUnregisterWait([in] HANDLE hWaitObject,[in] HANDLE CompletionEvent,[out] BOOL* result);
  143.  
  144.                 HRESULT CorQueueUserWorkItem([in] LPTHREAD_START_ROUTINE Function,
  145.                                   [in] PVOID Context,
  146.                                   [in] BOOL executeOnlyOnce,
  147.                                                                   [out] BOOL* result );
  148.  
  149.  
  150.                 HRESULT CorCreateTimer([in] HANDLE* phNewTimer,
  151.                             [in] WAITORTIMERCALLBACK Callback,
  152.                             [in] PVOID Parameter,
  153.                             [in] DWORD DueTime,
  154.                             [in] DWORD Period,
  155.                                                         [out] BOOL* result);
  156.  
  157.                 HRESULT CorChangeTimer([in] HANDLE Timer, [in] ULONG DueTime, [in] ULONG Period, [out] BOOL* result);
  158.  
  159.                 HRESULT CorDeleteTimer([in] HANDLE Timer, [in] HANDLE CompletionEvent, [out] BOOL* result);
  160.  
  161.                 HRESULT CorBindIoCompletionCallback([in] HANDLE fileHandle, [in] LPOVERLAPPED_COMPLETION_ROUTINE callback); 
  162. }
  163.  
  164. [
  165.         uuid(23D86786-0BB5-4774-8FB5-E3522ADD6246),
  166.         version(1.0),
  167.         helpstring("Control over threads blocked in debugging services"),
  168.         pointer_default(unique),
  169.         local
  170. ]
  171. interface IDebuggerThreadControl : IUnknown
  172. {
  173.         // Notification that the thread making the call is about to
  174.         // block within the debugging services.  This gives the host
  175.         // an opportunity to perform another action while the thread
  176.         // blocks. This will always be called on a Runtime thread.
  177.         HRESULT ThreadIsBlockingForDebugger();
  178.  
  179.         // Notification that the debugging services is about to
  180.         // release all threads it has blocked. This will never be
  181.         // called on a Runtime thread. If the host has a Runtime
  182.         // thread blocked in ThreadIsBlockingForDebugger() then it
  183.         // should release it now.
  184.         HRESULT ReleaseAllRuntimeThreads();
  185. }
  186.  
  187. // {5C2B07A5-1E98-11d3-872F-00C04F79ED0D}
  188. //cpp_quote("extern const GUID  __declspec(selectany) IID_ICorConfiguration = { 0x5c2b07a5, 0x1e98, 0x11d3, { 0x87, 0x2f, 0x00, 0xc0, 0x4f, 0x79, 0xed, 0x0d } };")
  189. [
  190.         uuid(5C2B07A5-1E98-11d3-872F-00C04F79ED0D),
  191.         version(1.0), 
  192.         helpstring("Com+ Configuration Interface"),
  193.         pointer_default(unique),
  194.         local
  195. interface ICorConfiguration : IUnknown
  196. {
  197.     // The event is invoked everytime a domain is created 
  198.     HRESULT SetAppDomainLoadEvent([in] IAppDomainBinding* pAppStartEvent);
  199.  
  200.     // Set the callback for scheduling threads for non-runtime tasks when they
  201.     // would otherwise be blocked for a GC.
  202.     HRESULT SetGCThreadControl([in] IGCThreadControl* pGCThreadControl);
  203.  
  204.     // Set the callback interface that the debugging services will
  205.     // call as Runtime threads are blocked and un-blocked for
  206.     // debugging.
  207.     HRESULT SetDebuggerThreadControl([in] IDebuggerThreadControl* pDebuggerThreadControl);
  208.  
  209.     // The host may indicate to the debugging services that a
  210.     // particular thread should be allowed to continue to execute
  211.     // while the debugger has an application stopped during
  212.     // managed/unmanaged debugging scenarios. The specified thread
  213.     // will not be allowed to run managed code, or to enter the
  214.     // Runtime in any way. An example of such a thread would be an
  215.     // in-process thread to support legacy script debuggers.
  216.     HRESULT AddDebuggerSpecialThread([in] DWORD dwSpecialThreadId);
  217. }
  218.  
  219. //*****************************************************************************
  220. // Interface for hosting mscoree
  221. //*****************************************************************************
  222. typedef void* HDOMAINENUM;
  223.  
  224. [
  225.         uuid(CB2F6722-AB3A-11d2-9C40-00C04FA30A3E),
  226.         version(1.0), 
  227.         helpstring("Com+ Runtime Hosting Interface"),
  228.         pointer_default(unique),
  229.         local
  230. interface ICorRuntimeHost : IUnknown
  231.  
  232.     //=================================================================
  233.     //
  234.     // Depricated methods.
  235.  
  236.     HRESULT VerifyClassesInModule( 
  237.      [in] DWORD   BaseAddress);      // Base Address of the file to verify.
  238.  
  239.     HRESULT CreateFiberInfo();
  240.     HRESULT DeleteFiber();
  241.     HRESULT SwitchFiberIn(
  242.      [in] DWORD *pFiberCookie);       // [in] Cookie that indicates the fiber to use.
  243.  
  244.     HRESULT SwitchFiberOut(
  245.      [out]   DWORD **pFiberCookie);   // [out] Cookie that indicates the fiber being switched out.
  246.  
  247.     HRESULT MapFile(
  248.      [in]   ULONG       hFile,           // [in]  HANDLE for file
  249.      [out]  HMODULE*    hMapAddress);    // [out] HINSTANCE for mapped file
  250.  
  251.     //=================================================================
  252.     //
  253.     // New hosting methods
  254.     //
  255.     // Returns an object for configuring the runtime prior to 
  256.     // it starting. If the runtime has been initialized this
  257.     // routine returns an error. See ICorConfiguration.
  258.     HRESULT GetConfiguration([out] ICorConfiguration** pConfiguration);
  259.  
  260.     // Starts the runtime. This is equivalent to CoInitializeCor();
  261.     HRESULT Start();
  262.     
  263.     // Terminates the runtime, This is equivalent CoUninitializeCor();
  264.     HRESULT Stop();
  265.     
  266.     // Creates a domain in the runtime. The identity array is 
  267.     // a pointer to an array TYPE containing IIdentity objects defining
  268.     // the security identity. The policy array is a pointer to an array
  269.     // TYPE containing Context policies that added on in addition to the
  270.     // basic policies for a AppDomain.
  271.     HRESULT CreateDomain([in] LPWSTR pwzFriendlyName,   // Optional
  272.                          [in] IUnknown* pIdentityArray, // Optional
  273.                          [in] IUnknown* pPolicyArray,   // Optional
  274.                          [out] IUnknown** pAppDomain);
  275.     
  276.     // Creates a domain in the runtime. A proxy controls a single
  277.     // domain. But provides more control over the domain.
  278.     HRESULT CreateDomainProxy([in] LPWSTR pwzFriendlyName,   // Optional
  279.                               [in] IUnknown* pIdentityArray, // Optional
  280.                               [in] IUnknown* pPolicyArray,   // Optional
  281.                               [out] IUnknown** pDomainProxy);
  282.     
  283.     // Returns the default domain.
  284.     HRESULT GetDefaultDomain([out] IUnknown** pAppDomain);
  285.     
  286.     
  287.     // Enumerate currently existing domains. 
  288.     HRESULT EnumDomains([out] HDOMAINENUM *hEnum);
  289.     
  290.     // Returns S_FALSE when there are no more domains. A domain
  291.     // is passed out only when S_OK is returned.
  292.     HRESULT NextDomain([in] HDOMAINENUM hEnum,
  293.                        [out] IUnknown** pAppDomain);
  294.     
  295.     // Resets the enumeration back to the beginning of the
  296.     // list
  297.     HRESULT ResetDomainEnum([in] HDOMAINENUM hEnum);
  298.     
  299.     // Close the enumeration releasing resources
  300.     HRESULT CloseEnum([in] HDOMAINENUM hEnum);
  301.  
  302.     // Verifies an assembly. This allows an assembly to be checked prior   
  303.     // to adding it to a domain. The assembly is not mapped into any 
  304.     // Assembly
  305.     HRESULT VerifyAssembly([in, size_is(cbModule)] BYTE* pbModule, // Base Address of the file to verify.
  306.                            [in] DWORD cbModule,
  307.                            [in, size_is(errorSize)] LONG* errors,
  308.                            [in] DWORD errorSize,
  309.                            [out] DWORD* errorCount);
  310.     
  311.     // Verifies an assembly. This allows an assembly to be checked prior 
  312.     // to adding it to a domain. The assembly is loaded into the default
  313.     // Domain and returned. 
  314.     HRESULT VerifyAssemblyFile([in] LPWSTR,
  315.                                [in, size_is(errorSize)] LONG* errors,
  316.                                [in] DWORD errorSize,
  317.                                [out] DWORD* errorCount);
  318.     
  319. }; 
  320.  
  321.  
  322. //*****************************************************************************
  323. // mscoree typelib definition
  324. //*****************************************************************************
  325.  
  326. [
  327.         uuid(5477469e-83b1-11d2-8b49-00a0c9b7c9c4),
  328.         version(1.0),
  329.         helpstring("Com+ Runtime Execution Engine 1.0 Type Library")
  330. ]
  331. library mscoree
  332. {
  333.         importlib("stdole32.tlb");
  334.         //*****************************************************************************
  335.         // Interface for controlling a managed object
  336.         //*****************************************************************************
  337.         [
  338.                          object,
  339.                 oleautomation,
  340.                         uuid(C3FCC19E-A970-11d2-8B5A-00A0C9B7C9C4),
  341.                 helpstring("Managed Object Interface"),
  342.                 pointer_default(unique)
  343.         ]
  344.         interface IManagedObject : IUnknown
  345.         {
  346.                         HRESULT GetSerializedBuffer( [out] BSTR *pBSTR);
  347.         };
  348.  
  349.  
  350.     [
  351.             uuid(3F281000-E95A-11d2-886B-00C04F869F04),
  352.             helpstring("Com Call Wrapper Unmarshalling Class")
  353.     ]
  354.     coclass ComCallUnmarshal
  355.     {
  356.             [default] interface IMarshal;
  357.     };
  358.  
  359.     [
  360.      uuid(CB2F6723-AB3A-11d2-9C40-00C04FA30A3E),
  361.      helpstring("Cor Runtime Hosting Class")
  362.     ]
  363.     coclass CorRuntimeHost
  364.     {
  365.         [default] interface ICorRuntimeHost;
  366.         interface IGCHost;
  367.         interface IValidator;
  368.     };
  369.  
  370. };
  371.