Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
5a8d7328
Commit
5a8d7328
authored
May 28, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fix LdrLockLoaderLock()/LdrUnlockLoaderLock() on 64bit.
parent
a0c2d641
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
19 deletions
+21
-19
module.c
dlls/kernel32/module.c
+4
-3
loader.c
dlls/kernel32/tests/loader.c
+3
-3
actctx.c
dlls/ntdll/actctx.c
+2
-2
loader.c
dlls/ntdll/loader.c
+2
-2
rtl.c
dlls/ntdll/tests/rtl.c
+8
-7
winternl.h
include/winternl.h
+2
-2
No files found.
dlls/kernel32/module.c
View file @
5a8d7328
...
...
@@ -538,7 +538,7 @@ BOOL WINAPI GetModuleHandleExW( DWORD flags, LPCWSTR name, HMODULE *module )
{
NTSTATUS
status
=
STATUS_SUCCESS
;
HMODULE
ret
;
ULONG
magic
;
ULONG
_PTR
magic
;
BOOL
lock
;
if
(
!
module
)
...
...
@@ -666,7 +666,8 @@ DWORD WINAPI GetModuleFileNameA(
*/
DWORD
WINAPI
GetModuleFileNameW
(
HMODULE
hModule
,
LPWSTR
lpFileName
,
DWORD
size
)
{
ULONG
magic
,
len
=
0
;
ULONG
len
=
0
;
ULONG_PTR
magic
;
LDR_MODULE
*
pldr
;
NTSTATUS
nts
;
WIN16_SUBSYSTEM_TIB
*
win16_tib
;
...
...
@@ -911,7 +912,7 @@ static HMODULE load_library( const UNICODE_STRING *libname, DWORD flags )
if
(
flags
&
LOAD_LIBRARY_AS_DATAFILE
)
{
ULONG
magic
;
ULONG
_PTR
magic
;
LdrLockLoaderLock
(
0
,
NULL
,
&
magic
);
if
(
!
LdrGetDllHandle
(
load_path
,
flags
,
libname
,
&
hModule
))
...
...
dlls/kernel32/tests/loader.c
View file @
5a8d7328
...
...
@@ -61,8 +61,8 @@ static void (WINAPI *pLdrShutdownProcess)(void);
static
BOOLEAN
(
WINAPI
*
pRtlDllShutdownInProgress
)(
void
);
static
NTSTATUS
(
WINAPI
*
pNtAllocateVirtualMemory
)(
HANDLE
,
PVOID
*
,
ULONG
,
SIZE_T
*
,
ULONG
,
ULONG
);
static
NTSTATUS
(
WINAPI
*
pNtFreeVirtualMemory
)(
HANDLE
,
PVOID
*
,
SIZE_T
*
,
ULONG
);
static
NTSTATUS
(
WINAPI
*
pLdrLockLoaderLock
)(
ULONG
,
ULONG
*
,
ULONG
*
);
static
NTSTATUS
(
WINAPI
*
pLdrUnlockLoaderLock
)(
ULONG
,
ULONG
);
static
NTSTATUS
(
WINAPI
*
pLdrLockLoaderLock
)(
ULONG
,
ULONG
*
,
ULONG
_PTR
*
);
static
NTSTATUS
(
WINAPI
*
pLdrUnlockLoaderLock
)(
ULONG
,
ULONG
_PTR
);
static
void
(
WINAPI
*
pRtlAcquirePebLock
)(
void
);
static
void
(
WINAPI
*
pRtlReleasePebLock
)(
void
);
static
PVOID
(
WINAPI
*
pResolveDelayLoadedAPI
)(
PVOID
,
PCIMAGE_DELAYLOAD_DESCRIPTOR
,
...
...
@@ -1367,7 +1367,7 @@ static DWORD WINAPI mutex_thread_proc(void *param)
if
(
ret
==
WAIT_OBJECT_0
)
break
;
else
if
(
ret
==
WAIT_OBJECT_0
+
1
)
{
ULONG
loader_lock_magic
;
ULONG
_PTR
loader_lock_magic
;
trace
(
"%04u: mutex_thread_proc: Entering loader lock
\n
"
,
GetCurrentThreadId
());
ret
=
pLdrLockLoaderLock
(
0
,
NULL
,
&
loader_lock_magic
);
ok
(
!
ret
,
"LdrLockLoaderLock error %#x
\n
"
,
ret
);
...
...
dlls/ntdll/actctx.c
View file @
5a8d7328
...
...
@@ -2435,7 +2435,7 @@ static NTSTATUS open_nt_file( HANDLE *handle, UNICODE_STRING *name )
static
NTSTATUS
get_module_filename
(
HMODULE
module
,
UNICODE_STRING
*
str
,
unsigned
int
extra_len
)
{
NTSTATUS
status
;
ULONG
magic
;
ULONG
_PTR
magic
;
LDR_MODULE
*
pldr
;
LdrLockLoaderLock
(
0
,
NULL
,
&
magic
);
...
...
@@ -2934,7 +2934,7 @@ static NTSTATUS find_query_actctx( HANDLE *handle, DWORD flags, ULONG class )
}
else
if
(
flags
&
(
QUERY_ACTCTX_FLAG_ACTCTX_IS_ADDRESS
|
QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE
))
{
ULONG
magic
;
ULONG
_PTR
magic
;
LDR_MODULE
*
pldr
;
if
(
!*
handle
)
return
STATUS_INVALID_PARAMETER
;
...
...
dlls/ntdll/loader.c
View file @
5a8d7328
...
...
@@ -1340,7 +1340,7 @@ NTSTATUS WINAPI LdrFindEntryForAddress(const void* addr, PLDR_MODULE* pmod)
* Note: some flags are not implemented.
* Flag 0x01 is used to raise exceptions on errors.
*/
NTSTATUS
WINAPI
LdrLockLoaderLock
(
ULONG
flags
,
ULONG
*
result
,
ULONG
*
magic
)
NTSTATUS
WINAPI
LdrLockLoaderLock
(
ULONG
flags
,
ULONG
*
result
,
ULONG
_PTR
*
magic
)
{
if
(
flags
&
~
0x2
)
FIXME
(
"flags %x not supported
\n
"
,
flags
);
...
...
@@ -1372,7 +1372,7 @@ NTSTATUS WINAPI LdrLockLoaderLock( ULONG flags, ULONG *result, ULONG *magic )
/******************************************************************
* LdrUnlockLoaderUnlock (NTDLL.@)
*/
NTSTATUS
WINAPI
LdrUnlockLoaderLock
(
ULONG
flags
,
ULONG
magic
)
NTSTATUS
WINAPI
LdrUnlockLoaderLock
(
ULONG
flags
,
ULONG
_PTR
magic
)
{
if
(
magic
)
{
...
...
dlls/ntdll/tests/rtl.c
View file @
5a8d7328
...
...
@@ -90,8 +90,8 @@ static CHAR * (WINAPI *pRtlIpv4AddressToStringA)(const IN_ADDR *, LPSTR);
static
NTSTATUS
(
WINAPI
*
pRtlIpv4AddressToStringExA
)(
const
IN_ADDR
*
,
USHORT
,
LPSTR
,
PULONG
);
static
NTSTATUS
(
WINAPI
*
pRtlIpv4StringToAddressA
)(
PCSTR
,
BOOLEAN
,
PCSTR
*
,
IN_ADDR
*
);
static
NTSTATUS
(
WINAPI
*
pLdrAddRefDll
)(
ULONG
,
HMODULE
);
static
NTSTATUS
(
WINAPI
*
pLdrLockLoaderLock
)(
ULONG
,
ULONG
*
,
ULONG
*
);
static
NTSTATUS
(
WINAPI
*
pLdrUnlockLoaderLock
)(
ULONG
,
ULONG
);
static
NTSTATUS
(
WINAPI
*
pLdrLockLoaderLock
)(
ULONG
,
ULONG
*
,
ULONG
_PTR
*
);
static
NTSTATUS
(
WINAPI
*
pLdrUnlockLoaderLock
)(
ULONG
,
ULONG
_PTR
);
static
HMODULE
hkernel32
=
0
;
static
BOOL
(
WINAPI
*
pIsWow64Process
)(
HANDLE
,
PBOOL
);
...
...
@@ -1549,7 +1549,8 @@ static void test_LdrAddRefDll(void)
static
void
test_LdrLockLoaderLock
(
void
)
{
ULONG
result
,
magic
;
ULONG_PTR
magic
;
ULONG
result
;
NTSTATUS
status
;
if
(
!
pLdrLockLoaderLock
)
...
...
@@ -1564,12 +1565,12 @@ static void test_LdrLockLoaderLock(void)
status
=
pLdrLockLoaderLock
(
0x10
,
&
result
,
&
magic
);
ok
(
status
==
STATUS_INVALID_PARAMETER_1
,
"got 0x%08x
\n
"
,
status
);
ok
(
result
==
0
,
"got %d
\n
"
,
result
);
ok
(
magic
==
0
,
"got
0x%08
x
\n
"
,
magic
);
ok
(
magic
==
0
,
"got
%l
x
\n
"
,
magic
);
magic
=
0xdeadbeef
;
status
=
pLdrLockLoaderLock
(
0x10
,
NULL
,
&
magic
);
ok
(
status
==
STATUS_INVALID_PARAMETER_1
,
"got 0x%08x
\n
"
,
status
);
ok
(
magic
==
0
,
"got
0x%08
x
\n
"
,
magic
);
ok
(
magic
==
0
,
"got
%l
x
\n
"
,
magic
);
result
=
10
;
status
=
pLdrLockLoaderLock
(
0x10
,
&
result
,
NULL
);
...
...
@@ -1580,7 +1581,7 @@ static void test_LdrLockLoaderLock(void)
magic
=
0xdeadbeef
;
status
=
pLdrLockLoaderLock
(
0x2
,
NULL
,
&
magic
);
ok
(
status
==
STATUS_INVALID_PARAMETER_2
,
"got 0x%08x
\n
"
,
status
);
ok
(
magic
==
0
,
"got
0x%08
x
\n
"
,
magic
);
ok
(
magic
==
0
,
"got
%l
x
\n
"
,
magic
);
/* magic pointer is null */
result
=
10
;
...
...
@@ -1594,7 +1595,7 @@ static void test_LdrLockLoaderLock(void)
status
=
pLdrLockLoaderLock
(
0x2
,
&
result
,
&
magic
);
ok
(
status
==
STATUS_SUCCESS
,
"got 0x%08x
\n
"
,
status
);
ok
(
result
==
1
,
"got %d
\n
"
,
result
);
ok
(
magic
!=
0
,
"got
0x%08
x
\n
"
,
magic
);
ok
(
magic
!=
0
,
"got
%l
x
\n
"
,
magic
);
pLdrUnlockLoaderLock
(
0
,
magic
);
}
...
...
include/winternl.h
View file @
5a8d7328
...
...
@@ -2020,14 +2020,14 @@ NTSYSAPI NTSTATUS WINAPI LdrGetDllHandle(LPCWSTR, ULONG, const UNICODE_STRING*,
NTSYSAPI
NTSTATUS
WINAPI
LdrGetProcedureAddress
(
HMODULE
,
const
ANSI_STRING
*
,
ULONG
,
void
**
);
NTSYSAPI
void
WINAPI
LdrInitializeThunk
(
void
*
,
ULONG_PTR
,
ULONG_PTR
,
ULONG_PTR
);
NTSYSAPI
NTSTATUS
WINAPI
LdrLoadDll
(
LPCWSTR
,
DWORD
,
const
UNICODE_STRING
*
,
HMODULE
*
);
NTSYSAPI
NTSTATUS
WINAPI
LdrLockLoaderLock
(
ULONG
,
ULONG
*
,
ULONG
*
);
NTSYSAPI
NTSTATUS
WINAPI
LdrLockLoaderLock
(
ULONG
,
ULONG
*
,
ULONG
_PTR
*
);
IMAGE_BASE_RELOCATION
*
WINAPI
LdrProcessRelocationBlock
(
void
*
,
UINT
,
USHORT
*
,
INT_PTR
);
NTSYSAPI
NTSTATUS
WINAPI
LdrQueryImageFileExecutionOptions
(
const
UNICODE_STRING
*
,
LPCWSTR
,
ULONG
,
void
*
,
ULONG
,
ULONG
*
);
NTSYSAPI
NTSTATUS
WINAPI
LdrQueryProcessModuleInformation
(
SYSTEM_MODULE_INFORMATION
*
,
ULONG
,
ULONG
*
);
NTSYSAPI
void
WINAPI
LdrShutdownProcess
(
void
);
NTSYSAPI
void
WINAPI
LdrShutdownThread
(
void
);
NTSYSAPI
NTSTATUS
WINAPI
LdrUnloadDll
(
HMODULE
);
NTSYSAPI
NTSTATUS
WINAPI
LdrUnlockLoaderLock
(
ULONG
,
ULONG
);
NTSYSAPI
NTSTATUS
WINAPI
LdrUnlockLoaderLock
(
ULONG
,
ULONG
_PTR
);
NTSYSAPI
NTSTATUS
WINAPI
NtAcceptConnectPort
(
PHANDLE
,
ULONG
,
PLPC_MESSAGE
,
BOOLEAN
,
PLPC_SECTION_WRITE
,
PLPC_SECTION_READ
);
NTSYSAPI
NTSTATUS
WINAPI
NtAccessCheck
(
PSECURITY_DESCRIPTOR
,
HANDLE
,
ACCESS_MASK
,
PGENERIC_MAPPING
,
PPRIVILEGE_SET
,
PULONG
,
PULONG
,
NTSTATUS
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtAccessCheckAndAuditAlarm
(
PUNICODE_STRING
,
HANDLE
,
PUNICODE_STRING
,
PUNICODE_STRING
,
PSECURITY_DESCRIPTOR
,
ACCESS_MASK
,
PGENERIC_MAPPING
,
BOOLEAN
,
PACCESS_MASK
,
PBOOLEAN
,
PBOOLEAN
);
...
...
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