This is the repository for Discord Messenger's modern Windows API shim. Its aim is to implement a shim for certain APIs that were implemented in versions earlier than Discord Messenger targets.
It performs its duty by:
-
Using the actual procedures, when available, or
-
Providing an (admittedly maybe crappy, but passable) implementation of the function, if Windows did not provide us with its own version.
To use, simply embed the reimpl.cpp
and ri/reimpl.hpp
files in your project. Then you will
simply add ri::
to all uses of modern Windows APIs that are implemented by this project and call
ri::InitReimplementation()
before any of the code that uses it.
This is a list of functions shimmed, along with their implementation if Windows doesn't provide one.
-
GetFileSizeEx
- Implemented usingGetFileSize
. -
SetFilePointerEx
- Copied from https://github.com/enlyze/EnlyzeWinCompatLib/blob/master/src/winnt_40.cpp#L43 -
VerSetConditionMask
- Copied from ReactOS' implementation -
VerifyVersionInfo
- Implemented usingGetVersionEx
. -
RegisterWaitForSingleObject
- ReturnsINVALID_HANDLE_VALUE
throughphNewWaitObject
andFALSE
to the caller. Not implemented. -
UnregisterWaitEx
- Not implemented, returnsFALSE
. -
GradientFill
- Not implemented, returnsFALSE
. -
AlphaBlend
- Not implemented, simply callsStretchBlt
. -
TransparentBlt
- Not implemented, simply callsStretchBlt
. -
SHGetFolderPath
- Not implemented, just returns"."
. -
PathFileExists
- Implemented usingGetFileAttributes
. -
GetMenuInfo
- Not implemented, returnsFALSE
. -
SetMenuInfo
- Not implemented, returnsFALSE
. -
GetGestureInfo
- Not implemented, returnsFALSE
. -
SetDCBrushColor
- Not implemented, returns0
. -
SetDCPenColor
- Not implemented, returns0
. -
MonitorFromPoint
- Returns a fake magic value to be passed intoGetMonitorInfo
. -
GetMonitorInfo
- Simulates fetching information about the primary monitor usingGetSystemMetrics
. -
AnimateWindow
- Hides or shows the window based on the flags parameter. Animation related flags are ignored.
This project is licensed under the MIT license. See the license file for details.