Essential COM

COM Windows NT 4.0 COM (COM applications). COM GUID ( AppID ) . CLSID . , AppID:

 [HKCR\CLSID\{27EE6A4E-DF65-11D0-8C5F-0080C73925BA}] @="Gorilla" AppID="{27EE6A4E-DF65-11D0-8C5F-0080C73925BA}" 

, COM, AppID, .

 HKEY_CLASSES_ROOT\AppID 

CLSID, AppID Windows NT 5.0 . , Windows NT 4.0, AppID, COM ( , DCOMCNFG.EXE, OLEVIEW.EXE) AppID . AppID , AppID CLSID, . DCOMCNFG OLEVIEW AppID CLSID . , Windows NT 4.0, ( ) AppID GUID.

AppID DCOMCNFG.EXE, Windows NT 4.0 . DCOMCNFG.EXE . , OLEVIEW.EXE, DCOMCNFG.EXE , , "COM- " (COM-centric) . COM.

AppID RemoteServerName. , - , COSERVERINFO - . :

 [HKCR\AppID\{27EE6A4D-DF65-11d0-8C5F-0080C73925BA}] @="  Server" RemoteServerName="www.apes.com" [HKCR\AppID\{27EE6A4E-DF65-11d0-8C5F-0080C73925BA}] @="Gorilla" AppID={27EE6A4D-DF65-11d0-8C5F-0080C73925BA} [HKCR\AppID\{27EE6A4F-DF65-11d0-8C5F-0080C73925BA}] @="Chimp" AppID={27EE6A4D-DF65-11d0-8C5F-0080C73925BA} 

:

 IApeClass *  = 0; HRESULT hr = CoGetClassObject(CLSID_Chimp,                               CLSCTX_REMOTE_SERVER, 0, IID_IApeClass, (void**)&pac); 

SCM SCM www.apes.com, . , - :

 IApeClass *  = 0; COSERVERINFO csi; ZeroMemory(&csi, sizeof(csi)); csi.pwszName = OLESTR("www.dogs.com"); HRESULT hr = CoGetClassObject(CLSID_Chimp,                               CLSCTX_REMOTE_SERVER, &csi, IID_IApeClass, (void**)&pac); 

RemoteServerName www.apes.com.

, - . CoGetClassObject

 IApeClass *pac = 0; HRESULT hr = CoGetClassObject(CLSID_Chimp,                               CLSCTX_ALL, 0, IID_IApeClass, (void*)&pac); 

- , SCM :

 [HKCR\AppID\{27EE6A4F-DF65-11d0-8C5F-0080C7392SBA}] 

, COM (class store) Windows NT 5.0, . , SCM InpocServer32:

 HKCR\CLSID\{27EE6A4F-DF65-11d0-8C5F-0080C73925BA}\InprocServer32] @="C:\somefile.dll" 

, DLL, . SCM InprocHandler32:

 HKCR\CLSID\{27EE6A4F-DF65-11d0-8C5F-0080C73925BA}\InprocHandler32] @="C:\somefile.dll" 

(handler), DLL, . , SCM , . SCM , , CLSID1. , SCM , , . REGCLS_SINGLEUSE, SCM , .

, . , , SCM , CLSID , SCM , . COM : NT (NT Services), (surrogate processes). NT Services , , , . . DLL , DLL ( , Java). , , 120 ( 30 Windows NT Service Pack 2 ) CoRegisterClassObject. , SCM .

SCM , AppID, , LocalService:

 [HKCR\AppID\{27EE6A4D-DF65-11d0-8C5F-0080C73925BA} LocalService="apesvc" 

, SCM NT Service Control Manager ( ) NT, ( , apesvc). LocalService , SCM CLSID LocalServer32:

 [HKCR\CLSID\{27EE6A4F-DF65-11d0-8C5F-0080C73925BA}\LocalServer32] @="C:\somefile.exe" 

, SCM API- CreateProcess ( CreateProcessAsUser). LocalService, LocalServer32, SCM , AppID- :

 [HKCR\AppID\{27EE6A4D-DF6S-11d0-8CSF-0080C73925BA}] DllSurrogate="" 

, DllSurrogate, , , SCM (dllhost.exe). DllSurrogate , :

 [HKCR\AppID\{27EE6A4D-DF65-11d0-8C5F-0080C7392SBA}] DllSurrogate=" :\somefile.exe" 

SCM . COM ( SCM) API- CoRegisterSurrogate :

 HRESULT CoRegisterSurrogate([in] ISurrogate *psg); 

API- , ISurrogate:

 [uuid(00000022-0000-0000-C000-000000000046), object] interface ISurrogate : IUnknown {       // SCM asking surrogate to load inprocess class object and       // call CoRegisterClassObject using REGCLS_SUSPENDED       // SCM              //         CoRegisterClassObject       //     REGCLS_SUSPENDED   HRESULT LoadDllServer([in] REFCLSID rclsid);       // SCM asking surrogate to shut down       // SCM          HRESULT FreeSurrogate(); } 

ISurrogate COM . . , .

, , , SCM RemoteServerName AppID, :

 [HKCR\AppID\{27EE6A4D-DF65-11d0-8CSF-0080C7392SBA}] RemoteServerName="www.apes.com" 

SCM - . , CLSCTX_LOCAL_SERVER, , .

, , CoGetInstanceFromFile ( BindToObject ). , , , , COM , . , , AppID ActivateAtStorage "Y" "y", COM , , , - COSERVERINFO. , .


1 , .



Suschnost' tehnologii SOM
Essential COM
ISBN: 0201634465
EAN: 2147483647
Year: N/A
Pages: 103
Authors: Don Box

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net