Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
87a33579
Commit
87a33579
authored
Nov 16, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winevulkan: Return error if vkMapMemory would truncate pointer on wow64.
parent
1396f04f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
2 deletions
+25
-2
make_vulkan
dlls/winevulkan/make_vulkan
+1
-0
vulkan.c
dlls/winevulkan/vulkan.c
+21
-0
vulkan_thunks.c
dlls/winevulkan/vulkan_thunks.c
+2
-2
vulkan_thunks.h
dlls/winevulkan/vulkan_thunks.h
+1
-0
No files found.
dlls/winevulkan/make_vulkan
View file @
87a33579
...
...
@@ -209,6 +209,7 @@ FUNCTION_OVERRIDES = {
"vkGetDeviceProcAddr"
:
{
"dispatch"
:
False
,
"driver"
:
True
,
"thunk"
:
ThunkType
.
NONE
,
"loader_thunk"
:
ThunkType
.
NONE
},
"vkGetDeviceQueue"
:
{
"dispatch"
:
True
,
"driver"
:
False
,
"thunk"
:
ThunkType
.
NONE
},
"vkGetDeviceQueue2"
:
{
"dispatch"
:
True
,
"driver"
:
False
,
"thunk"
:
ThunkType
.
NONE
},
"vkMapMemory"
:
{
"dispatch"
:
True
,
"driver"
:
False
,
"thunk"
:
ThunkType
.
PRIVATE
},
# VK_KHR_surface
"vkDestroySurfaceKHR"
:
{
"dispatch"
:
True
,
"driver"
:
True
,
"thunk"
:
ThunkType
.
NONE
},
...
...
dlls/winevulkan/vulkan.c
View file @
87a33579
...
...
@@ -1441,6 +1441,27 @@ void wine_vkDestroySurfaceKHR(VkInstance handle, VkSurfaceKHR surface,
free
(
object
);
}
VkResult
wine_vkMapMemory
(
VkDevice
handle
,
VkDeviceMemory
memory
,
VkDeviceSize
offset
,
VkDeviceSize
size
,
VkMemoryMapFlags
flags
,
void
**
data
)
{
struct
wine_device
*
device
=
wine_device_from_handle
(
handle
);
VkResult
result
;
result
=
device
->
funcs
.
p_vkMapMemory
(
device
->
device
,
memory
,
offset
,
size
,
flags
,
data
);
#ifdef _WIN64
if
(
NtCurrentTeb
()
->
WowTebOffset
&&
result
==
VK_SUCCESS
&&
(
UINT_PTR
)
*
data
>>
32
)
{
FIXME
(
"returned mapping %p does not fit 32-bit pointer
\n
"
,
*
data
);
device
->
funcs
.
p_vkUnmapMemory
(
device
->
device
,
memory
);
*
data
=
NULL
;
result
=
VK_ERROR_OUT_OF_HOST_MEMORY
;
}
#endif
return
result
;
}
static
inline
void
adjust_max_image_count
(
struct
wine_phys_dev
*
phys_dev
,
VkSurfaceCapabilitiesKHR
*
capabilities
)
{
/* Many Windows games, for example Strange Brigade, No Man's Sky, Path of Exile
...
...
dlls/winevulkan/vulkan_thunks.c
View file @
87a33579
...
...
@@ -38235,7 +38235,7 @@ static NTSTATUS thunk64_vkMapMemory(void *args)
TRACE
(
"%p, 0x%s, 0x%s, 0x%s, %#x, %p
\n
"
,
params
->
device
,
wine_dbgstr_longlong
(
params
->
memory
),
wine_dbgstr_longlong
(
params
->
offset
),
wine_dbgstr_longlong
(
params
->
size
),
params
->
flags
,
params
->
ppData
);
params
->
result
=
wine_
device_from_handle
(
params
->
device
)
->
funcs
.
p_vkMapMemory
(
wine_device_from_handle
(
params
->
device
)
->
device
,
params
->
memory
,
params
->
offset
,
params
->
size
,
params
->
flags
,
params
->
ppData
);
params
->
result
=
wine_
vkMapMemory
(
params
->
device
,
params
->
memory
,
params
->
offset
,
params
->
size
,
params
->
flags
,
params
->
ppData
);
return
STATUS_SUCCESS
;
}
#endif
/* _WIN64 */
...
...
@@ -38255,7 +38255,7 @@ static NTSTATUS thunk32_vkMapMemory(void *args)
TRACE
(
"%#x, 0x%s, 0x%s, 0x%s, %#x, %#x
\n
"
,
params
->
device
,
wine_dbgstr_longlong
(
params
->
memory
),
wine_dbgstr_longlong
(
params
->
offset
),
wine_dbgstr_longlong
(
params
->
size
),
params
->
flags
,
params
->
ppData
);
params
->
result
=
wine_
device_from_handle
((
VkDevice
)
UlongToPtr
(
params
->
device
))
->
funcs
.
p_vkMapMemory
(
wine_device_from_handle
((
VkDevice
)
UlongToPtr
(
params
->
device
))
->
device
,
params
->
memory
,
params
->
offset
,
params
->
size
,
params
->
flags
,
(
void
**
)
UlongToPtr
(
params
->
ppData
));
params
->
result
=
wine_
vkMapMemory
((
VkDevice
)
UlongToPtr
(
params
->
device
)
,
params
->
memory
,
params
->
offset
,
params
->
size
,
params
->
flags
,
(
void
**
)
UlongToPtr
(
params
->
ppData
));
return
STATUS_SUCCESS
;
}
dlls/winevulkan/vulkan_thunks.h
View file @
87a33579
...
...
@@ -50,6 +50,7 @@ VkResult wine_vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physica
VkResult
wine_vkGetPhysicalDeviceImageFormatProperties2KHR
(
VkPhysicalDevice
physicalDevice
,
const
VkPhysicalDeviceImageFormatInfo2
*
pImageFormatInfo
,
VkImageFormatProperties2
*
pImageFormatProperties
)
DECLSPEC_HIDDEN
;
VkResult
wine_vkGetPhysicalDeviceSurfaceCapabilities2KHR
(
VkPhysicalDevice
physicalDevice
,
const
VkPhysicalDeviceSurfaceInfo2KHR
*
pSurfaceInfo
,
VkSurfaceCapabilities2KHR
*
pSurfaceCapabilities
)
DECLSPEC_HIDDEN
;
VkResult
wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR
(
VkPhysicalDevice
physicalDevice
,
VkSurfaceKHR
surface
,
VkSurfaceCapabilitiesKHR
*
pSurfaceCapabilities
)
DECLSPEC_HIDDEN
;
VkResult
wine_vkMapMemory
(
VkDevice
device
,
VkDeviceMemory
memory
,
VkDeviceSize
offset
,
VkDeviceSize
size
,
VkMemoryMapFlags
flags
,
void
**
ppData
)
DECLSPEC_HIDDEN
;
/* For use by vkDevice and children */
struct
vulkan_device_funcs
...
...
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