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
500a2f95
Commit
500a2f95
authored
Mar 20, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Partially implemented LdrLock/UnlockLoaderLock.
parent
114a31a2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
8 deletions
+48
-8
loader.c
dlls/ntdll/loader.c
+34
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+2
-0
winternl.h
include/winternl.h
+8
-6
module.c
loader/module.c
+4
-2
No files found.
dlls/ntdll/loader.c
View file @
500a2f95
...
...
@@ -210,6 +210,40 @@ WINE_MODREF *MODULE_FindModule(LPCSTR path)
return
wm
;
}
/******************************************************************
* LdrLockLoaderLock (NTDLL.@)
*
* Note: flags are not implemented.
* Flag 0x01 is used to raise exceptions on errors.
* Flag 0x02 is used to avoid waiting on the section (does RtlTryEnterCriticalSection instead).
*/
NTSTATUS
WINAPI
LdrLockLoaderLock
(
ULONG
flags
,
ULONG
*
result
,
ULONG
*
magic
)
{
if
(
flags
)
FIXME
(
"flags %lx not supported
\n
"
,
flags
);
if
(
result
)
*
result
=
1
;
if
(
!
magic
)
return
STATUS_INVALID_PARAMETER_3
;
RtlEnterCriticalSection
(
&
loader_section
);
*
magic
=
GetCurrentThreadId
();
return
STATUS_SUCCESS
;
}
/******************************************************************
* LdrUnlockLoaderUnlock (NTDLL.@)
*/
NTSTATUS
WINAPI
LdrUnlockLoaderLock
(
ULONG
flags
,
ULONG
magic
)
{
if
(
magic
)
{
if
(
magic
!=
GetCurrentThreadId
())
return
STATUS_INVALID_PARAMETER_2
;
RtlLeaveCriticalSection
(
&
loader_section
);
}
return
STATUS_SUCCESS
;
}
/******************************************************************
* LdrGetDllHandle (NTDLL.@)
*
...
...
dlls/ntdll/ntdll.spec
View file @
500a2f95
...
...
@@ -43,12 +43,14 @@
@ stdcall LdrGetProcedureAddress(ptr ptr long ptr)
@ stub LdrInitializeThunk
@ stdcall LdrLoadDll(wstr long ptr ptr)
@ stdcall LdrLockLoaderLock(long ptr ptr)
@ stub LdrProcessRelocationBlock
@ stub LdrQueryImageFileExecutionOptions
@ stub LdrQueryProcessModuleInformation
@ stdcall LdrShutdownProcess()
@ stdcall LdrShutdownThread()
@ stdcall LdrUnloadDll(ptr)
@ stdcall LdrUnlockLoaderLock(long long)
@ stub LdrVerifyImageMatchesChecksum
@ stub NPXEMULATORTABLE
@ extern NlsAnsiCodePage
...
...
include/winternl.h
View file @
500a2f95
...
...
@@ -1204,19 +1204,21 @@ typedef struct _LDR_RESOURCE_INFO
ULONG
Language
;
}
LDR_RESOURCE_INFO
,
*
PLDR_RESOURCE_INFO
;
NTSTATUS
WINAPI
LdrAccessResource
(
HMODULE
,
PIMAGE_RESOURCE_DATA_ENTRY
,
void
**
,
PULONG
);
NTSTATUS
WINAPI
LdrDisableThreadCalloutsForDll
(
HMODULE
);
NTSTATUS
WINAPI
LdrFindEntryForAddress
(
const
void
*
,
PLDR_MODULE
*
);
NTSTATUS
WINAPI
LdrFindResourceDirectory_U
(
HMODULE
,
PLDR_RESOURCE_INFO
,
DWORD
,
PIMAGE_RESOURCE_DIRECTORY_ENTRY
*
);
NTSTATUS
WINAPI
LdrFindResource_U
(
HMODULE
,
PLDR_RESOURCE_INFO
,
ULONG
,
PIMAGE_RESOURCE_DATA_ENTRY
*
);
NTSTATUS
WINAPI
LdrGetDllHandle
(
ULONG
,
ULONG
,
PUNICODE_STRING
,
HMODULE
*
);
NTSTATUS
WINAPI
LdrGetProcedureAddress
(
HMODULE
,
PANSI_STRING
,
ULONG
,
void
**
);
NTSTATUS
WINAPI
LdrLoadDll
(
LPCWSTR
,
DWORD
,
PUNICODE_STRING
,
HMODULE
*
);
NTSTATUS
WINAPI
Ldr
ShutdownThread
(
void
);
NTSTATUS
WINAPI
Ldr
LockLoaderLock
(
ULONG
,
ULONG
*
,
ULONG
*
);
NTSTATUS
WINAPI
LdrShutdownProcess
(
void
);
NTSTATUS
WINAPI
LdrShutdownThread
(
void
);
NTSTATUS
WINAPI
LdrUnloadDll
(
HMODULE
);
NTSTATUS
WINAPI
LdrAccessResource
(
HMODULE
,
PIMAGE_RESOURCE_DATA_ENTRY
,
void
**
,
PULONG
);
NTSTATUS
WINAPI
LdrFindResourceDirectory_U
(
HMODULE
,
PLDR_RESOURCE_INFO
,
DWORD
,
PIMAGE_RESOURCE_DIRECTORY_ENTRY
*
);
NTSTATUS
WINAPI
LdrFindResource_U
(
HMODULE
,
PLDR_RESOURCE_INFO
,
ULONG
,
PIMAGE_RESOURCE_DATA_ENTRY
*
);
NTSTATUS
WINAPI
LdrUnlockLoaderLock
(
ULONG
,
ULONG
);
#ifdef __cplusplus
}
/* extern "C" */
...
...
loader/module.c
View file @
500a2f95
...
...
@@ -948,9 +948,11 @@ DWORD WINAPI GetModuleFileNameA(
*/
DWORD
WINAPI
GetModuleFileNameW
(
HMODULE
hModule
,
LPWSTR
lpFileName
,
DWORD
size
)
{
ULONG
magic
;
lpFileName
[
0
]
=
0
;
RtlEnterCriticalSection
(
&
loader_section
);
LdrLockLoaderLock
(
0
,
NULL
,
&
magic
);
if
(
!
hModule
&&
!
(
NtCurrentTeb
()
->
tibflags
&
TEBF_WIN32
))
{
/* 16-bit task - get current NE module name */
...
...
@@ -974,7 +976,7 @@ DWORD WINAPI GetModuleFileNameW( HMODULE hModule, LPWSTR lpFileName, DWORD size
else
SetLastError
(
RtlNtStatusToDosError
(
nts
)
);
}
RtlLeaveCriticalSection
(
&
loader_section
);
LdrUnlockLoaderLock
(
0
,
magic
);
TRACE
(
"%s
\n
"
,
debugstr_w
(
lpFileName
)
);
return
strlenW
(
lpFileName
);
...
...
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