Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Wed, 25 Jan 2006 07:58:46 -0500,    group: microsoft.public.platformsdk.com_ole        back       


E_OUTOFMEMORY on GetIdsOfNames/Invoke   
Hi,

Has anyone experienced E_OUTOFMEMORY when making a cross process/DCOM call 
through IDispatch interface on win2k? Exact same code works fine on NT4(SP6) 
and winxp. I'm 100% sure that the machine is not out of memory (perfmon). 
This is under VPC. What are other conditions when E_OUTOFMEMORY is returned 
from IDispatch? does anyone know? Thanks a lot!
date: Wed, 25 Jan 2006 07:58:46 -0500   author:   Leon Finker am

Re: E_OUTOFMEMORY on GetIdsOfNames/Invoke   
Hi Leon,

> Has anyone experienced E_OUTOFMEMORY when making a cross process/DCOM
> call through IDispatch interface on win2k? Exact same code works fine
> on NT4(SP6) and winxp. I'm 100% sure that the machine is not out of
> memory (perfmon). This is under VPC. What are other conditions when
> E_OUTOFMEMORY is returned from IDispatch? does anyone know? Thanks a
> lot!

No straight ideas, but if you were to pass a wide-char string argument where 
a BSTR is expected, I guess E_OUTOFMEMORY could be provoked from the marshalling 
layer, because it peeks at the DWORD preceding the pointer, and attempts 
to reallocate it for marshalling.

What can you tell us about the specific method call?

--
Best Regards,
Kim Grsman
date: Wed, 25 Jan 2006 20:47:22 +0000 (UTC)   author:   Kim Gräsman

Re: E_OUTOFMEMORY on GetIdsOfNames/Invoke   
Hi Kim,

This is the exact code:

  DISPID dispid;
  LPOLESTR lpsz = L"CreateApplication";

  //CComDispatchDriver m_Controller;
   hr = m_Controller->GetIDsOfNames( IID_NULL, &lpsz, 1, 
LOCALE_USER_DEFAULT, &dispid );

This is exact code. So, hr is E_OUTOFMEMORY. Then I tried to call Invoke() 
with hardcoded values and same HRESULT.

BTW, I installed SP1 on that VPC and still same problem. Then I installed 
SP3 and SP4 and no error happens anymore. No error on WinXP. The pointer is 
called through on a correctly COM (OleInitialize) initialized thread and the 
pointer is retrieved through GIT from another COM (MTA) initialized thread. 
It even works on NT4 SP6 (VPC machine). It's always reproducible on that 
win2k-KO VPC machine. I didn't spend huge amount debugging this yet. I 
thought maybe someone can spot an error or encountered this before.

Thanks a lot!

"Kim Grsman"  wrote in message 
news:453b99c680d248c7f0100e6acb19@news.microsoft.com...
> Hi Leon,
>
>> Has anyone experienced E_OUTOFMEMORY when making a cross process/DCOM
>> call through IDispatch interface on win2k? Exact same code works fine
>> on NT4(SP6) and winxp. I'm 100% sure that the machine is not out of
>> memory (perfmon). This is under VPC. What are other conditions when
>> E_OUTOFMEMORY is returned from IDispatch? does anyone know? Thanks a
>> lot!
>
> No straight ideas, but if you were to pass a wide-char string argument 
> where a BSTR is expected, I guess E_OUTOFMEMORY could be provoked from the 
> marshalling layer, because it peeks at the DWORD preceding the pointer, 
> and attempts to reallocate it for marshalling.
>
> What can you tell us about the specific method call?
>
> --
> Best Regards,
> Kim Grsman
>
>
date: Wed, 25 Jan 2006 21:44:04 -0500   author:   Leon Finker am

Re: E_OUTOFMEMORY on GetIdsOfNames/Invoke   
Hi Leon,

> This is exact code. So, hr is E_OUTOFMEMORY. Then I tried to call
> Invoke() with hardcoded values and same HRESULT.

Hmm... Nothing jumps out at me. 

I take it the call never reaches the remote object? That would indicate that 
the problem is either in your code or in the proxy implementation for IDispatch 
on that particular platform.

Any difference if you make the method name allocated on the stack instead 
of the data segment:

  OLECHAR lpsz[] = L"CreateApplication";

? 

I guess since Invoke is problematic as well, this shouldn't be the issue, 
but I've seen cases where GetIDsOfNames would try and modify the LPOLESTR 
passed to it (it adjusts case in the same buffer), and if it was in read-only 
memory, things would break.

--
Best Regards,
Kim Grsman
date: Sat, 28 Jan 2006 10:04:03 +0000 (UTC)   author:   Kim Gräsman

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us