summaryrefslogtreecommitdiffhomepage
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/npclient/COMPILE.TXT4
-rw-r--r--contrib/npclient/npclient.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/contrib/npclient/COMPILE.TXT b/contrib/npclient/COMPILE.TXT
index e61b6c14..d355fbcc 100644
--- a/contrib/npclient/COMPILE.TXT
+++ b/contrib/npclient/COMPILE.TXT
@@ -6,6 +6,6 @@ CC=clang
CFLAGS='-Wall -Wextra -Wpedantic -Os -s -ffunction-sections -fdata-sections -Wl,--kill-at,--nxcompat,--dynamicbase,--as-needed,--gc-sections,--strip-all'
cd -- "$(dirname -- "$0")" &&
-PATH=/mingw32/bin:"$PATH" sh -c "$CC $CFLAGS -mdll -o NPClient.dll npclient.c" &&
-PATH=/mingw64/bin:"$PATH" sh -c "$CC $CFLAGS -mdll -o NPClient64.dll npclient.c" &&
+PATH=/mingw32/bin:"$PATH" sh -c "$CC -m32 $CFLAGS -mdll -o NPClient.dll npclient.c" &&
+PATH=/mingw64/bin:"$PATH" sh -c "$CC -m64 $CFLAGS -mdll -o NPClient64.dll npclient.c" &&
ls -l NPClient{64,}.dll && mv NPClient{64,}.dll ../../bin/
diff --git a/contrib/npclient/npclient.c b/contrib/npclient/npclient.c
index add5b4c1..42919d8f 100644
--- a/contrib/npclient/npclient.c
+++ b/contrib/npclient/npclient.c
@@ -349,8 +349,8 @@ NP_EXPORT(int) NP_GetData(tir_data_t * data)
else
{
running = false;
- // clamp to zero
- InterlockedExchange((LONG volatile*) &pMemData->data.DataID, -1);
+ // clamp to (-1) if still negative
+ (void)InterlockedCompareExchange((LONG volatile*) &pMemData->data.DataID, -1, data_id);
}
data->status = running ? NPCLIENT_STATUS_OK : NPCLIENT_STATUS_DISABLED;