Remove some hardcode strings to En.rc Added: trunk/reactos/subsys/ntvdm/En.rc Modified: trunk/reactos/subsys/ntvdm/ntvdm.c Modified: trunk/reactos/subsys/ntvdm/ntvdm.rc Added: trunk/reactos/subsys/ntvdm/resource.h _____
Added: trunk/reactos/subsys/ntvdm/En.rc --- trunk/reactos/subsys/ntvdm/En.rc 2005-05-01 15:18:45 UTC (rev 14916) +++ trunk/reactos/subsys/ntvdm/En.rc 2005-05-01 17:32:09 UTC (rev 14917) @@ -0,0 +1,13 @@
+#include "resource.h" +/* + * Moved all hardcoded strings to En.rc. + * By Magnus Olsen 2005 + */ + +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT +STRINGTABLE DISCARDABLE +{ + +STRING_WelcomeMsg, "ReactOS Virtual DOS Machine support.\n" +STRING_PromptMsg, "Type r<cr> to run, s<cr> to shutdown or q<cr> to quit now." +} _____
Modified: trunk/reactos/subsys/ntvdm/ntvdm.c --- trunk/reactos/subsys/ntvdm/ntvdm.c 2005-05-01 15:18:45 UTC (rev 14916) +++ trunk/reactos/subsys/ntvdm/ntvdm.c 2005-05-01 17:32:09 UTC (rev 14917) @@ -15,6 +15,7 @@
#include <windows.h> #include <stdio.h> #include <wchar.h> +#include "resource.h"
#define NDEBUG #include <debug.h> @@ -205,6 +206,7 @@ SYSTEM_INFO inf; MEMORYSTATUS stat;
+ GlobalMemoryStatus(&stat); if (stat.dwLength != sizeof(MEMORYSTATUS)) { printf("WARNING: GlobalMemoryStatus() returned unknown structure version, size %ld, expected %d.\n", stat.dwLength, sizeof(stat)); @@ -223,6 +225,7 @@ //SetLastError(); return FALSE; } + }
GetSystemInfo(&inf); @@ -273,10 +276,13 @@ ULONG i; BOOL vdmStarted = FALSE;
- WCHAR WelcomeMsg[] = L"ReactOS Virtual DOS Machine support.\n"; - WCHAR PromptMsg[] = L"Type r<cr> to run, s<cr> to shutdown or q<cr> to quit now."; + TCHAR WelcomeMsg[RC_STRING_MAX_SIZE]; + TCHAR PromptMsg[RC_STRING_MAX_SIZE]; CHAR InputBuffer[255]; - + + LoadString( GetModuleHandle(NULL), STRING_WelcomeMsg, WelcomeMsg,sizeof(WelcomeMsg)); + LoadString( GetModuleHandle(NULL), STRING_PromptMsg, PromptMsg ,sizeof(PromptMsg)); + AllocConsole(); SetConsoleTitleW(L"ntvdm");
_____
Modified: trunk/reactos/subsys/ntvdm/ntvdm.rc --- trunk/reactos/subsys/ntvdm/ntvdm.rc 2005-05-01 15:18:45 UTC (rev 14916) +++ trunk/reactos/subsys/ntvdm/ntvdm.rc 2005-05-01 17:32:09 UTC (rev 14917) @@ -1,6 +1,10 @@
/* $Id$ */
+#include <windows.h> #define REACTOS_STR_FILE_DESCRIPTION "ReactOS Virtual DOS Machine\0" #define REACTOS_STR_INTERNAL_NAME "ntvdm\0" #define REACTOS_STR_ORIGINAL_FILENAME "ntvdm.exe\0" #include <reactos/version.rc> + +#include "En.rc" + _____
Added: trunk/reactos/subsys/ntvdm/resource.h --- trunk/reactos/subsys/ntvdm/resource.h 2005-05-01 15:18:45 UTC (rev 14916) +++ trunk/reactos/subsys/ntvdm/resource.h 2005-05-01 17:32:09 UTC (rev 14917) @@ -0,0 +1,6 @@
+#define RC_STRING_MAX_SIZE 2048 +#define STRING_WelcomeMsg 100 +#define STRING_PromptMsg 101 + + +/* EOF */