[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: [PATCH] gdi32: Add DECLSPEC_HOTPATCH to GetDIBits
From:       Stefan_Dösinger <stefandoesinger () gmail ! com>
Date:       2018-06-30 9:34:29
Message-ID: 37C63148-9319-430A-BA36-2380F0347813 () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> Am 28.06.2018 um 17:28 schrieb Alex Henrie <alexhenrie24@gmail.com>:
> 
> Although this patch fixes the bug in question, Zeb and I would like to
> know: Since all exported Windows API functions support hotpatching,[1]
> why do we add __attribute__((__ms_hook_prologue__)) attribute to
> functions ad hoc instead of making it part of the definitions of
> __stdcall and __cdecl in windef.h?
Alex asked me at Wineconf to comment on this.

When I added __ms_hook_prologue__ to gcc a long time ago we did not anticipate a high \
number of functions to need it. In 32 bit x86 code it adds minor overhead - there is \
a 2 byte nop at the start of every function that uses it. Having it on all functions \
was considered unnecessary and wasteful. On x64 this nop is 8 bytes long.

At the time I worked on this Windows only made regular exported functions \
hotpatchable (what we have in our .spec files), but not e.g. COM methods. But Windows \
applications hook COM methods too, we wanted to be able to make static functions \
hotpatchable. On Windows this is a compiler option: \
https://docs.microsoft.com/en-us/cpp/build/reference/hotpatch-create-hotpatchable-image \
<https://docs.microsoft.com/en-us/cpp/build/reference/hotpatch-create-hotpatchable-image> \
. Doing the same thing would not work for us because we still have to make sure that \
e.g. IDirect3DDevice9::Present does not contain code that Steam et all cannot handle.


[Attachment #5 (unknown)]

<html><head><meta http-equiv="Content-Type" content="text/html; \
charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: \
space; line-break: after-white-space;" class=""><br class=""><div><br \
class=""><blockquote type="cite" class=""><div class="">Am 28.06.2018 um 17:28 \
schrieb Alex Henrie &lt;<a href="mailto:alexhenrie24@gmail.com" \
class="">alexhenrie24@gmail.com</a>&gt;:</div><br \
class="Apple-interchange-newline"><div class=""><span style="caret-color: rgb(0, 0, \
0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: \
normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: \
0px; text-transform: none; white-space: normal; word-spacing: 0px; \
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline \
!important;" class="">Although this patch fixes the bug in question, Zeb and I would \
like to</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; \
font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; \
letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; \
text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: \
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; \
font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; \
text-transform: none; white-space: normal; word-spacing: 0px; \
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline \
!important;" class="">know: Since all exported Windows API functions support \
hotpatching,[1]</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; \
font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; \
letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; \
text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: \
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; \
font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; \
text-transform: none; white-space: normal; word-spacing: 0px; \
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline \
!important;" class="">why do we add __attribute__((__ms_hook_prologue__)) attribute \
to</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: \
12px; font-style: normal; font-variant-caps: normal; font-weight: normal; \
letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; \
text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: \
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; \
font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; \
text-transform: none; white-space: normal; word-spacing: 0px; \
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline \
!important;" class="">functions ad hoc instead of making it part of the definitions \
of</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: \
12px; font-style: normal; font-variant-caps: normal; font-weight: normal; \
letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; \
text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: \
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; \
font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; \
text-transform: none; white-space: normal; word-spacing: 0px; \
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline \
!important;" class="">__stdcall and __cdecl in windef.h?</span><br \
style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; \
font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: \
normal; text-align: start; text-indent: 0px; text-transform: none; white-space: \
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" \
class=""></div></blockquote></div>Alex asked me at Wineconf to comment on this.<div \
class=""><br class=""></div><div class="">When I added __ms_hook_prologue__ to gcc a \
long time ago we did not anticipate a high number of functions to need it. In 32 bit \
x86 code it adds minor overhead - there is a 2 byte nop at the start of every \
function that uses it. Having it on all functions was considered unnecessary and \
wasteful. On x64 this nop is 8 bytes long.</div><div class=""><br class=""></div><div \
class="">At the time I worked on this Windows only made regular exported functions \
hotpatchable (what we have in our .spec files), but not e.g. COM methods. But Windows \
applications hook COM methods too, we wanted to be able to make static functions \
hotpatchable. On Windows this is a compiler option:&nbsp;<a \
href="https://docs.microsoft.com/en-us/cpp/build/reference/hotpatch-create-hotpatchable-image" \
class="">https://docs.microsoft.com/en-us/cpp/build/reference/hotpatch-create-hotpatchable-image</a>&nbsp;. \
Doing the same thing would not work for us because we still have to make sure that \
e.g. IDirect3DDevice9::Present does not contain code that Steam et all cannot \
handle.</div><div class=""><br class=""></div></body></html>


[Attachment #6 (text/plain)]




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic