Issue 8978 - Fix mdb_env_open2() failing when getting handle for NTDLL.dll
Summary: Fix mdb_env_open2() failing when getting handle for NTDLL.dll
Status: RESOLVED TEST
Alias: None
Product: LMDB
Classification: Unclassified
Component: liblmdb (show other issues)
Version: unspecified
Hardware: All All
: --- development
Target Milestone: 1.0.0
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-17 17:03 UTC by khng300@gmail.com
Modified: 2020-03-16 22:52 UTC (History)
0 users

See Also:


Attachments
Patch for issue (946 bytes, patch)
2020-03-14 23:35 UTC, Quanah Gibson-Mount
Details

Note You need to log in before you can comment on or make changes to this issue.
Description khng300@gmail.com 2019-02-17 17:03:05 UTC
Full_Name: Ka Ho Ng
Version: mdb.master
OS: Windows 10
URL: ftp://ftp.openldap.org/incoming/Ka-Ho-Ng-190218.patch
Submission from: (NULL) (2001:470:fa95:1300::1)


Fix mdb_env_open2() failing when getting handle for NTDLL.dll

Always call GetModuleHandleW() with Unicode string, as mdb_fopen() is
calling CreateFileW() already. Otherwise GetModuleHandle() will fail with
non-Unicode string.

I, Ka Ho Ng, hereby place the following modifications to OpenLDAP Software (and
only these modifications) into the public domain. Hence, these modifications may
be freely used and/or redistributed for any purpose with or without attribution
and/or other notice. 
Comment 1 Howard Chu 2019-02-17 17:48:20 UTC
khng300@gmail.com wrote:
> Full_Name: Ka Ho Ng
> Version: mdb.master
> OS: Windows 10
> URL: ftp://ftp.openldap.org/incoming/Ka-Ho-Ng-190218.patch
> Submission from: (NULL) (2001:470:fa95:1300::1)

Thanks for the patch, committed to mdb.master
> 
> Fix mdb_env_open2() failing when getting handle for NTDLL.dll
> 
> Always call GetModuleHandleW() with Unicode string, as mdb_fopen() is
> calling CreateFileW() already. Otherwise GetModuleHandle() will fail with
> non-Unicode string.
> 
> I, Ka Ho Ng, hereby place the following modifications to OpenLDAP Software (and
> only these modifications) into the public domain. Hence, these modifications may
> be freely used and/or redistributed for any purpose with or without attribution
> and/or other notice. 
> 
> 


-- 
  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 2 OpenLDAP project 2019-02-17 17:49:11 UTC
in mdb.master
Comment 3 Howard Chu 2019-02-17 17:49:11 UTC
changed notes
changed state Open to Test
moved from Incoming to Development
Comment 4 Quanah Gibson-Mount 2020-03-14 23:35:38 UTC
Created attachment 587 [details]
Patch for issue