Article ID: 198891
Article Last Modified on 2/22/2007
DECLARE @object int DECLARE @hr int EXEC @hr = sp_OACreate 'SQLOLE.SQLServer', @object OUT, 4
HRESULT hr = CoCreateInstance(CLSID_Test, NULL, CLSCTX_LOCAL_SERVER,
IID_IUnknown, (void**)&piunknown);
OLEComponent.Object
You can use the programmatic identifier to find the class identifier for a COM object.
{59F929A0-74D8-11D2-8CBC-08005A390B09}
Make a note of this value or copy it to Notepad. Include the brackets.AppID
{59F929A0-74D8-11D2-8CBC-08005A390B09}
The application identifier AppID is used by DCOM to associate the DLL with an executable file.DllSurrogate
DCOMCNFG
WAITFOR DELAY '000:00:20'Run the script and immediately navigate to the command prompt and run the Tlist.exe file. Note the Dllhost.exe PID. Rerun Tlist.exe and pass the PID as a parameter. This shows the DLLs that are loaded within the Dllhost.exe process space. The DLL-based COM object should be listed as running within this process. After the script returns, running Tlist.exe again reveals that the Dllhost.exe process is no longer running.
C:\>tlist dllhost
275 dllhost.exe
CWD: C:\NT40\system32\
CmdLine: C:\NT40\System32\dllhost.exe {00000514-0000-0010-8000-00AA006D2EA4}
-Embedding
VirtualSize: 19180 KB PeakVirtualSize: 19180 KB
WorkingSetSize: 1780 KB PeakWorkingSetSize: 1780 KB
NumberOfThreads: 3
278 Win32StartAddr:0x01001920 LastErr:0x00000000 State:Waiting
215 Win32StartAddr:0x00001b5e LastErr:0x00000000 State:Waiting
253 Win32StartAddr:0x00001b60 LastErr:0x000000cb State:Waiting
4.0.1381.105 shp 0x01000000 dllhost.exe
4.0.1381.130 shp 0x77f60000 ntdll.dll
4.0.1381.121 shp 0x77dc0000 ADVAPI32.dll
4.0.1381.133 shp 0x77f00000 KERNEL32.dll
4.0.1381.133 shp 0x77e70000 USER32.dll
4.0.1381.115 shp 0x77ed0000 GDI32.dll
4.0.1381.131 shp 0x77e10000 RPCRT4.dll
4.0.1381.117 shp 0x77b20000 ole32.dll
6.0.8267.0 shp 0x78000000 MSVCRT.dll
0x1f310000 msado15.dll
2.30.4265.1 shp 0x766f0000 OLEAUT32.dll
4.0.1381.72 shp 0x77bf0000 rpcltc1.dll
With SQL Server version 7.0 Desktop Edition running on Microsoft Windows 95 or Microsoft Windows 98 workstations, the "32-bit Modules Loaded" within the Microsoft System Information application tool can be used during the execution to see the loading\unloading of the Dllhost.exe file and the COM object DLL during this test. To access the tool, click Start, point to Programs, point to Accessories, and then click System Tools.197426 FIX: Handle leak when passing ADO objects between processes
194661 SQL Server COM object persistence model
180780 How Sp_OA procedures extension to SQL Server is implemented
Additional query words: ActiveX, DCE, RPC, ATL, COM+, MTS, memory, resource, leak
Keywords: kbinfo KB198891