Copyright clean-up (part 1):
[AROS.git] / arch / all-mingw32 / bootstrap / support.c
blob8024b9d8d25276abc139f591481f9b20474def15
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <stdio.h>
7 #include <windows.h>
9 #include "support.h"
11 char *DefaultConfig = ARCH "\\AROSBootstrap.conf";
12 OSVERSIONINFO winver;
14 #ifdef _UNICODE
15 #define VERSION_FORMAT "%s / Windows %lu.%lu build %lu %S"
16 #else
17 #define VERSION_FORMAT "%s / Windows %lu.%lu build %lu %s"
18 #endif
20 char *getosversion(const char *bsver)
22 static char SystemVersion[512];
24 winver.dwOSVersionInfoSize = sizeof(winver);
25 GetVersionEx(&winver);
26 sprintf(SystemVersion, VERSION_FORMAT, bsver, winver.dwMajorVersion, winver.dwMinorVersion, winver.dwBuildNumber, winver.szCSDVersion);
28 return SystemVersion;
31 char *namepart(char *name)
33 while (*name)
34 name++;
36 while((name[-1] != ':') && (name[-1] != '\\') && (name[-1] != '/'))
37 name--;
39 return name;
42 #ifdef _UNICODE
44 LPTSTR StrConvert(const char *src)
46 int len = strlen(src) + 1;
47 LPTSTR res = malloc(len * 2);
49 if (res)
51 if (!MultiByteToWideChar(CP_ACP, 0, src, -1, res, len))
53 free(res);
54 return NULL;
57 return res;
60 #endif