/* $Id$
$State$
$Log$
+ Revision 1.171 2014/12/23 13:26:59 brouard
+ Summary: Back from Visual C
+
+ Still problem with utsname.h on Windows
+
Revision 1.170 2014/12/23 11:17:12 brouard
Summary: Cleaning some \%% back to %%
#ifdef _WIN32
#include <io.h>
+#include <windows.h>
+#include <tchar.h>
#else
#include <unistd.h>
#endif
return (1);
}
+#if defined(_MSC_VER)
+/*printf("Visual C++ compiler: %s \n;", _MSC_FULL_VER);*/
+/*fprintf(ficlog, "Visual C++ compiler: %s \n;", _MSC_FULL_VER);*/
+//#include "stdafx.h"
+//#include <stdio.h>
+//#include <tchar.h>
+//#include <windows.h>
+//#include <iostream>
+typedef BOOL(WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
+
+LPFN_ISWOW64PROCESS fnIsWow64Process;
+
+BOOL IsWow64()
+{
+ BOOL bIsWow64 = FALSE;
+
+ //typedef BOOL (APIENTRY *LPFN_ISWOW64PROCESS)
+ // (HANDLE, PBOOL);
+
+ //LPFN_ISWOW64PROCESS fnIsWow64Process;
+
+ HMODULE module = GetModuleHandle(_T("kernel32"));
+ const char funcName[] = "IsWow64Process";
+ fnIsWow64Process = (LPFN_ISWOW64PROCESS)
+ GetProcAddress(module, funcName);
+
+ if (NULL != fnIsWow64Process)
+ {
+ if (!fnIsWow64Process(GetCurrentProcess(),
+ &bIsWow64))
+ //throw std::exception("Unknown error");
+ printf("Unknown error\n");
+ }
+ return bIsWow64 != FALSE;
+}
+#endif
void syscompilerinfo()
{
/* #include "syscompilerinfo.h"*/
printf("GNU C version %d.\n", __GNUC_VERSION__);
fprintf(ficlog, "GNU C version %d.\n", __GNUC_VERSION__);
#endif
+
+ // void main()
+ // {
#if defined(_MSC_VER)
- /*printf("Visual C++ compiler: %s \n;", _MSC_FULL_VER);*/
- /*fprintf(ficlog, "Visual C++ compiler: %s \n;", _MSC_FULL_VER);*/
+ if (IsWow64())
+ printf("The process is running under WOW64.\n");
+ else
+ printf("The process is not running under WOW64.\n");
+
+ // printf("\nPress Enter to continue...");
+ // getchar();
+ // }
+
#endif
/* printf("GNU libc version: %s\n", gnu_get_libc_version()); */