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
7c0b3a40
Commit
7c0b3a40
authored
Nov 25, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecrt0: Call __wine_unix_call through an explicit pointer in the helper macro.
parent
12a12958
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
34 deletions
+21
-34
unix_lib.c
dlls/winecrt0/unix_lib.c
+15
-30
loader.c
dlls/winevulkan/loader.c
+4
-3
unixlib.h
include/wine/unixlib.h
+2
-1
No files found.
dlls/winecrt0/unix_lib.c
View file @
7c0b3a40
...
...
@@ -27,34 +27,6 @@
#include "winternl.h"
#include "wine/unixlib.h"
#ifdef __WINE_PE_BUILD
static
NTSTATUS
(
WINAPI
*
p__wine_unix_call
)(
unixlib_handle_t
,
unsigned
int
,
void
*
);
static
void
load_func
(
void
**
func
,
const
char
*
name
,
void
*
def
)
{
if
(
!*
func
)
{
HMODULE
module
=
GetModuleHandleW
(
L"ntdll.dll"
);
void
*
proc
=
GetProcAddress
(
module
,
name
);
InterlockedExchangePointer
(
func
,
proc
?
proc
:
def
);
}
}
#define LOAD_FUNC(name) load_func( (void **)&p ## name, #name, fallback ## name )
static
NTSTATUS
__cdecl
fallback__wine_unix_call
(
unixlib_handle_t
handle
,
unsigned
int
code
,
void
*
args
)
{
return
STATUS_DLL_NOT_FOUND
;
}
NTSTATUS
WINAPI
__wine_unix_call
(
unixlib_handle_t
handle
,
unsigned
int
code
,
void
*
args
)
{
LOAD_FUNC
(
__wine_unix_call
);
return
p__wine_unix_call
(
handle
,
code
,
args
);
}
#endif
/* __WINE_PE_BUILD */
static
inline
void
*
image_base
(
void
)
{
#ifdef __WINE_PE_BUILD
...
...
@@ -66,10 +38,23 @@ static inline void *image_base(void)
#endif
}
static
NTSTATUS
WINAPI
unix_call_fallback
(
unixlib_handle_t
handle
,
unsigned
int
code
,
void
*
args
)
{
return
STATUS_DLL_NOT_FOUND
;
}
unixlib_handle_t
__wine_unixlib_handle
=
0
;
NTSTATUS
(
WINAPI
*
__wine_unix_call_ptr
)(
unixlib_handle_t
,
unsigned
int
,
void
*
)
=
unix_call_fallback
;
NTSTATUS
WINAPI
__wine_init_unix_call
(
void
)
{
return
NtQueryVirtualMemory
(
GetCurrentProcess
(),
image_base
(),
MemoryWineUnixFuncs
,
&
__wine_unixlib_handle
,
sizeof
(
__wine_unixlib_handle
),
NULL
);
NTSTATUS
status
;
HMODULE
module
=
GetModuleHandleW
(
L"ntdll.dll"
);
void
*
proc
=
GetProcAddress
(
module
,
"__wine_unix_call"
);
if
(
!
proc
)
return
STATUS_DLL_NOT_FOUND
;
status
=
NtQueryVirtualMemory
(
GetCurrentProcess
(),
image_base
(),
MemoryWineUnixFuncs
,
&
__wine_unixlib_handle
,
sizeof
(
__wine_unixlib_handle
),
NULL
);
if
(
!
status
)
__wine_unix_call_ptr
=
proc
;
return
status
;
}
dlls/winevulkan/loader.c
View file @
7c0b3a40
...
...
@@ -35,7 +35,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
DEFINE_DEVPROPKEY
(
DEVPROPKEY_GPU_LUID
,
0x60b193cb
,
0x5276
,
0x4d0f
,
0x96
,
0xfc
,
0xf1
,
0x73
,
0xab
,
0xad
,
0x3e
,
0xc6
,
2
);
DEFINE_DEVPROPKEY
(
WINE_DEVPROPKEY_GPU_VULKAN_UUID
,
0x233a9ef3
,
0xafc4
,
0x4abd
,
0xb5
,
0x64
,
0xc3
,
0x2f
,
0x21
,
0xf1
,
0x53
,
0x5c
,
2
);
NTSTATUS
(
WINAPI
*
p_vk_direct_unix_call
)(
unixlib_handle_t
handle
,
unsigned
int
code
,
void
*
args
)
=
__wine_unix_call
;
NTSTATUS
(
WINAPI
*
p_vk_direct_unix_call
)(
unixlib_handle_t
handle
,
unsigned
int
code
,
void
*
args
)
=
NULL
;
static
HINSTANCE
hinstance
;
...
...
@@ -234,9 +234,10 @@ VkResult WINAPI vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t *supported_ver
static
BOOL
WINAPI
wine_vk_init
(
INIT_ONCE
*
once
,
void
*
param
,
void
**
context
)
{
if
(
__wine_init_unix_call
())
return
FALSE
;
NTSTATUS
status
=
__wine_init_unix_call
();
p_vk_direct_unix_call
=
__wine_unix_call_ptr
;
if
(
status
)
return
FALSE
;
return
!
vk_unix_call
(
unix_init
,
&
p_vk_direct_unix_call
);
}
...
...
include/wine/unixlib.h
View file @
7c0b3a40
...
...
@@ -268,9 +268,10 @@ static inline ULONG ntdll_wcstoul( const WCHAR *s, WCHAR **end, int base )
#else
/* WINE_UNIX_LIB */
extern
unixlib_handle_t
__wine_unixlib_handle
DECLSPEC_HIDDEN
;
extern
NTSTATUS
(
WINAPI
*
__wine_unix_call_ptr
)(
unixlib_handle_t
,
unsigned
int
,
void
*
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
WINAPI
__wine_init_unix_call
(
void
)
DECLSPEC_HIDDEN
;
#define WINE_UNIX_CALL(code,args) __wine_unix_call( __wine_unixlib_handle, (code), (args) )
#define WINE_UNIX_CALL(code,args) __wine_unix_call
_ptr
( __wine_unixlib_handle, (code), (args) )
#endif
/* WINE_UNIX_LIB */
...
...
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