\*****************************************************************************/
#include "windoze_helper.h"
-///#include "array.h"
-///#include "build_configuration.h"
-///#include "convert_utf.h"
-///#include "function.h"
-///#include "mutex.h"
-///#include "portable.h"
-///#include "set.h"
-///#include "version_record.h"
#include <configuration/application_configuration.h>
+#include <loggers/program_wide_logger.h>
///#include <errno.h>
///#include <stdlib.h>
*/
using namespace basis;
+using namespace loggers;
using namespace structures;
using namespace configuration;
#undef static_class_name
#define static_class_name() "windoze_helper"
+#define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s)
+
/*
//#define DEBUG_PORTABLE
// uncomment for noisy debugging.
message.message = 0;
message.wParam = 0;
message.lParam = 0;
- if (!PeekMessage(&message, NIL, 0, 0, PM_REMOVE))
+ if (!PeekMessage(&message, NULL_POINTER, 0, 0, PM_REMOVE))
return false;
TranslateMessage(&message);
DispatchMessage(&message);
return strerror(to_name);
#elif defined(__WIN32__)
char error_text[1000];
- FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NIL, to_name,
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL_POINTER, to_name,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)error_text,
- sizeof(error_text) - 1, NIL);
+ sizeof(error_text) - 1, NULL_POINTER);
istring to_return = error_text;
// trim off the ridiculous carriage return they add.
while ( (to_return[to_return.end()] == '\r')
.stuff(to_return[to_return.last()], len);
}
// add the sentinel to the list of strings.
- to_return += NIL;
+ to_return += NULL_POINTER;
#ifdef DEBUG_PORTABLE
for (int q = 0; to_return[q]; q++) {
printf("%d: %s\n", q, to_return[q]);
// }
}
istring parms = app_name + " " + command_line;
- bool success = CreateProcess(NIL, to_unicode_temp(parms), NIL, NIL, false,
- create_flag, NIL, NIL, &startup_info, &process_info);
+ bool success = CreateProcess(NULL_POINTER, to_unicode_temp(parms), NULL_POINTER, NULL_POINTER, false,
+ create_flag, NULL_POINTER, NULL_POINTER, &startup_info, &process_info);
if (!success)
return system_error();
// success then, merge back into stream.
case WIN_XP: return "WIN_XP";
case WIN_SRV2K3: return "WIN_SRV2K3";
case WIN_VISTA: return "WIN_VISTA";
- case WIN_SRV2K8: return "WIN_SRV2K8";
+ case WIN_7: return "WIN_7";
+ case WIN_8: return "WIN_8";
+ case WIN_10: return "WIN_10";
default: return "UNKNOWN_OS";
}
}
known_operating_systems determine_OS()
{
+ FUNCDEF("determine_OS");
version osver = application_configuration::get_OS_version();
if ( (osver.v_major() == 4) && (osver.v_minor() == 0) ) {
if (osver.v_revision() == VER_PLATFORM_WIN32_WINDOWS) return WIN_95;
return WIN_SRV2K3;
} else if ( (osver.v_major() == 6) && (osver.v_minor() == 0) ) {
return WIN_VISTA;
+// } else if ( (osver.v_major() == 6) && (osver.v_minor() == 1) ) {
+// return WIN_SRV2K8;
} else if ( (osver.v_major() == 6) && (osver.v_minor() == 1) ) {
- return WIN_SRV2K8;
+ return WIN_7;
+ } else if ( (osver.v_major() == 6) && (osver.v_minor() == 2) ) {
+ return WIN_8;
+ } else if ( (osver.v_major() == 10) && (osver.v_minor() == 0) ) {
+ return WIN_10;
}
+
+//temp
+LOG(a_sprintf("got a major OS of %d and minor OS of %d", osver.v_major(), osver.v_minor()));
+
return UNKNOWN_OS;
}