/* Note: this will only work as long as jthread is directly linked to application */
/* it's gonna fail if someone tries to build jthread as dll */
-static _NtQuerySemaphore NtQuerySemaphore =
+static _NtQuerySemaphore NtQuerySemaphore =
(_NtQuerySemaphore)
- GetProcAddress
+ GetProcAddress
(GetModuleHandle ("ntdll.dll"), "NtQuerySemaphore");
int JSemaphore::GetValue() {
LONG retval;
assert(NtQuerySemaphore);
-
+
retval = NtQuerySemaphore (m_hSemaphore, 0,
&BasicInfo, sizeof (SEMAPHORE_BASIC_INFORMATION), NULL);
if (retval == ERROR_SUCCESS)
- {
return BasicInfo.CurrentCount;
- }
- else {
- assert("unable to read semaphore count" == 0);
- }
+
+ assert("unable to read semaphore count" == 0);
+ return 0;
}
for(std::vector<ModSpec>::const_iterator it = new_mods.begin();
it != new_mods.end(); ++it){
const ModSpec &mod = *it;
- if(mod.part_of_modpack != want_from_modpack)
+ if(mod.part_of_modpack != (bool)want_from_modpack)
continue;
if(existing_mods.count(mod.name) == 0){
// GOOD CASE: completely new mod.
bool detectMSVCBuildDir(char *c_path)
{
std::string path(c_path);
- const char *ends[] = {"bin\\Release", "bin\\Build", NULL};
+ const char *ends[] = {
+ "bin\\Release",
+ "bin\\Debug",
+ "bin\\Build",
+ NULL};
return (removeStringEnd(path, ends) != "");
}