NOTE => NOTES
[AROS.git] / arch / all-mingw32 / bootstrap / support.c
blob3be6a31704fd8a576faa6fd53b5eff10a274ef53
1 #include <stdio.h>
2 #include <windows.h>
4 #include "support.h"
6 char *DefaultConfig = "boot\\AROSBootstrap.conf";
7 OSVERSIONINFO winver;
9 #ifdef _UNICODE
10 #define VERSION_FORMAT "%s / Windows %lu.%lu build %lu %S"
11 #else
12 #define VERSION_FORMAT "%s / Windows %lu.%lu build %lu %s"
13 #endif
15 char *getosversion(const char *bsver)
17 static char SystemVersion[512];
19 winver.dwOSVersionInfoSize = sizeof(winver);
20 GetVersionEx(&winver);
21 sprintf(SystemVersion, VERSION_FORMAT, bsver, winver.dwMajorVersion, winver.dwMinorVersion, winver.dwBuildNumber, winver.szCSDVersion);
23 return SystemVersion;
26 char *namepart(char *name)
28 while (*name)
29 name++;
31 while((name[-1] != ':') && (name[-1] != '\\') && (name[-1] != '/'))
32 name--;
34 return name;
37 #ifdef _UNICODE
39 LPTSTR StrConvert(const char *src)
41 int len = strlen(src) + 1;
42 LPTSTR res = malloc(len * 2);
44 if (res)
46 if (!MultiByteToWideChar(CP_ACP, 0, src, -1, res, len))
48 free(res);
49 return NULL;
52 return res;
55 #endif