Skip to content

Instantly share code, notes, and snippets.

@BlockMen
Created January 15, 2014 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BlockMen/f5571751ad5dba9f5dc1 to your computer and use it in GitHub Desktop.
Save BlockMen/f5571751ad5dba9f5dc1 to your computer and use it in GitHub Desktop.
Patch for #1102
@@ -17,8 +17,6 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "jthread/jsemaphore.h"
-#include <assert.h>
-#include <windows.h>
JSemaphore::JSemaphore() {
m_hSemaphore = CreateSemaphore(
@@ -81,13 +79,13 @@ typedef LONG (NTAPI *_NtQuerySemaphore)(
ULONG MaximumCount;
} SEMAPHORE_BASIC_INFORMATION;
-NtQuerySemaphore =
+_NtQuerySemaphore newNtQuerySemaphore =
(_NtQuerySemaphore)
GetProcAddress
(GetModuleHandle ("ntdll.dll"), "NtQuerySemaphore");
int JSemaphore::GetValue() {
- _NtQuerySemaphore NtQuerySemaphore;
+ _NtQuerySemaphore NtQuerySemaphore = newNtQuerySemaphore;
SEMAPHORE_BASIC_INFORMATION BasicInfo;
LONG retval;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment