Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
50590f11
Commit
50590f11
authored
Jan 14, 2012
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use GetModuleHandleW to avoid *A functions where possible.
parent
d61fdc17
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
Modules/posixmodule.c
Modules/posixmodule.c
+3
-3
PC/frozen_dllmain.c
PC/frozen_dllmain.c
+1
-1
PC/winreg.c
PC/winreg.c
+4
-4
No files found.
Modules/posixmodule.c
View file @
50590f11
...
...
@@ -1155,7 +1155,7 @@ check_GetFinalPathNameByHandle()
/* only recheck */
if
(
!
has_GetFinalPathNameByHandle
)
{
hKernel32
=
GetModuleHandle
(
"KERNEL32"
);
hKernel32
=
GetModuleHandle
W
(
L
"KERNEL32"
);
*
(
FARPROC
*
)
&
Py_GetFinalPathNameByHandleA
=
GetProcAddress
(
hKernel32
,
"GetFinalPathNameByHandleA"
);
*
(
FARPROC
*
)
&
Py_GetFinalPathNameByHandleW
=
GetProcAddress
(
hKernel32
,
...
...
@@ -6526,7 +6526,7 @@ check_CreateSymbolicLinkW()
/* only recheck */
if
(
has_CreateSymbolicLinkW
)
return
has_CreateSymbolicLinkW
;
hKernel32
=
GetModuleHandle
(
"KERNEL32"
);
hKernel32
=
GetModuleHandle
W
(
L
"KERNEL32"
);
*
(
FARPROC
*
)
&
Py_CreateSymbolicLinkW
=
GetProcAddress
(
hKernel32
,
"CreateSymbolicLinkW"
);
if
(
Py_CreateSymbolicLinkW
)
...
...
@@ -9365,7 +9365,7 @@ win32_urandom(PyObject *self, PyObject *args)
/* Obtain handle to the DLL containing CryptoAPI
This should not fail */
hAdvAPI32
=
GetModuleHandle
(
"advapi32.dll"
);
hAdvAPI32
=
GetModuleHandle
W
(
L
"advapi32.dll"
);
if
(
hAdvAPI32
==
NULL
)
return
win32_error
(
"GetModuleHandle"
,
NULL
);
...
...
PC/frozen_dllmain.c
View file @
50590f11
...
...
@@ -118,7 +118,7 @@ BOOL CallModuleDllMain(char *modName, DWORD dwReason)
BOOL
(
WINAPI
*
pfndllmain
)(
HINSTANCE
,
DWORD
,
LPVOID
);
char
funcName
[
255
];
HMODULE
hmod
=
GetModuleHandle
(
NULL
);
HMODULE
hmod
=
GetModuleHandle
W
(
NULL
);
strcpy
(
funcName
,
"_DllMain"
);
strcat
(
funcName
,
modName
);
strcat
(
funcName
,
"@12"
);
// stdcall convention.
...
...
PC/winreg.c
View file @
50590f11
...
...
@@ -1066,7 +1066,7 @@ PyDeleteKeyEx(PyObject *self, PyObject *args, PyObject *kwargs)
/* Only available on 64bit platforms, so we must load it
dynamically. */
hMod
=
GetModuleHandle
(
"advapi32.dll"
);
hMod
=
GetModuleHandle
W
(
L
"advapi32.dll"
);
if
(
hMod
)
pfn
=
(
RDKEFunc
)
GetProcAddress
(
hMod
,
"RegDeleteKeyExW"
);
...
...
@@ -1590,7 +1590,7 @@ PyDisableReflectionKey(PyObject *self, PyObject *args)
/* Only available on 64bit platforms, so we must load it
dynamically.*/
hMod
=
GetModuleHandle
(
"advapi32.dll"
);
hMod
=
GetModuleHandle
W
(
L
"advapi32.dll"
);
if
(
hMod
)
pfn
=
(
RDRKFunc
)
GetProcAddress
(
hMod
,
"RegDisableReflectionKey"
);
...
...
@@ -1626,7 +1626,7 @@ PyEnableReflectionKey(PyObject *self, PyObject *args)
/* Only available on 64bit platforms, so we must load it
dynamically.*/
hMod
=
GetModuleHandle
(
"advapi32.dll"
);
hMod
=
GetModuleHandle
W
(
L
"advapi32.dll"
);
if
(
hMod
)
pfn
=
(
RERKFunc
)
GetProcAddress
(
hMod
,
"RegEnableReflectionKey"
);
...
...
@@ -1663,7 +1663,7 @@ PyQueryReflectionKey(PyObject *self, PyObject *args)
/* Only available on 64bit platforms, so we must load it
dynamically.*/
hMod
=
GetModuleHandle
(
"advapi32.dll"
);
hMod
=
GetModuleHandle
W
(
L
"advapi32.dll"
);
if
(
hMod
)
pfn
=
(
RQRKFunc
)
GetProcAddress
(
hMod
,
"RegQueryReflectionKey"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment