Re: LDAP running on Window CE device always returning LDAP_LOCAL_E

Tech-Archive recommends: Fix windows errors by optimizing your registry



Sorry you've been having so many problems with this, David, and good
detective work. You should obviously not have to call the ldap_startup()
routine. ldap_startup() just calls LdapClientInitialize().
LdapClientInitialize should automatically be called wldap32.dll is loaded
during the DllMain() DLL_PROCESS_ATTACH processing.

So the question becomes why isn't the DllMain() being processed? This I do
not know. Is it possible you did something really funky with the linker
when linking to this library?

--
John Spaith
Software Design Engineer, Windows CE
Microsoft Corporation

Check out the new CE Networking Team Blog at http://blogs.msdn.com/cenet/.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2003 Microsoft Corporation. All rights
reserved.

"David Miller" <DavidMiller@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:EAAE0753-AB58-469F-9469-E358FD4E552D@xxxxxxxxxxxxxxxx
> Hi:
>
> I guess I'm all alone on this one. I was able to get this to work using
> an
> undocumented function called ldap_startup. Once this was called, the heap
> handle was created.
>
> Every code example I have seen does not use this function. It is not
> needed
> on Win32 PC. Is the ldap_startup function hiding some other issue? I am
> concerned about the fact that an undocumented API is required on Window
> CE.
> Can anyone shed light on this?
>
> Thank you,
>
> David.
>
> "David Miller" wrote:
>
>> Hi:
>>
>> Not giving up. I know what the issue is now. I realized that
>> HeapAllocTrace really is HeapAlloc. The arguments being passed within
>> the
>> ldap code are
>>
>> HeapAllocTrace(0, 8, 538). The problem is the first argument set to a
>> null
>> handle.
>>
>> I confirmed this by adding the following line of code before my call to
>> ldap_init or ldap_open.
>>
>> LPVOID lpValue = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 538);
>>
>> This code correctly allocated memory. So, while debugging, I pulled the
>> handle value from this call and inserted it into the call from ldap_init
>> and
>> ldap_open, and it successfully allocated memory.
>>
>> So, now the question is, where does the ldap code get its heap handle
>> from
>> and how do it get it to be non-null? Hopefully, this is easier to
>> answer.
>>
>> Thank you,
>>
>> David.
>>
>> "David Miller" wrote:
>>


.



Relevant Pages

  • RE: LDAP running on Window CE device always returning LDAP_LOCAL_E
    ... undocumented function called ldap_startup. ... "David Miller" wrote: ... and it successfully allocated memory. ... > So, now the question is, where does the ldap code get its heap handle from ...
    (microsoft.public.windowsce.embedded.vc)
  • RE: LDAP running on Window CE device always returning LDAP_LOCAL_E
    ... So, now the question is, where does the ldap code get its heap handle from ... "David Miller" wrote: ... Except debugging through the assembly was easier to read. ... > looks like 538 bytes are requested to HeapAllocTrace and 0 bytes are returned. ...
    (microsoft.public.windowsce.embedded.vc)