Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
500a2f95
Commit
500a2f95
authored
22 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
Partially implemented LdrLock/UnlockLoaderLock.
parent
114a31a2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
dlls/ntdll/loader.c
+34
-0
34 additions, 0 deletions
dlls/ntdll/loader.c
dlls/ntdll/ntdll.spec
+2
-0
2 additions, 0 deletions
dlls/ntdll/ntdll.spec
include/winternl.h
+8
-6
8 additions, 6 deletions
include/winternl.h
loader/module.c
+4
-2
4 additions, 2 deletions
loader/module.c
with
48 additions
and
8 deletions
dlls/ntdll/loader.c
+
34
−
0
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.@)
*
...
...
This diff is collapsed.
Click to expand it.
dlls/ntdll/ntdll.spec
+
2
−
0
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
...
...
This diff is collapsed.
Click to expand it.
include/winternl.h
+
8
−
6
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" */
...
...
This diff is collapsed.
Click to expand it.
loader/module.c
+
4
−
2
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment