Commit Graph

4 Commits

Author SHA1 Message Date
Charles Milette 827b89608c Maintenance: Remove stray tabs
Work towards #181
2021-03-18 12:51:45 -07:00
Michael Schmidt 9546ddb349 dynamic_alloc: Replace implicit type conversion with incorrect semantics by proper return value (#99)
The dynamic_alloc example fails to compile on Visual Studio 2015 due to an C4800 / C2220 compiler error (LONG status is used as return value). Apart from the performance warning, which is treated as error because of the /WX flag, the semantics of this operation seem to be wrong. At the end of the function, we find return status == NO_ERROR. That means that in line 70 a successful execution results in a return value of true and an unsuccessful execution results in false. However, if the function is left in line 52, the return code is true (because the test status != NO_ERROR was positive).

Fix this, and force /we4800 to be enabled to catch issues in the future. 

Co-authored-by: Brian Gianforcaro <bgianf@microsoft.com>
2020-08-28 07:49:13 +00:00
Jay Krell 6449a9036a Fix dynamic_alloc to build if UNICODE is defined. (#96)
People often copy Detours to other build environments, that
might define UNICODE by default.
2020-08-05 11:02:13 -07:00
tokikuch edc8b07ae7 Add a new sample dynamic_alloc to test a new API function (#55)
Add a new sample dynamic_alloc to test the new API function DetourAllocateRegionWithinJumpBounds.
2019-06-20 00:13:15 -07:00