[ros-diffs] [hbelusca] 76029: [CMD]: New CTTY command. - Introduce back the CTTY command (that normally only exists on DOS versions of COMMAND.COM but doesn't on Windows NT' CMD.EXE), whose aim is to

2017-10-02 Thread hbelusca
Author: hbelusca
Date: Mon Oct  2 17:03:01 2017
New Revision: 76029

URL: http://svn.reactos.org/svn/reactos?rev=76029&view=rev
Log:
[CMD]: New CTTY command.
- Introduce back the CTTY command (that normally only exists on DOS
  versions of COMMAND.COM but doesn't on Windows NT' CMD.EXE), whose aim
  is to "change the active terminal" (syntax: CTTY ). To
  achieve that we actually redirect STDIN, STDOUT and STDERR to read/write
  handles opened to the . This is very handy when it comes to
  redirecting all the standard handles to e.g. a serial terminal ("CTTY COM1"
  for example).
- Fix some typos in the resources.

Added:
trunk/reactos/base/shell/cmd/ctty.c   (with props)
Modified:
trunk/reactos/base/shell/cmd/CMakeLists.txt
trunk/reactos/base/shell/cmd/cmd.h
trunk/reactos/base/shell/cmd/cmdtable.c
trunk/reactos/base/shell/cmd/config.h
trunk/reactos/base/shell/cmd/lang/cs-CZ.rc
trunk/reactos/base/shell/cmd/lang/de-DE.rc
trunk/reactos/base/shell/cmd/lang/el-GR.rc
trunk/reactos/base/shell/cmd/lang/en-US.rc
trunk/reactos/base/shell/cmd/lang/es-ES.rc
trunk/reactos/base/shell/cmd/lang/fr-FR.rc
trunk/reactos/base/shell/cmd/lang/hu-HU.rc
trunk/reactos/base/shell/cmd/lang/id-ID.rc
trunk/reactos/base/shell/cmd/lang/it-IT.rc
trunk/reactos/base/shell/cmd/lang/ja-JP.rc
trunk/reactos/base/shell/cmd/lang/no-NO.rc
trunk/reactos/base/shell/cmd/lang/pl-PL.rc
trunk/reactos/base/shell/cmd/lang/ro-RO.rc
trunk/reactos/base/shell/cmd/lang/ru-RU.rc
trunk/reactos/base/shell/cmd/lang/sk-SK.rc
trunk/reactos/base/shell/cmd/lang/sq-AL.rc
trunk/reactos/base/shell/cmd/lang/sv-SE.rc
trunk/reactos/base/shell/cmd/lang/tr-TR.rc
trunk/reactos/base/shell/cmd/lang/uk-UA.rc
trunk/reactos/base/shell/cmd/lang/zh-CN.rc
trunk/reactos/base/shell/cmd/lang/zh-TW.rc
trunk/reactos/base/shell/cmd/redir.c
trunk/reactos/base/shell/cmd/resource.h

Modified: trunk/reactos/base/shell/cmd/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/CMakeLists.txt?rev=76029&r1=76028&r2=76029&view=diff
==
--- trunk/reactos/base/shell/cmd/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/CMakeLists.txt [iso-8859-1] Mon Oct  2 
17:03:01 2017
@@ -22,6 +22,7 @@
 color.c
 console.c
 copy.c
+ctty.c
 date.c
 del.c
 delay.c

Modified: trunk/reactos/base/shell/cmd/cmd.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.h?rev=76029&r1=76028&r2=76029&view=diff
==
--- trunk/reactos/base/shell/cmd/cmd.h  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmd.h  [iso-8859-1] Mon Oct  2 17:03:01 2017
@@ -71,7 +71,6 @@
 
 /* Prototypes for CALL.C */
 INT cmd_call (LPTSTR);
-
 
 /* Prototypes for CHOICE.C */
 INT CommandChoice (LPTSTR);
@@ -123,8 +122,12 @@
 
 VOID PrintCommandList (VOID);
 
-
 LPCTSTR GetParsedEnvVar ( LPCTSTR varName, UINT* varNameLen, BOOL ModeSetA );
+
+/* Prototypes for CTTY.C */
+#ifdef INCLUDE_CMD_CTTY
+INT cmd_ctty(LPTSTR);
+#endif
 
 /* Prototypes for COLOR.C */
 INT CommandColor(LPTSTR);
@@ -337,6 +340,9 @@
 INT  cmd_prompt (LPTSTR);
 
 /* Prototypes for REDIR.C */
+HANDLE GetHandle(UINT Number);
+VOID SetHandle(UINT Number, HANDLE Handle);
+
 typedef enum _REDIR_MODE
 {
 REDIR_READ   = 0,

Modified: trunk/reactos/base/shell/cmd/cmdtable.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmdtable.c?rev=76029&r1=76028&r2=76029&view=diff
==
--- trunk/reactos/base/shell/cmd/cmdtable.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmdtable.c [iso-8859-1] Mon Oct  2 
17:03:01 2017
@@ -73,6 +73,10 @@
 {_T("copy"), 0, cmd_copy},
 #endif
 
+#ifdef INCLUDE_CMD_CTTY
+{_T("ctty"), 0, cmd_ctty},
+#endif
+
 #ifdef INCLUDE_CMD_DATE
 {_T("date"), 0, cmd_date},
 #endif
@@ -168,6 +172,7 @@
 
 #ifdef INCLUDE_CMD_RMDIR
 {_T("rd"), CMD_SPECIAL, cmd_rmdir},
+{_T("rmdir"), CMD_SPECIAL, cmd_rmdir},
 #endif
 
 #ifdef INCLUDE_CMD_REM
@@ -181,10 +186,6 @@
 
 #ifdef INCLUDE_CMD_REPLACE
 {_T("replace"), 0, cmd_replace},
-#endif
-
-#ifdef INCLUDE_CMD_RMDIR
-{_T("rmdir"), CMD_SPECIAL, cmd_rmdir},
 #endif
 
 #ifdef INCLUDE_CMD_SCREEN

Modified: trunk/reactos/base/shell/cmd/config.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/config.h?rev=76029&r1=76028&r2=76029&view=diff
==
--- trunk/reactos/base/shell/cmd/config.h   [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/config.h   [iso-8859-1] Mon 

[ros-diffs] [hbelusca] 76024: [CMD]: Fix inclusion order.

2017-10-01 Thread hbelusca
Author: hbelusca
Date: Sun Oct  1 16:33:33 2017
New Revision: 76024

URL: http://svn.reactos.org/svn/reactos?rev=76024&view=rev
Log:
[CMD]: Fix inclusion order.

Modified:
trunk/reactos/base/shell/cmd/precomp.h

Modified: trunk/reactos/base/shell/cmd/precomp.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/precomp.h?rev=76024&r1=76023&r2=76024&view=diff
==
--- trunk/reactos/base/shell/cmd/precomp.h  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/precomp.h  [iso-8859-1] Sun Oct  1 
16:33:33 2017
@@ -22,10 +22,10 @@
 #include 
 #include 
 
-#include 
-
 #define NTOS_MODE_USER
 #include 
+
+#include 
 
 #include "resource.h"
 




[ros-diffs] [hbelusca] 76023: [CMD]: Use the CONUTILS library (Part 1/x) for an uniform and consistent experience across command-line tools. - Make most of CMD use the conutils library. This means tha

2017-10-01 Thread hbelusca
Author: hbelusca
Date: Sun Oct  1 16:30:39 2017
New Revision: 76023

URL: http://svn.reactos.org/svn/reactos?rev=76023&view=rev
Log:
[CMD]: Use the CONUTILS library (Part 1/x) for an uniform and consistent 
experience across command-line tools.
- Make most of CMD use the conutils library. This means that
  now we explicitely use the CON_STREAM objects. In particular code
  handling STDIN/OUT/ERR redirection should be handled with care.
- Factor out much of console-related support code into console.c.
  Code for console input is however not "CON_STREAM-enabled" yet.
- Change ConOutPrintfPaging prototype to make it return TRUE/FALSE
  when it can continue paged-printing or not, respectively.
CORE-13860

Modified:
trunk/reactos/base/shell/cmd/CMakeLists.txt
trunk/reactos/base/shell/cmd/beep.c
trunk/reactos/base/shell/cmd/cls.c
trunk/reactos/base/shell/cmd/cmd.c
trunk/reactos/base/shell/cmd/cmd.h
trunk/reactos/base/shell/cmd/color.c
trunk/reactos/base/shell/cmd/console.c
trunk/reactos/base/shell/cmd/console.h
trunk/reactos/base/shell/cmd/dir.c
trunk/reactos/base/shell/cmd/history.c
trunk/reactos/base/shell/cmd/misc.c
trunk/reactos/base/shell/cmd/precomp.h
trunk/reactos/base/shell/cmd/redir.c
trunk/reactos/base/shell/cmd/start.c

Modified: trunk/reactos/base/shell/cmd/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/CMakeLists.txt?rev=76023&r1=76022&r2=76023&view=diff
==
--- trunk/reactos/base/shell/cmd/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/CMakeLists.txt [iso-8859-1] Sun Oct  1 
16:30:39 2017
@@ -4,6 +4,7 @@
 -D_DEBUG_MEM)
 
 include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
+include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils)
 
 list(APPEND SOURCE
 alias.c
@@ -68,8 +69,9 @@
 
 add_rc_deps(cmd.rc ${CMAKE_CURRENT_SOURCE_DIR}/res/terminal.ico)
 add_executable(cmd ${SOURCE} cmd.rc)
+add_pch(cmd precomp.h SOURCE)
+set_module_type(cmd win32cui UNICODE)
 target_link_libraries(cmd wine)
-set_module_type(cmd win32cui UNICODE)
+target_link_libraries(cmd conutils ${PSEH_LIB})
 add_importlibs(cmd advapi32 user32 msvcrt kernel32 ntdll)
-add_pch(cmd precomp.h SOURCE)
 add_cd_file(TARGET cmd DESTINATION reactos/system32 FOR all)

Modified: trunk/reactos/base/shell/cmd/beep.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/beep.c?rev=76023&r1=76022&r2=76023&view=diff
==
--- trunk/reactos/base/shell/cmd/beep.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/beep.c [iso-8859-1] Sun Oct  1 16:30:39 2017
@@ -42,7 +42,7 @@
 return 1;
 #endif
 
-ConRingBell(GetStdHandle(STD_OUTPUT_HANDLE));
+ConRingBell(ConStreamGetOSHandle(StdOut));
 return 0;
 }
 

Modified: trunk/reactos/base/shell/cmd/cls.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cls.c?rev=76023&r1=76022&r2=76023&view=diff
==
--- trunk/reactos/base/shell/cmd/cls.c  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cls.c  [iso-8859-1] Sun Oct  1 16:30:39 2017
@@ -38,7 +38,7 @@
 return 0;
 }
 
-ConClearScreen(GetStdHandle(STD_OUTPUT_HANDLE));
+ConClearScreen(&StdOutScreen);
 return 0;
 }
 

Modified: trunk/reactos/base/shell/cmd/cmd.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.c?rev=76023&r1=76022&r2=76023&view=diff
==
--- trunk/reactos/base/shell/cmd/cmd.c  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmd.c  [iso-8859-1] Sun Oct  1 16:30:39 2017
@@ -156,18 +156,22 @@
 static BOOL bWaitForCommand = FALSE; /* When we are executing something passed 
on the commandline after /c or /k */
 INT  nErrorLevel = 0; /* Errorlevel of last launched external program */
 CRITICAL_SECTION ChildProcessRunningLock;
-BOOL bUnicodeOutput = FALSE;
 BOOL bDisableBatchEcho = FALSE;
 BOOL bEnableExtensions = TRUE;
 BOOL bDelayedExpansion = FALSE;
 BOOL bTitleSet = FALSE;
 DWORD dwChildProcessId = 0;
-HANDLE hIn;
 LPTSTR lpOriginalEnvironment;
 HANDLE CMD_ModuleHandle;
 
 static NtQueryInformationProcessProc NtQueryInformationProcessPtr = NULL;
 static NtReadVirtualMemoryProc   NtReadVirtualMemoryPtr = NULL;
+
+/*
+ * Default output file stream translation mode is UTF8, but CMD switches
+ * allow to change it to either UTF16 (/U) or ANSI (/A).
+ */
+CON_STREAM_MODE OutputStreamMode = UTF8Text; // AnsiText;
 
 #ifdef INCLUDE_CMD_COLOR
 WORD wDefColor = 0; /* Default color */
@@ -417,7 +421,7 @@
 stui.wShowWindow = SW_SHOWDEFAULT;
 
 /* Set the console to standard mode */
-SetC

[ros-diffs] [hbelusca] 76022: [CONUTILS]: Add some string resources functions that can support a specified hModule parameter, and add small construction helpers for CON_SCREEN and CON_PAGER.

2017-10-01 Thread hbelusca
Author: hbelusca
Date: Sun Oct  1 16:03:44 2017
New Revision: 76022

URL: http://svn.reactos.org/svn/reactos?rev=76022&view=rev
Log:
[CONUTILS]: Add some string resources functions that can support a specified 
hModule parameter, and add small construction helpers for CON_SCREEN and 
CON_PAGER.

Modified:
trunk/reactos/sdk/lib/conutils/pager.c
trunk/reactos/sdk/lib/conutils/pager.h
trunk/reactos/sdk/lib/conutils/screen.h
trunk/reactos/sdk/lib/conutils/stream.c
trunk/reactos/sdk/lib/conutils/stream.h

Modified: trunk/reactos/sdk/lib/conutils/pager.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/conutils/pager.c?rev=76022&r1=76021&r2=76022&view=diff
==
--- trunk/reactos/sdk/lib/conutils/pager.c  [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/conutils/pager.c  [iso-8859-1] Sun Oct  1 
16:03:44 2017
@@ -131,18 +131,30 @@
 }
 
 BOOL
+ConResPagingEx(
+IN PCON_PAGER Pager,
+IN PAGE_PROMPT PagePrompt,
+IN BOOL StartPaging,
+IN HINSTANCE hInstance OPTIONAL,
+IN UINT uID)
+{
+INT Len;
+PWCHAR szStr = NULL;
+
+Len = K32LoadStringW(hInstance, uID, (PWSTR)&szStr, 0);
+if (szStr && Len)
+return ConWritePaging(Pager, PagePrompt, StartPaging, szStr, Len);
+else
+return TRUE;
+}
+
+BOOL
 ConResPaging(
 IN PCON_PAGER Pager,
 IN PAGE_PROMPT PagePrompt,
 IN BOOL StartPaging,
 IN UINT uID)
 {
-INT Len;
-PWCHAR szStr = NULL;
-
-Len = K32LoadStringW(GetModuleHandleW(NULL), uID, (PWSTR)&szStr, 0);
-if (szStr && Len)
-return ConWritePaging(Pager, PagePrompt, StartPaging, szStr, Len);
-else
-return TRUE;
+return ConResPagingEx(Pager, PagePrompt, StartPaging,
+  NULL /*GetModuleHandleW(NULL)*/, uID);
 }

Modified: trunk/reactos/sdk/lib/conutils/pager.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/conutils/pager.h?rev=76022&r1=76021&r2=76022&view=diff
==
--- trunk/reactos/sdk/lib/conutils/pager.h  [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/conutils/pager.h  [iso-8859-1] Sun Oct  1 
16:03:44 2017
@@ -30,6 +30,14 @@
 DWORD LineCount;
 } CON_PAGER, *PCON_PAGER;
 
+#define INIT_CON_PAGER(pScreen) {(pScreen), 0}
+
+#define InitializeConPager(pPager, pScreen) \
+do { \
+(pPager)->Screen = (pScreen);   \
+(pPager)->LineCount = 0;\
+} while (0)
+
   // Pager, Done, Total
 typedef BOOL (__stdcall *PAGE_PROMPT)(IN PCON_PAGER, IN DWORD, IN DWORD);
 
@@ -49,6 +57,14 @@
 IN LPTSTR szStr);
 
 BOOL
+ConResPagingEx(
+IN PCON_PAGER Pager,
+IN PAGE_PROMPT PagePrompt,
+IN BOOL StartPaging,
+IN HINSTANCE hInstance OPTIONAL,
+IN UINT uID);
+
+BOOL
 ConResPaging(
 IN PCON_PAGER Pager,
 IN PAGE_PROMPT PagePrompt,

Modified: trunk/reactos/sdk/lib/conutils/screen.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/conutils/screen.h?rev=76022&r1=76021&r2=76022&view=diff
==
--- trunk/reactos/sdk/lib/conutils/screen.h [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/conutils/screen.h [iso-8859-1] Sun Oct  1 
16:03:44 2017
@@ -35,6 +35,15 @@
 CONSOLE_CURSOR_INFO cci;
 } CON_SCREEN, *PCON_SCREEN;
 
+#define INIT_CON_SCREEN(pStream){(pStream)} /* {(pStream), {{}}, {{}}} */
+
+#define InitializeConScreen(pScreen, pStream)   \
+do { \
+(pScreen)->Stream = (pStream);  \
+RtlZeroMemory(&(pScreen)->csbi, sizeof((pScreen)->csbi));   \
+RtlZeroMemory(&(pScreen)->cci , sizeof((pScreen)->cci ));   \
+} while (0)
+
 BOOL
 ConGetScreenInfo(
 IN PCON_SCREEN Screen,

Modified: trunk/reactos/sdk/lib/conutils/stream.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/conutils/stream.c?rev=76022&r1=76021&r2=76022&view=diff
==
--- trunk/reactos/sdk/lib/conutils/stream.c [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/conutils/stream.c [iso-8859-1] Sun Oct  1 
16:03:44 2017
@@ -483,7 +483,9 @@
 SetLastError(ERROR_NOT_ENOUGH_MEMORY);
 return 0;
 }
-len = WideCharToMultiByte(Stream->CodePage, 0, szStr, len, buffer, len 
* MB_LEN_MAX, NULL, NULL);
+len = WideCharToMultiByte(Stream->CodePage, 0,
+  szStr, len, buffer, len * MB_LEN_MAX,
+  NULL, NULL);
 szStr = (PVOID)buffer;
 #else
 /*
@@ -705,14 +707,15 @@
 }
 
 INT
-ConResPuts(
-IN PCON_STREAM Stream,
+ConResPutsEx(
+IN PCON_STREAM Stream,
+IN HINSTANCE hInstance OPTIONAL,
 IN UINT uID)
 {
  

[ros-diffs] [hbelusca] 76010: [CMD]: Improve ExecuteAutoRunFile() with validity checks.

2017-09-30 Thread hbelusca
Author: hbelusca
Date: Sat Sep 30 22:12:21 2017
New Revision: 76010

URL: http://svn.reactos.org/svn/reactos?rev=76010&view=rev
Log:
[CMD]: Improve ExecuteAutoRunFile() with validity checks.

Modified:
trunk/reactos/base/shell/cmd/cmd.c

Modified: trunk/reactos/base/shell/cmd/cmd.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.c?rev=76010&r1=76009&r2=76010&view=diff
==
--- trunk/reactos/base/shell/cmd/cmd.c  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmd.c  [iso-8859-1] Sat Sep 30 22:12:21 2017
@@ -1538,12 +1538,12 @@
 {
 LONG lRet;
 HKEY hKey;
+DWORD dwType, len;
 /*
  * Buffer big enough to hold the string L"4294967295",
  * corresponding to the literal 0x (MAX_ULONG) in decimal.
  */
 DWORD Buffer[6];
-DWORD dwType, len;
 
 lRet = RegOpenKeyEx(hKeyRoot,
 _T("Software\\Microsoft\\Command Processor"),
@@ -1685,28 +1685,33 @@
 static VOID
 ExecuteAutoRunFile(HKEY hKeyRoot)
 {
-TCHAR autorun[2048];
-DWORD len = sizeof autorun;
-HKEY hkey;
-
-if (RegOpenKeyEx(hKeyRoot,
- _T("SOFTWARE\\Microsoft\\Command Processor"),
- 0,
- KEY_READ,
- &hkey) == ERROR_SUCCESS)
-{
-if (RegQueryValueEx(hkey,
+LONG lRet;
+HKEY hKey;
+DWORD dwType, len;
+TCHAR AutoRun[2048];
+
+lRet = RegOpenKeyEx(hKeyRoot,
+_T("Software\\Microsoft\\Command Processor"),
+0,
+KEY_QUERY_VALUE,
+&hKey);
+if (lRet != ERROR_SUCCESS)
+return;
+
+len = sizeof(AutoRun);
+lRet = RegQueryValueEx(hKey,
_T("AutoRun"),
-   0,
-   0,
-   (LPBYTE)autorun,
-   &len) == ERROR_SUCCESS)
-{
-if (*autorun)
-ParseCommandLine(autorun);
-}
-RegCloseKey(hkey);
-}
+   NULL,
+   &dwType,
+   (LPBYTE)&AutoRun,
+   &len);
+if ((lRet == ERROR_SUCCESS) && (dwType == REG_EXPAND_SZ || dwType == 
REG_SZ))
+{
+if (*AutoRun)
+ParseCommandLine(AutoRun);
+}
+
+RegCloseKey(hKey);
 }
 
 /* Get the command that comes after a /C or /K switch */




[ros-diffs] [hbelusca] 76009: [CMD]: Small refactoring: - Moving ConGetDefaultAttributes() in console.h; - Moving some SDK inclusions into precomp.h; - Removing extern HANDLE hIn; and localize the SHO

2017-09-30 Thread hbelusca
Author: hbelusca
Date: Sat Sep 30 21:37:34 2017
New Revision: 76009

URL: http://svn.reactos.org/svn/reactos?rev=76009&view=rev
Log:
[CMD]: Small refactoring:
- Moving ConGetDefaultAttributes() in console.h;
- Moving some SDK inclusions into precomp.h;
- Removing extern HANDLE hIn; and localize the SHORT maxx/y variables;
- Comment fix;
- Whitespace fixes for screen.c.

Modified:
trunk/reactos/base/shell/cmd/cmd.c
trunk/reactos/base/shell/cmd/cmd.h
trunk/reactos/base/shell/cmd/console.c
trunk/reactos/base/shell/cmd/console.h
trunk/reactos/base/shell/cmd/dir.c
trunk/reactos/base/shell/cmd/precomp.h
trunk/reactos/base/shell/cmd/screen.c
trunk/reactos/base/shell/cmd/start.c

Modified: trunk/reactos/base/shell/cmd/cmd.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.c?rev=76009&r1=76008&r2=76009&view=diff
==
--- trunk/reactos/base/shell/cmd/cmd.c  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmd.c  [iso-8859-1] Sat Sep 30 21:37:34 2017
@@ -311,10 +311,11 @@
 {
 TCHAR szFullName[MAX_PATH];
 TCHAR *first, *rest, *dot;
-TCHAR szWindowTitle[MAX_PATH], szNewTitle[MAX_PATH*2];
+TCHAR szWindowTitle[MAX_PATH];
+TCHAR szNewTitle[MAX_PATH*2];
 DWORD dwExitCode = 0;
 TCHAR *FirstEnd;
-TCHAR szFullCmdLine [CMDLINE_LENGTH];
+TCHAR szFullCmdLine[CMDLINE_LENGTH];
 
 TRACE ("Execute: \'%s\' \'%s\'\n", debugstr_aw(First), debugstr_aw(Rest));
 
@@ -1762,33 +1763,6 @@
 }
 
 
-#ifdef INCLUDE_CMD_COLOR
-
-BOOL ConGetDefaultAttributes(PWORD pwDefAttr)
-{
-BOOL Success;
-HANDLE hConsole;
-CONSOLE_SCREEN_BUFFER_INFO csbi;
-
-/* Do not modify *pwDefAttr if we fail, in which case use default 
attributes */
-
-hConsole = CreateFile(_T("CONOUT$"), GENERIC_READ|GENERIC_WRITE,
-  FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,
-  OPEN_EXISTING, 0, NULL);
-if (hConsole == INVALID_HANDLE_VALUE)
-return FALSE; // No default console
-
-Success = GetConsoleScreenBufferInfo(hConsole, &csbi);
-if (Success)
-*pwDefAttr = csbi.wAttributes;
-
-CloseHandle(hConsole);
-return Success;
-}
-
-#endif
-
-
 /*
  * Set up global initializations and process parameters
  */
@@ -1997,7 +1971,6 @@
 if (IsExistingFile(_T("cmdexit.bat")))
 {
 ConErrResPuts(STRING_CMD_ERROR5);
-
 ParseCommandLine(_T("cmdexit.bat"));
 }
 else if (IsExistingFile(_T("\\cmdexit.bat")))

Modified: trunk/reactos/base/shell/cmd/cmd.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.h?rev=76009&r1=76008&r2=76009&view=diff
==
--- trunk/reactos/base/shell/cmd/cmd.h  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmd.h  [iso-8859-1] Sat Sep 30 21:37:34 2017
@@ -25,12 +25,6 @@
 
 #include 
 
-#include 
-#include 
-#include 
-#include 
-#include 
-
 #include "cmdver.h"
 #include "cmddbg.h"
 
@@ -43,7 +37,6 @@
 #define D_ON _T("on")
 #define D_OFF_T("off")
 
-
 /* command line buffer length */
 #define CMDLINE_LENGTH  8192
 
@@ -51,7 +44,6 @@
 #define BUFF_SIZE 16384
 
 /* Global variables */
-extern HANDLE hIn;
 extern LPTSTR lpOriginalEnvironment;
 extern WORD   wColor;
 extern WORD   wDefColor;
@@ -62,8 +54,6 @@
 extern BOOL   bEnableExtensions;
 extern BOOL   bDelayedExpansion;
 extern INTnErrorLevel;
-extern SHORT  maxx;
-extern SHORT  maxy;
 extern BOOL bUnicodeOutput;
 
 

Modified: trunk/reactos/base/shell/cmd/console.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/console.c?rev=76009&r1=76008&r2=76009&view=diff
==
--- trunk/reactos/base/shell/cmd/console.c  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/console.c  [iso-8859-1] Sat Sep 30 
21:37:34 2017
@@ -507,6 +507,33 @@
 
 
 
+#ifdef INCLUDE_CMD_COLOR
+
+BOOL ConGetDefaultAttributes(PWORD pwDefAttr)
+{
+BOOL Success;
+HANDLE hConsole;
+CONSOLE_SCREEN_BUFFER_INFO csbi;
+
+/* Do not modify *pwDefAttr if we fail, in which case use default 
attributes */
+
+hConsole = CreateFile(_T("CONOUT$"), GENERIC_READ|GENERIC_WRITE,
+  FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,
+  OPEN_EXISTING, 0, NULL);
+if (hConsole == INVALID_HANDLE_VALUE)
+return FALSE; // No default console
+
+Success = GetConsoleScreenBufferInfo(hConsole, &csbi);
+if (Success)
+*pwDefAttr = csbi.wAttributes;
+
+CloseHandle(hConsole);
+return Success;
+}
+
+#endif
+
+
 BOOL ConSetTitle(IN LPCTSTR lpConsoleTitle)
 {
 /* Now really set the console title */

[ros-diffs] [hbelusca] 76008: [CMD]: Continue refactoring to lay out the way to using the CONUTILS library in CMD. Part 3/x

2017-09-30 Thread hbelusca
Author: hbelusca
Date: Sat Sep 30 21:05:49 2017
New Revision: 76008

URL: http://svn.reactos.org/svn/reactos?rev=76008&view=rev
Log:
[CMD]: Continue refactoring to lay out the way to using the CONUTILS library in 
CMD. Part 3/x

Modified:
trunk/reactos/base/shell/cmd/cmd.c
trunk/reactos/base/shell/cmd/color.c
trunk/reactos/base/shell/cmd/console.c
trunk/reactos/base/shell/cmd/console.h
trunk/reactos/base/shell/cmd/dir.c
trunk/reactos/base/shell/cmd/type.c

Modified: trunk/reactos/base/shell/cmd/cmd.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.c?rev=76008&r1=76007&r2=76008&view=diff
==
--- trunk/reactos/base/shell/cmd/cmd.c  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmd.c  [iso-8859-1] Sat Sep 30 21:05:49 2017
@@ -1956,7 +1956,7 @@
 }
 
 if (wDefColor != 0)
-ConSetScreenColor(wDefColor, TRUE);
+ConSetScreenColor(GetStdHandle(STD_OUTPUT_HANDLE), wDefColor, TRUE);
 #endif
 
 if (!*ptr)

Modified: trunk/reactos/base/shell/cmd/color.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/color.c?rev=76008&r1=76007&r2=76008&view=diff
==
--- trunk/reactos/base/shell/cmd/color.c[iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/color.c[iso-8859-1] Sat Sep 30 
21:05:49 2017
@@ -46,7 +46,7 @@
 /* No parameter: Set the default colors */
 if (rest[0] == _T('\0'))
 {
-ConSetScreenColor(wDefColor, TRUE);
+ConSetScreenColor(GetStdHandle(STD_OUTPUT_HANDLE), wDefColor, TRUE);
 return 0;
 }
 
@@ -87,7 +87,8 @@
  * Set the chosen color. Use also the following advanced flag:
  * /-F to avoid changing already buffered foreground/background.
  */
-if (ConSetScreenColor(wColor, !_tcsstr(rest, _T("/-F")) && !_tcsstr(rest, 
_T("/-f"))) == FALSE)
+if (ConSetScreenColor(GetStdHandle(STD_OUTPUT_HANDLE), wColor,
+  !_tcsstr(rest, _T("/-F")) && !_tcsstr(rest, 
_T("/-f"))) == FALSE)
 {
 /* Failed because foreground and background colors were the same */
 ConErrResPuts(STRING_COLOR_ERROR1);

Modified: trunk/reactos/base/shell/cmd/console.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/console.c?rev=76008&r1=76007&r2=76008&view=diff
==
--- trunk/reactos/base/shell/cmd/console.c  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/console.c  [iso-8859-1] Sat Sep 30 
21:05:49 2017
@@ -21,7 +21,7 @@
 
 #define OUTPUT_BUFFER_SIZE  4096
 
-
+/* Cache codepage for text streams */
 UINT InputCodePage;
 UINT OutputCodePage;
 
@@ -342,7 +342,7 @@
 
 /** Console PAGER functions 
***/
 
-INT ConPrintfVPaging(DWORD nStdHandle, BOOL NewPage, LPTSTR szFormat, va_list 
arg_ptr)
+BOOL ConPrintfVPaging(DWORD nStdHandle, BOOL NewPage, LPTSTR szFormat, va_list 
arg_ptr)
 {
 INT len;
 CONSOLE_SCREEN_BUFFER_INFO csbi;
@@ -366,14 +366,14 @@
 
 /* Reset LineCount and return if no string has been given */
 if (szFormat == NULL)
-return 0;
+return TRUE;
 
 /* Get the size of the visual screen that can be printed to */
 if (!IsConsoleHandle(hOutput) || !GetConsoleScreenBufferInfo(hOutput, 
&csbi))
 {
 /* We assume it's a file handle */
 ConPrintfV(nStdHandle, szFormat, arg_ptr);
-return 0;
+return TRUE;
 }
 
 /*
@@ -387,7 +387,7 @@
 if (ScreenLines < 4)
 {
 ConPrintfV(nStdHandle, szFormat, arg_ptr);
-return 0;
+return TRUE;
 }
 
 len = _vstprintf(szOut, szFormat, arg_ptr);
@@ -408,9 +408,7 @@
 
 /* Prompt the user */
 if (PagePrompt() != PROMPT_YES)
-{
-return 1;
-}
+return FALSE;
 
 // TODO: Recalculate 'ScreenLines' in case the user redimensions
 // the window during the prompt.
@@ -422,18 +420,18 @@
 
 WriteConsole(hOutput, &szOut[from], i-from, &dwWritten, NULL);
 
-return 0;
-}
-
-INT ConOutPrintfPaging(BOOL NewPage, LPTSTR szFormat, ...)
-{
-INT iReturn;
+return TRUE;
+}
+
+BOOL ConOutPrintfPaging(BOOL NewPage, LPTSTR szFormat, ...)
+{
+BOOL bRet;
 va_list arg_ptr;
 
 va_start(arg_ptr, szFormat);
-iReturn = ConPrintfVPaging(STD_OUTPUT_HANDLE, NewPage, szFormat, arg_ptr);
+bRet = ConPrintfVPaging(STD_OUTPUT_HANDLE, NewPage, szFormat, arg_ptr);
 va_end(arg_ptr);
-return iReturn;
+return bRet;
 }
 
 VOID ConOutResPaging(BOOL NewPage, UINT resID)
@@ -557,9 +555,8 @@
 #endif
 
 #ifdef INCLUDE_CMD_COLOR
-BOOL ConS

[ros-diffs] [hbelusca] 76007: [CMD]: Continue refactoring to lay out the way to using the CONUTILS library in CMD. Part 2/x

2017-09-30 Thread hbelusca
Author: hbelusca
Date: Sat Sep 30 19:52:30 2017
New Revision: 76007

URL: http://svn.reactos.org/svn/reactos?rev=76007&view=rev
Log:
[CMD]: Continue refactoring to lay out the way to using the CONUTILS library in 
CMD. Part 2/x

Modified:
trunk/reactos/base/shell/cmd/console.c
trunk/reactos/base/shell/cmd/console.h
trunk/reactos/base/shell/cmd/error.c

Modified: trunk/reactos/base/shell/cmd/console.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/console.c?rev=76007&r1=76006&r2=76007&view=diff
==
--- trunk/reactos/base/shell/cmd/console.c  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/console.c  [iso-8859-1] Sat Sep 30 
19:52:30 2017
@@ -139,7 +139,7 @@
 
 / Console STREAM OUT utility functions 
/
 
-static VOID ConWrite(TCHAR *str, DWORD len, DWORD nStdHandle)
+static VOID ConWrite(DWORD nStdHandle, TCHAR *str, DWORD len)
 {
 DWORD dwNumBytes = 0;
 HANDLE hOutput = GetStdHandle(nStdHandle);
@@ -260,26 +260,26 @@
 }
 }
 
-VOID ConOutChar(TCHAR c)
-{
-ConWrite(&c, 1, STD_OUTPUT_HANDLE);
-}
-
-VOID ConPuts(LPTSTR szText, DWORD nStdHandle)
-{
-ConWrite(szText, (DWORD)_tcslen(szText), nStdHandle);
-}
-
-VOID ConOutResPuts(UINT resID)
+VOID ConPuts(DWORD nStdHandle, LPTSTR szText)
+{
+ConWrite(nStdHandle, szText, (DWORD)_tcslen(szText));
+}
+
+VOID ConResPuts(DWORD nStdHandle, UINT resID)
 {
 TCHAR szMsg[RC_STRING_MAX_SIZE];
 LoadString(CMD_ModuleHandle, resID, szMsg, ARRAYSIZE(szMsg));
-ConPuts(szMsg, STD_OUTPUT_HANDLE);
-}
-
-VOID ConOutPuts(LPTSTR szText)
-{
-ConPuts(szText, STD_OUTPUT_HANDLE);
+ConPuts(nStdHandle, szMsg);
+}
+
+VOID ConOutChar(TCHAR c)
+{
+ConWrite(STD_OUTPUT_HANDLE, &c, 1);
+}
+
+VOID ConErrChar(TCHAR c)
+{
+ConWrite(STD_ERROR_HANDLE, &c, 1);
 }
 
 VOID ConPrintfV(DWORD nStdHandle, LPTSTR szFormat, va_list arg_ptr)
@@ -288,12 +288,31 @@
 DWORD len;
 
 len = (DWORD)_vstprintf(szOut, szFormat, arg_ptr);
-ConWrite(szOut, len, nStdHandle);
-}
-
-VOID ConErrFormatMessage(DWORD MessageId, ...)
+ConWrite(nStdHandle, szOut, len);
+}
+
+VOID ConPrintf(DWORD nStdHandle, LPTSTR szFormat, ...)
+{
+va_list arg_ptr;
+
+va_start(arg_ptr, szFormat);
+ConPrintfV(nStdHandle, szFormat, arg_ptr);
+va_end(arg_ptr);
+}
+
+VOID ConResPrintf(DWORD nStdHandle, UINT resID, ...)
 {
 TCHAR szMsg[RC_STRING_MAX_SIZE];
+va_list arg_ptr;
+
+va_start(arg_ptr, resID);
+LoadString(CMD_ModuleHandle, resID, szMsg, ARRAYSIZE(szMsg));
+ConPrintfV(nStdHandle, szMsg, arg_ptr);
+va_end(arg_ptr);
+}
+
+VOID ConFormatMessage(DWORD nStdHandle, DWORD MessageId, ...)
+{
 DWORD ret;
 LPTSTR text;
 va_list arg_ptr;
@@ -303,107 +322,20 @@
 NULL,
 MessageId,
 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-(LPTSTR) &text,
+(LPTSTR)&text,
 0,
 &arg_ptr);
-
 va_end(arg_ptr);
+
 if (ret > 0)
 {
-ConErrPuts(text);
+ConPuts(nStdHandle, text);
 LocalFree(text);
 }
 else
 {
-LoadString(CMD_ModuleHandle, STRING_CONSOLE_ERROR, szMsg, 
ARRAYSIZE(szMsg));
-ConErrPrintf(szMsg);
-}
-}
-
-VOID ConOutFormatMessage(DWORD MessageId, ...)
-{
-TCHAR szMsg[RC_STRING_MAX_SIZE];
-DWORD ret;
-LPTSTR text;
-va_list arg_ptr;
-
-va_start(arg_ptr, MessageId);
-ret = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | 
FORMAT_MESSAGE_FROM_SYSTEM,
-NULL,
-MessageId,
-MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-(LPTSTR) &text,
-0,
-&arg_ptr);
-
-va_end(arg_ptr);
-if (ret > 0)
-{
-ConErrPuts(text);
-LocalFree(text);
-}
-else
-{
-LoadString(CMD_ModuleHandle, STRING_CONSOLE_ERROR, szMsg, 
ARRAYSIZE(szMsg));
-ConErrPrintf(szMsg);
-}
-}
-
-VOID ConOutResPrintf(UINT resID, ...)
-{
-TCHAR szMsg[RC_STRING_MAX_SIZE];
-va_list arg_ptr;
-
-va_start(arg_ptr, resID);
-LoadString(CMD_ModuleHandle, resID, szMsg, ARRAYSIZE(szMsg));
-ConPrintfV(STD_OUTPUT_HANDLE, szMsg, arg_ptr);
-va_end(arg_ptr);
-}
-
-VOID ConOutPrintf(LPTSTR szFormat, ...)
-{
-va_list arg_ptr;
-
-va_start(arg_ptr, szFormat);
-ConPrintfV(STD_OUTPUT_HANDLE, szFormat, arg_ptr);
-va_end(arg_ptr);
-}
-
-VOID ConErrChar(TCHAR c)
-{
-ConWrite(&c, 1, STD_ERROR_HANDLE);
-}
-
-VOID ConErrResPuts(UINT resID)
-{
-TCHAR szMsg[RC_STRING_MAX_SIZE];
-LoadString(CMD_ModuleHandle, resID, szMsg, ARRAYSIZE(szMsg));
-ConPuts(szMsg, STD_ERROR_HANDLE);
-}
-
-VOID ConErrPuts(LPTSTR szT

[ros-diffs] [hbelusca] 76004: [TIMEOUT]: Italian translation by Carlo Bramini. CORE-13856 #resolve #comment Committed in r76004, thanks!

2017-09-30 Thread hbelusca
Author: hbelusca
Date: Sat Sep 30 17:34:05 2017
New Revision: 76004

URL: http://svn.reactos.org/svn/reactos?rev=76004&view=rev
Log:
[TIMEOUT]: Italian translation by Carlo Bramini.
CORE-13856 #resolve #comment Committed in r76004, thanks!

Added:
trunk/reactos/base/applications/cmdutils/timeout/lang/it-IT.rc   (with 
props)
Modified:
trunk/reactos/base/applications/cmdutils/timeout/timeout.rc

Added: trunk/reactos/base/applications/cmdutils/timeout/lang/it-IT.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils/timeout/lang/it-IT.rc?rev=76004
==
--- trunk/reactos/base/applications/cmdutils/timeout/lang/it-IT.rc  (added)
+++ trunk/reactos/base/applications/cmdutils/timeout/lang/it-IT.rc  
[iso-8859-1] Sat Sep 30 17:34:05 2017
@@ -0,0 +1,34 @@
+LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL
+
+STRINGTABLE
+BEGIN
+IDS_USAGE "ReactOS Timeout Utility\n\
+\n\
+TIMEOUT [/?] [/T] tempo [/NOBREAK]\n\
+\n\
+Descrizione :\n\
+Questa utilità permette di attendere finchè un tempo fissato (in 
secondi)\n\
+non è trascorso, oppure fino a quando non viene premuto un tasto. 
Accetta\n\
+un parametro per ignorare la pressione dei tasti.\n\
+\n\
+Parametri:\n\
+/?Visualizza questo messaggio di aiuto.\n\
+\n\
+/T tempo  Indica il numero di secondi di attesa (da -1 a 9).\n\
+  Il valore -1 significa che il programma attenderà 
infinitamente\n\
+  fino alla pressione di un tasto.\n\
+  Notare che il parametro ""/T"" è opzionale, è possibile\n\
+  specificare il valore del ritardo senza di esso.\n\
+\n\
+/NOBREAK  Ignora la pressione di qualsiasi tasto, eccetto il Ctrl+C.\n\
+"
+IDS_ERROR_OUT_OF_RANGE "ERRORE: il tempo di attesa deve essere compreso 
tra i limiti (-1 e 9).\n"
+IDS_ERROR_INVALID_HANDLE_VALUE "ERRORE: Impossibile ottenere l'handle per 
accedere alla console (errore %lu).\n"
+IDS_ERROR_READ_INPUT "ERRORE: Impossibile leggere dalla console (errore 
%lu).\n"
+IDS_ERROR_NO_TIMER_VALUE "ERRORE: il tempo di attesa non è stato 
specificato (tra -1 e 9).\n"
+IDS_ERROR_ONE_TIME "ERRORE: Deve essere indicato un solo valore 
temporale.\n"
+IDS_NOBREAK_INPUT "Premere Ctrl+C per interrompere..."
+IDS_USER_INPUT "Premere un tasto per continuare..."
+IDS_NOBREAK_INPUT_COUNT "Attendere %d secondi, premere Ctrl+C per 
interrompere..."
+IDS_USER_INPUT_COUNT "Attendere %d secondi, premere un tasto per 
continuare..."
+END

Propchange: trunk/reactos/base/applications/cmdutils/timeout/lang/it-IT.rc
--
svn:eol-style = native

Modified: trunk/reactos/base/applications/cmdutils/timeout/timeout.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils/timeout/timeout.rc?rev=76004&r1=76003&r2=76004&view=diff
==
--- trunk/reactos/base/applications/cmdutils/timeout/timeout.rc [iso-8859-1] 
(original)
+++ trunk/reactos/base/applications/cmdutils/timeout/timeout.rc [iso-8859-1] 
Sat Sep 30 17:34:05 2017
@@ -19,3 +19,6 @@
 #ifdef LANGUAGE_FR_FR
 #include "lang/fr-FR.rc"
 #endif
+#ifdef LANGUAGE_IT_IT
+#include "lang/it-IT.rc"
+#endif




[ros-diffs] [hbelusca] 76003: [CMD]: Continue refactoring to lay out the way to using the CONUTILS library in CMD.

2017-09-30 Thread hbelusca
Author: hbelusca
Date: Sat Sep 30 15:28:06 2017
New Revision: 76003

URL: http://svn.reactos.org/svn/reactos?rev=76003&view=rev
Log:
[CMD]: Continue refactoring to lay out the way to using the CONUTILS library in 
CMD.

Modified:
trunk/reactos/base/shell/cmd/console.c
trunk/reactos/base/shell/cmd/console.h
trunk/reactos/base/shell/cmd/dir.c

Modified: trunk/reactos/base/shell/cmd/console.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/console.c?rev=76003&r1=76002&r2=76003&view=diff
==
--- trunk/reactos/base/shell/cmd/console.c  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/console.c  [iso-8859-1] Sat Sep 30 
15:28:06 2017
@@ -50,6 +50,10 @@
 return GetConsoleMode(hHandle, &dwMode);
 }
 
+
+
+/* Console STREAM IN utility functions 
/
+
 VOID ConInDisable(VOID)
 {
 HANDLE hInput = GetStdHandle(STD_INPUT_HANDLE);
@@ -60,7 +64,6 @@
 SetConsoleMode(hInput, dwMode);
 }
 
-
 VOID ConInEnable(VOID)
 {
 HANDLE hInput = GetStdHandle(STD_INPUT_HANDLE);
@@ -71,12 +74,10 @@
 SetConsoleMode(hInput, dwMode);
 }
 
-
-VOID ConInFlush (VOID)
+VOID ConInFlush(VOID)
 {
 FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE));
 }
-
 
 VOID ConInKey(PINPUT_RECORD lpBuffer)
 {
@@ -95,7 +96,6 @@
 }
 while (TRUE);
 }
-
 
 VOID ConInString(LPTSTR lpInput, DWORD dwLength)
 {
@@ -134,6 +134,10 @@
 
 SetConsoleMode(hFile, dwOldMode);
 }
+
+
+
+/ Console STREAM OUT utility functions 
/
 
 static VOID ConWrite(TCHAR *str, DWORD len, DWORD nStdHandle)
 {
@@ -266,13 +270,6 @@
 ConWrite(szText, (DWORD)_tcslen(szText), nStdHandle);
 }
 
-VOID ConOutResPaging(BOOL NewPage, UINT resID)
-{
-TCHAR szMsg[RC_STRING_MAX_SIZE];
-LoadString(CMD_ModuleHandle, resID, szMsg, ARRAYSIZE(szMsg));
-ConOutPrintfPaging(NewPage, szMsg);
-}
-
 VOID ConOutResPuts(UINT resID)
 {
 TCHAR szMsg[RC_STRING_MAX_SIZE];
@@ -285,97 +282,13 @@
 ConPuts(szText, STD_OUTPUT_HANDLE);
 }
 
-
-VOID ConPrintf(LPTSTR szFormat, va_list arg_ptr, DWORD nStdHandle)
+VOID ConPrintfV(DWORD nStdHandle, LPTSTR szFormat, va_list arg_ptr)
 {
 TCHAR szOut[OUTPUT_BUFFER_SIZE];
 DWORD len;
 
 len = (DWORD)_vstprintf(szOut, szFormat, arg_ptr);
 ConWrite(szOut, len, nStdHandle);
-}
-
-INT ConPrintfPaging(BOOL NewPage, LPTSTR szFormat, va_list arg_ptr, DWORD 
nStdHandle)
-{
-INT len;
-CONSOLE_SCREEN_BUFFER_INFO csbi;
-TCHAR szOut[OUTPUT_BUFFER_SIZE];
-DWORD dwWritten;
-HANDLE hOutput = GetStdHandle(nStdHandle);
-
-/* Used to count number of lines since last pause */
-static int LineCount = 0;
-
-/* Used to see how big the screen is */
-int ScreenLines = 0;
-
-/* Chars since start of line */
-int CharSL;
-
-int from = 0, i = 0;
-
-if (NewPage == TRUE)
-LineCount = 0;
-
-/* Reset LineCount and return if no string has been given */
-if (szFormat == NULL)
-return 0;
-
-/* Get the size of the visual screen that can be printed to */
-if (!IsConsoleHandle(hOutput) || !GetConsoleScreenBufferInfo(hOutput, 
&csbi))
-{
-/* We assume it's a file handle */
-ConPrintf(szFormat, arg_ptr, nStdHandle);
-return 0;
-}
-
-/*
- * Get the number of lines currently displayed on screen, minus 1
- * to account for the "press any key..." prompt from PagePrompt().
- */
-ScreenLines = (csbi.srWindow.Bottom - csbi.srWindow.Top);
-CharSL = csbi.dwCursorPosition.X;
-
-/* Make sure the user doesn't have the screen too small */
-if (ScreenLines < 4)
-{
-ConPrintf(szFormat, arg_ptr, nStdHandle);
-return 0;
-}
-
-len = _vstprintf(szOut, szFormat, arg_ptr);
-
-while (i < len)
-{
-/* Search until the end of a line is reached */
-if (szOut[i++] != _T('\n') && ++CharSL < csbi.dwSize.X)
-continue;
-
-LineCount++;
-CharSL=0;
-
-if (LineCount >= ScreenLines)
-{
-WriteConsole(hOutput, &szOut[from], i-from, &dwWritten, NULL);
-from = i;
-
-/* Prompt the user */
-if (PagePrompt() != PROMPT_YES)
-{
-return 1;
-}
-
-// TODO: Recalculate 'ScreenLines' in case the user redimensions
-// the window during the prompt.
-
-/* Reset the number of lines being printed */
-LineCount = 0;
-}
-}
-
-WriteConsole(hOutput, &szOut[from], i-from, &dwWritten, NULL);
-
-return 0;
 }
 
 VOID ConErrFormatMessage(DWORD MessageId, ...)
@@ -443,7 +356,7 @@
 
 va_start(arg_ptr, resID);
 LoadString(CMD_ModuleHandle, resID, szMsg, ARRAYSIZE(szMsg));
-ConPrintf(szMsg, 

[ros-diffs] [hbelusca] 76002: [CMD]: Move console management prototypes to their own header.

2017-09-30 Thread hbelusca
Author: hbelusca
Date: Sat Sep 30 15:09:38 2017
New Revision: 76002

URL: http://svn.reactos.org/svn/reactos?rev=76002&view=rev
Log:
[CMD]: Move console management prototypes to their own header.

Added:
trunk/reactos/base/shell/cmd/console.h   (with props)
Modified:
trunk/reactos/base/shell/cmd/cmd.h

Modified: trunk/reactos/base/shell/cmd/cmd.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.h?rev=76002&r1=76001&r2=76002&view=diff
==
--- trunk/reactos/base/shell/cmd/cmd.h  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmd.h  [iso-8859-1] Sat Sep 30 15:09:38 2017
@@ -40,7 +40,6 @@
 #define BREAK_IGNORE 4
 
 /* define some error messages */
-
 #define D_ON _T("on")
 #define D_OFF_T("off")
 
@@ -78,11 +77,9 @@
 /* Prototypes for ATTRIB.C */
 INT CommandAttrib (LPTSTR);
 
-
 /* Prototypes for BEEP.C */
 INT cmd_beep (LPTSTR);
 
-
 /* Prototypes for CALL.C */
 INT cmd_call (LPTSTR);
 
@@ -90,10 +87,8 @@
 /* Prototypes for CHOICE.C */
 INT CommandChoice (LPTSTR);
 
-
 /* Prototypes for CLS.C */
 INT cmd_cls (LPTSTR);
-
 
 /* Prototypes for CMD.C */
 INT ConvertULargeInteger(ULONGLONG num, LPTSTR des, UINT len, BOOL 
bPutSeparator);
@@ -145,76 +140,25 @@
 /* Prototypes for COLOR.C */
 INT CommandColor(LPTSTR);
 
-VOID ConInDummy (VOID);
-VOID ConInDisable (VOID);
-VOID ConInEnable (VOID);
-VOID ConInFlush (VOID);
-VOID ConInKey (PINPUT_RECORD);
-VOID ConInString (LPTSTR, DWORD);
-
-VOID ConOutChar (TCHAR);
-VOID ConOutPuts (LPTSTR);
-VOID ConPrintf(LPTSTR, va_list, DWORD);
-INT ConPrintfPaging(BOOL NewPage, LPTSTR, va_list, DWORD);
-VOID ConOutPrintf (LPTSTR, ...);
-INT ConOutPrintfPaging (BOOL NewPage, LPTSTR, ...);
-VOID ConErrChar (TCHAR);
-VOID ConErrPuts (LPTSTR);
-VOID ConErrPrintf (LPTSTR, ...);
-VOID ConOutFormatMessage (DWORD MessageId, ...);
-VOID ConErrFormatMessage (DWORD MessageId, ...);
-
-SHORT GetCursorX  (VOID);
-SHORT GetCursorY  (VOID);
-VOID  GetCursorXY (PSHORT, PSHORT);
-VOID  SetCursorXY (SHORT, SHORT);
-
-VOID GetScreenSize (PSHORT, PSHORT);
-VOID SetCursorType (BOOL, BOOL);
-
-VOID ConOutResPuts (UINT resID);
-VOID ConErrResPuts (UINT resID);
-VOID ConOutResPrintf (UINT resID, ...);
-VOID ConErrResPrintf (UINT resID, ...);
-VOID ConOutResPaging(BOOL NewPage, UINT resID);
-
-
-BOOL ConSetTitle(IN LPCTSTR lpConsoleTitle);
-
-#ifdef INCLUDE_CMD_BEEP
-VOID ConRingBell(HANDLE hOutput);
-#endif
-
-#ifdef INCLUDE_CMD_CLS
-VOID ConClearScreen(HANDLE hOutput);
-#endif
-
-#ifdef INCLUDE_CMD_COLOR
-BOOL ConSetScreenColor(WORD wColor, BOOL bFill);
-#endif
-
+/* Prototypes for CONSOLE.C */
+#include "console.h"
 
 /* Prototypes for COPY.C */
 INT cmd_copy (LPTSTR);
 
-
 /* Prototypes for DATE.C */
 INT cmd_date (LPTSTR);
 
-
 /* Prototypes for DEL.C */
 INT CommandDelete (LPTSTR);
 
-
 /* Prototypes for DELAY.C */
 INT CommandDelay (LPTSTR);
-
 
 /* Prototypes for DIR.C */
 INT FormatDate (TCHAR *, LPSYSTEMTIME, BOOL);
 INT FormatTime (TCHAR *, LPSYSTEMTIME);
 INT CommandDir (LPTSTR);
-
 
 /* Prototypes for DIRSTACK.C */
 VOID InitDirectoryStack (VOID);
@@ -224,14 +168,12 @@
 INT  CommandPopd (LPTSTR);
 INT  CommandDirs (LPTSTR);
 
-
 /* Prototypes for ECHO.C */
 BOOL OnOffCommand(LPTSTR param, LPBOOL flag, INT message);
 INT  CommandEcho (LPTSTR);
 INT  CommandEchos (LPTSTR);
 INT  CommandEchoerr (LPTSTR);
 INT  CommandEchoserr (LPTSTR);
-
 
 /* Prototypes for ERROR.C */
 VOID ErrorMessage (DWORD, LPTSTR, ...);
@@ -252,7 +194,6 @@
 
 VOID msg_pause (VOID);
 
-
 /* Prototypes for FILECOMP.C */
 #ifdef FEATURE_UNIX_FILENAME_COMPLETION
 VOID CompleteFilename (LPTSTR, UINT);
@@ -275,10 +216,8 @@
 /* Prototypes for FREE.C */
 INT CommandFree (LPTSTR);
 
-
 /* Prototypes for GOTO.C */
 INT cmd_goto (LPTSTR);
-
 
 /* Prototypes for HISTORY.C */
 #ifdef FEATURE_HISTORY
@@ -291,7 +230,6 @@
 INT CommandHistory (LPTSTR param);
 #endif
 
-
 /* Prototypes for IF.C */
 #define IFFLAG_NEGATE 1 /* NOT */
 #define IFFLAG_IGNORECASE 2 /* /I  */
@@ -299,7 +237,6 @@
IF_STRINGEQ, /* == */
IF_EQU, IF_GTR, IF_GEQ, IF_LSS, IF_LEQ, IF_NEQ };
 INT ExecuteIf(struct _PARSED_COMMAND *Cmd);
-
 
 /* Prototypes for INTERNAL.C */
 VOID InitLastPath (VOID);
@@ -314,7 +251,6 @@
 /* Prototypes for LABEL.C */
 INT cmd_label (LPTSTR);
 
-
 /* Prototypes for LOCALE.C */
 extern TCHAR cDateSeparator;
 extern INT   nDateFormat;
@@ -324,22 +260,15 @@
 extern TCHAR cDecimalSeparator;
 extern INT nNumberGroups;
 
-
 VOID InitLocale (VOID);
 LPTSTR GetDateString (VOID);
 LPTSTR GetTimeString (VOID);
 
-/* cache codepage */
-extern UINT InputCodePage;
-extern UINT OutputCodePage;
-
 /* Prototypes for MEMORY.C */
 INT CommandMemory (LPTSTR);
 
-
 /* Prototypes for MKLINK.C */
 INT cmd_mklink(LPTSTR);
-
 
 /* Prototypes for MISC.C */
 INT GetRootPath(TCHAR *InPath,TCHAR *OutPath,INT size);
@@ -367,14 +296,11 @@
 INT FilePromptYN (UINT);

[ros-diffs] [hbelusca] 76001: [CMD]: Addendum to r76000, with ConSetTitle.

2017-09-30 Thread hbelusca
Author: hbelusca
Date: Sat Sep 30 14:26:34 2017
New Revision: 76001

URL: http://svn.reactos.org/svn/reactos?rev=76001&view=rev
Log:
[CMD]: Addendum to r76000, with ConSetTitle.

Modified:
trunk/reactos/base/shell/cmd/cmd.c
trunk/reactos/base/shell/cmd/cmd.h
trunk/reactos/base/shell/cmd/console.c
trunk/reactos/base/shell/cmd/title.c

Modified: trunk/reactos/base/shell/cmd/cmd.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.c?rev=76001&r1=76000&r2=76001&view=diff
==
--- trunk/reactos/base/shell/cmd/cmd.c  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmd.c  [iso-8859-1] Sat Sep 30 14:26:34 2017
@@ -378,7 +378,7 @@
 GetConsoleTitle(szWindowTitle, ARRAYSIZE(szWindowTitle));
 bTitleSet = FALSE;
 _stprintf(szNewTitle, _T("%s - %s%s"), szWindowTitle, First, Rest);
-SetConsoleTitle(szNewTitle);
+ConSetTitle(szNewTitle);
 
 /* check if this is a .BAT or .CMD file */
 dot = _tcsrchr (szFullName, _T('.'));
@@ -479,7 +479,7 @@
 
 /* Restore the original console title */
 if (!bTitleSet)
-SetConsoleTitle(szWindowTitle);
+ConSetTitle(szWindowTitle);
 
 return dwExitCode;
 }

Modified: trunk/reactos/base/shell/cmd/cmd.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.h?rev=76001&r1=76000&r2=76001&view=diff
==
--- trunk/reactos/base/shell/cmd/cmd.h  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmd.h  [iso-8859-1] Sat Sep 30 14:26:34 2017
@@ -177,6 +177,9 @@
 VOID ConOutResPrintf (UINT resID, ...);
 VOID ConErrResPrintf (UINT resID, ...);
 VOID ConOutResPaging(BOOL NewPage, UINT resID);
+
+
+BOOL ConSetTitle(IN LPCTSTR lpConsoleTitle);
 
 #ifdef INCLUDE_CMD_BEEP
 VOID ConRingBell(HANDLE hOutput);

Modified: trunk/reactos/base/shell/cmd/console.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/console.c?rev=76001&r1=76000&r2=76001&view=diff
==
--- trunk/reactos/base/shell/cmd/console.c  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/console.c  [iso-8859-1] Sat Sep 30 
14:26:34 2017
@@ -568,6 +568,12 @@
 
 
 
+BOOL ConSetTitle(IN LPCTSTR lpConsoleTitle)
+{
+/* Now really set the console title */
+return SetConsoleTitle(lpConsoleTitle);
+}
+
 #ifdef INCLUDE_CMD_BEEP
 VOID ConRingBell(HANDLE hOutput)
 {

Modified: trunk/reactos/base/shell/cmd/title.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/title.c?rev=76001&r1=76000&r2=76001&view=diff
==
--- trunk/reactos/base/shell/cmd/title.c[iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/title.c[iso-8859-1] Sat Sep 30 
14:26:34 2017
@@ -15,7 +15,7 @@
 
 extern BOOL bTitleSet;
 
-INT cmd_title (LPTSTR param)
+INT cmd_title(LPTSTR param)
 {
 /* Do nothing if no args */
 if (*param == _T('\0'))
@@ -24,14 +24,14 @@
 /* Asking help? */
 if (!_tcsncmp(param, _T("/?"), 2))
 {
-ConOutResPaging(TRUE,STRING_TITLE_HELP);
+ConOutResPaging(TRUE, STRING_TITLE_HELP);
 return 0;
 }
 
 bTitleSet = TRUE;
-return SetConsoleTitle (param);
+return ConSetTitle(param);
 }
 
-#endif /* def INCLUDE_CMD_TITLE */
+#endif /* INCLUDE_CMD_TITLE */
 
 /* EOF */




[ros-diffs] [hbelusca] 76000: [CMD]: Little refactoring to lay out the way to using the CONUTILS library in CMD. - Move the code used to beep, clear screen, and color the screen into console.c ; - Ren

2017-09-30 Thread hbelusca
Author: hbelusca
Date: Sat Sep 30 14:10:21 2017
New Revision: 76000

URL: http://svn.reactos.org/svn/reactos?rev=76000&view=rev
Log:
[CMD]: Little refactoring to lay out the way to using the CONUTILS library in 
CMD.
- Move the code used to beep, clear screen, and color the screen into console.c 
;
- Rename SetScreenColor into ConSetScreenColor, and invert its second parameter 
(bNoFill -> bFill); its default behaviour is to fill all the screen.

Modified:
trunk/reactos/base/shell/cmd/beep.c
trunk/reactos/base/shell/cmd/cls.c
trunk/reactos/base/shell/cmd/cmd.c
trunk/reactos/base/shell/cmd/cmd.h
trunk/reactos/base/shell/cmd/color.c
trunk/reactos/base/shell/cmd/console.c

Modified: trunk/reactos/base/shell/cmd/beep.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/beep.c?rev=76000&r1=75999&r2=76000&view=diff
==
--- trunk/reactos/base/shell/cmd/beep.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/beep.c [iso-8859-1] Sat Sep 30 14:10:21 2017
@@ -41,8 +41,8 @@
 if (bc == NULL)
 return 1;
 #endif
-MessageBeep (-1);
 
+ConRingBell(GetStdHandle(STD_OUTPUT_HANDLE));
 return 0;
 }
 

Modified: trunk/reactos/base/shell/cmd/cls.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cls.c?rev=76000&r1=75999&r2=76000&view=diff
==
--- trunk/reactos/base/shell/cmd/cls.c  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cls.c  [iso-8859-1] Sat Sep 30 14:10:21 2017
@@ -32,34 +32,13 @@
 
 INT cmd_cls(LPTSTR param)
 {
-HANDLE hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
-CONSOLE_SCREEN_BUFFER_INFO csbi;
-COORD coPos;
-DWORD dwWritten;
-
 if (!_tcsncmp(param, _T("/?"), 2))
 {
 ConOutResPaging(TRUE, STRING_CLS_HELP);
 return 0;
 }
 
-if (GetConsoleScreenBufferInfo(hOutput, &csbi))
-{
-coPos.X = 0;
-coPos.Y = 0;
-FillConsoleOutputAttribute(hOutput, csbi.wAttributes,
-   csbi.dwSize.X * csbi.dwSize.Y,
-   coPos, &dwWritten);
-FillConsoleOutputCharacter(hOutput, _T(' '),
-   csbi.dwSize.X * csbi.dwSize.Y,
-   coPos, &dwWritten);
-SetConsoleCursorPosition(hOutput, coPos);
-}
-else
-{
-ConOutChar(_T('\f'));
-}
-
+ConClearScreen(GetStdHandle(STD_OUTPUT_HANDLE));
 return 0;
 }
 

Modified: trunk/reactos/base/shell/cmd/cmd.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.c?rev=76000&r1=75999&r2=76000&view=diff
==
--- trunk/reactos/base/shell/cmd/cmd.c  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmd.c  [iso-8859-1] Sat Sep 30 14:10:21 2017
@@ -1956,7 +1956,7 @@
 }
 
 if (wDefColor != 0)
-SetScreenColor(wDefColor, FALSE);
+ConSetScreenColor(wDefColor, TRUE);
 #endif
 
 if (!*ptr)

Modified: trunk/reactos/base/shell/cmd/cmd.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.h?rev=76000&r1=75999&r2=76000&view=diff
==
--- trunk/reactos/base/shell/cmd/cmd.h  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmd.h  [iso-8859-1] Sat Sep 30 14:10:21 2017
@@ -143,7 +143,6 @@
 LPCTSTR GetParsedEnvVar ( LPCTSTR varName, UINT* varNameLen, BOOL ModeSetA );
 
 /* Prototypes for COLOR.C */
-BOOL SetScreenColor(WORD wColor, BOOL bNoFill);
 INT CommandColor(LPTSTR);
 
 VOID ConInDummy (VOID);
@@ -178,6 +177,19 @@
 VOID ConOutResPrintf (UINT resID, ...);
 VOID ConErrResPrintf (UINT resID, ...);
 VOID ConOutResPaging(BOOL NewPage, UINT resID);
+
+#ifdef INCLUDE_CMD_BEEP
+VOID ConRingBell(HANDLE hOutput);
+#endif
+
+#ifdef INCLUDE_CMD_CLS
+VOID ConClearScreen(HANDLE hOutput);
+#endif
+
+#ifdef INCLUDE_CMD_COLOR
+BOOL ConSetScreenColor(WORD wColor, BOOL bFill);
+#endif
+
 
 /* Prototypes for COPY.C */
 INT cmd_copy (LPTSTR);

Modified: trunk/reactos/base/shell/cmd/color.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/color.c?rev=76000&r1=75999&r2=76000&view=diff
==
--- trunk/reactos/base/shell/cmd/color.c[iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/color.c[iso-8859-1] Sat Sep 30 
14:10:21 2017
@@ -24,36 +24,6 @@
 
 #ifdef INCLUDE_CMD_COLOR
 
-BOOL SetScreenColor(WORD wColor, BOOL bNoFill)
-{
-HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
-DWORD dwWritten;
-CONSOLE_SCREEN_BUFFER_INFO csbi;
-COORD coPos;
-
-/* Foreground and Background colors can'

[ros-diffs] [hbelusca] 75999: [CMD]: Minor modifications in the files I'm going to touch next: - Use ARRAYSIZE() instead of hardcoding string buffer max. number of chars. - Un-globalize a variable; re

2017-09-30 Thread hbelusca
Author: hbelusca
Date: Sat Sep 30 14:04:24 2017
New Revision: 75999

URL: http://svn.reactos.org/svn/reactos?rev=75999&view=rev
Log:
[CMD]: Minor modifications in the files I'm going to touch next:
- Use ARRAYSIZE() instead of hardcoding string buffer max. number of chars.
- Un-globalize a variable; remove dead defines.
- Minor code formatting fixes.

Modified:
trunk/reactos/base/shell/cmd/beep.c
trunk/reactos/base/shell/cmd/cls.c
trunk/reactos/base/shell/cmd/cmd.c
trunk/reactos/base/shell/cmd/cmd.h
trunk/reactos/base/shell/cmd/color.c

Modified: trunk/reactos/base/shell/cmd/beep.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/beep.c?rev=75999&r1=75998&r2=75999&view=diff
==
--- trunk/reactos/base/shell/cmd/beep.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/beep.c [iso-8859-1] Sat Sep 30 14:04:24 2017
@@ -28,12 +28,11 @@
 
 #ifdef INCLUDE_CMD_BEEP
 
-
-INT cmd_beep (LPTSTR param)
+INT cmd_beep(LPTSTR param)
 {
-if (_tcsncmp (param, _T("/?"), 2) == 0)
+if (_tcsncmp(param, _T("/?"), 2) == 0)
 {
-ConOutResPaging(TRUE,STRING_BEEP_HELP);
+ConOutResPaging(TRUE, STRING_BEEP_HELP);
 return 0;
 }
 
@@ -46,4 +45,5 @@
 
 return 0;
 }
+
 #endif

Modified: trunk/reactos/base/shell/cmd/cls.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cls.c?rev=75999&r1=75998&r2=75999&view=diff
==
--- trunk/reactos/base/shell/cmd/cls.c  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cls.c  [iso-8859-1] Sat Sep 30 14:04:24 2017
@@ -30,16 +30,16 @@
 
 #ifdef INCLUDE_CMD_CLS
 
-INT cmd_cls (LPTSTR param)
+INT cmd_cls(LPTSTR param)
 {
 HANDLE hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
 CONSOLE_SCREEN_BUFFER_INFO csbi;
 COORD coPos;
 DWORD dwWritten;
 
-if (!_tcsncmp (param, _T("/?"), 2))
+if (!_tcsncmp(param, _T("/?"), 2))
 {
-ConOutResPaging(TRUE,STRING_CLS_HELP);
+ConOutResPaging(TRUE, STRING_CLS_HELP);
 return 0;
 }
 
@@ -62,4 +62,5 @@
 
 return 0;
 }
+
 #endif

Modified: trunk/reactos/base/shell/cmd/cmd.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.c?rev=75999&r1=75998&r2=75999&view=diff
==
--- trunk/reactos/base/shell/cmd/cmd.c  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmd.c  [iso-8859-1] Sat Sep 30 14:04:24 2017
@@ -144,10 +144,6 @@
 #include "precomp.h"
 #include 
 #include 
-
-#ifndef NT_SUCCESS
-#define NT_SUCCESS(StatCode)  ((NTSTATUS)(StatCode) >= 0)
-#endif
 
 typedef NTSTATUS (WINAPI *NtQueryInformationProcessProc)(HANDLE, 
PROCESSINFOCLASS,
   PVOID, ULONG, 
PULONG);
@@ -167,7 +163,6 @@
 BOOL bTitleSet = FALSE;
 DWORD dwChildProcessId = 0;
 HANDLE hIn;
-HANDLE hOut;
 LPTSTR lpOriginalEnvironment;
 HANDLE CMD_ModuleHandle;
 
@@ -379,6 +374,7 @@
 return 1;
 }
 
+/* Save the original console title and build a new one */
 GetConsoleTitle(szWindowTitle, ARRAYSIZE(szWindowTitle));
 bTitleSet = FALSE;
 _stprintf(szNewTitle, _T("%s - %s%s"), szWindowTitle, First, Rest);
@@ -480,6 +476,8 @@
 /* Get code page if it has been changed */
 InputCodePage= GetConsoleCP();
 OutputCodePage = GetConsoleOutputCP();
+
+/* Restore the original console title */
 if (!bTitleSet)
 SetConsoleTitle(szWindowTitle);
 
@@ -565,7 +563,7 @@
  * process the command line and execute the appropriate functions
  * full input/output redirection and piping are supported
  */
-INT ParseCommandLine (LPTSTR cmd)
+INT ParseCommandLine(LPTSTR cmd)
 {
 INT Ret = 0;
 PARSED_COMMAND *Cmd = ParseCommand(cmd);
@@ -591,7 +589,7 @@
 PROCESS_INFORMATION prci;
 
 /* Get the path to cmd.exe */
-GetModuleFileName(NULL, CmdPath, MAX_PATH);
+GetModuleFileName(NULL, CmdPath, ARRAYSIZE(CmdPath));
 
 /* Build the parameter string to pass to cmd.exe */
 ParamsEnd = _stpcpy(CmdParams, _T("/S/D/C\""));
@@ -1414,7 +1412,7 @@
 }
 
 static VOID
-ProcessInput()
+ProcessInput(VOID)
 {
 PARSED_COMMAND *Cmd;
 
@@ -1487,15 +1485,15 @@
 }
 
 
-VOID AddBreakHandler (VOID)
-{
-SetConsoleCtrlHandler ((PHANDLER_ROUTINE)BreakHandler, TRUE);
-}
-
-
-VOID RemoveBreakHandler (VOID)
-{
-SetConsoleCtrlHandler ((PHANDLER_ROUTINE)BreakHandler, FALSE);
+VOID AddBreakHandler(VOID)
+{
+SetConsoleCtrlHandler(BreakHandler, TRUE);
+}
+
+
+VOID RemoveBreakHandler(VOID)
+{
+SetConsoleCtrlHandler(BreakHandler, FALSE);
 }
 
 
@@ -1505,7 +1503,7 @@
  */
 #if 0
 static VOID
-ShowCommands (VOID)
+ShowCommands(VOID)
 {
 /* print command list */
 ConOutResPuts(STRING_C

[ros-diffs] [hbelusca] 75997: [CMD]: Diverse improvements: - Add pre-support for "enable extensions". - Load CMD settings at startup from the registry (from HKLM and HKCU Software\\Microsoft\\Command

2017-09-30 Thread hbelusca
Author: hbelusca
Date: Sat Sep 30 11:39:08 2017
New Revision: 75997

URL: http://svn.reactos.org/svn/reactos?rev=75997&view=rev
Log:
[CMD]: Diverse improvements:
- Add pre-support for "enable extensions".
- Load CMD settings at startup from the registry (from HKLM and HKCU
  Software\\Microsoft\\Command Processor reg key), as done by Windows' CMD.EXE.
- Add support for CMD.EXE /E(:OFF), /X, /Y command-line switches.
- Correctly set the console colors when using CMD.EXE /T: switch.
- Start support for two control characters for the completion: the standard 
CompletionChar
  and the PathCompletionChar (if one desires to autocomplete *just* directory
  names -- or associated -- but not everything), as Windows' CMD.EXE offers.

Modified:
trunk/reactos/base/shell/cmd/cmd.c
trunk/reactos/base/shell/cmd/cmd.h
trunk/reactos/base/shell/cmd/cmdinput.c
trunk/reactos/base/shell/cmd/setlocal.c

Modified: trunk/reactos/base/shell/cmd/cmd.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.c?rev=75997&r1=75996&r2=75997&view=diff
==
--- trunk/reactos/base/shell/cmd/cmd.c  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmd.c  [iso-8859-1] Sat Sep 30 11:39:08 2017
@@ -162,6 +162,7 @@
 CRITICAL_SECTION ChildProcessRunningLock;
 BOOL bUnicodeOutput = FALSE;
 BOOL bDisableBatchEcho = FALSE;
+BOOL bEnableExtensions = TRUE;
 BOOL bDelayedExpansion = FALSE;
 BOOL bTitleSet = FALSE;
 DWORD dwChildProcessId = 0;
@@ -174,7 +175,7 @@
 static NtReadVirtualMemoryProc   NtReadVirtualMemoryPtr = NULL;
 
 #ifdef INCLUDE_CMD_COLOR
-WORD wDefColor;   /* default color */
+WORD wDefColor = 0; /* Default color */
 #endif
 
 /*
@@ -1532,14 +1533,164 @@
 }
 #endif
 
+
 static VOID
-ExecuteAutoRunFile(HKEY hkeyRoot)
+LoadRegistrySettings(HKEY hKeyRoot)
+{
+LONG lRet;
+HKEY hKey;
+/*
+ * Buffer big enough to hold the string L"4294967295",
+ * corresponding to the literal 0x (MAX_ULONG) in decimal.
+ */
+DWORD Buffer[6];
+DWORD dwType, len;
+
+lRet = RegOpenKeyEx(hKeyRoot,
+_T("Software\\Microsoft\\Command Processor"),
+0,
+KEY_QUERY_VALUE,
+&hKey);
+if (lRet != ERROR_SUCCESS)
+return;
+
+#ifdef INCLUDE_CMD_COLOR
+len = sizeof(Buffer);
+lRet = RegQueryValueEx(hKey,
+   _T("DefaultColor"),
+   NULL,
+   &dwType,
+   (LPBYTE)&Buffer,
+   &len);
+if (lRet == ERROR_SUCCESS)
+{
+/* Overwrite the default attributes */
+if (dwType == REG_DWORD)
+wDefColor = (WORD)*(PDWORD)Buffer;
+else if (dwType == REG_SZ)
+wDefColor = (WORD)_tcstol((PTSTR)Buffer, NULL, 0);
+}
+// else, use the default attributes retrieved before.
+#endif
+
+#if 0
+len = sizeof(Buffer);
+lRet = RegQueryValueEx(hKey,
+   _T("DisableUNCCheck"),
+   NULL,
+   &dwType,
+   (LPBYTE)&Buffer,
+   &len);
+if (lRet == ERROR_SUCCESS)
+{
+/* Overwrite the default setting */
+if (dwType == REG_DWORD)
+bDisableUNCCheck = !!*(PDWORD)Buffer;
+else if (dwType == REG_SZ)
+bDisableUNCCheck = (_ttol((PTSTR)Buffer) == 1);
+}
+// else, use the default setting set globally.
+#endif
+
+len = sizeof(Buffer);
+lRet = RegQueryValueEx(hKey,
+   _T("DelayedExpansion"),
+   NULL,
+   &dwType,
+   (LPBYTE)&Buffer,
+   &len);
+if (lRet == ERROR_SUCCESS)
+{
+/* Overwrite the default setting */
+if (dwType == REG_DWORD)
+bDelayedExpansion = !!*(PDWORD)Buffer;
+else if (dwType == REG_SZ)
+bDelayedExpansion = (_ttol((PTSTR)Buffer) == 1);
+}
+// else, use the default setting set globally.
+
+len = sizeof(Buffer);
+lRet = RegQueryValueEx(hKey,
+   _T("EnableExtensions"),
+   NULL,
+   &dwType,
+   (LPBYTE)&Buffer,
+   &len);
+if (lRet == ERROR_SUCCESS)
+{
+/* Overwrite the default setting */
+if (dwType == REG_DWORD)
+bEnableExtensions = !!*(PDWORD)Buffer;
+else if (dwType == REG_SZ)
+bEnableExtensions = (_ttol((PTSTR)Buffer) == 1);
+}
+// else, use the default setting set globally.
+
+len = sizeof(Buffer);
+

[ros-diffs] [hbelusca] 75996: [ASM]: CORE-13850 #comment Fix MASM compilation errors with the CFI annotation macros substitutes (broken by r75989).

2017-09-30 Thread hbelusca
Author: hbelusca
Date: Sat Sep 30 10:29:50 2017
New Revision: 75996

URL: http://svn.reactos.org/svn/reactos?rev=75996&view=rev
Log:
[ASM]: CORE-13850 #comment Fix MASM compilation errors with the CFI annotation 
macros substitutes (broken by r75989).

Modified:
trunk/reactos/sdk/include/asm/asm.inc

Modified: trunk/reactos/sdk/include/asm/asm.inc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/asm/asm.inc?rev=75996&r1=75995&r2=75996&view=diff
==
--- trunk/reactos/sdk/include/asm/asm.inc   [iso-8859-1] (original)
+++ trunk/reactos/sdk/include/asm/asm.inc   [iso-8859-1] Sat Sep 30 
10:29:50 2017
@@ -201,16 +201,26 @@
 #define NUL 0
 
 /* For compatibility with GAS */
-#define CFI_STARTPROC
-#define CFI_ENDPROC
-#define CFI_ADJUST_CFA_OFFSET
-#define CFI_OFFSET
-#define CFI_REGISTER
-#define CFI_DEF_CFA_REGISTER
-#define CFI_DEF_CFA
-#define CFI_REL_OFFSET
-#define CFI_SAME_VALUE
-#define CFI_DEF_CFA_OFFSET
+CFI_STARTPROC MACRO start
+ENDM
+CFI_ENDPROC MACRO
+ENDM
+CFI_DEF_CFA MACRO reg:REQ, offset:REQ
+ENDM
+CFI_DEF_CFA_OFFSET MACRO offset:REQ
+ENDM
+CFI_DEF_CFA_REGISTER MACRO reg:REQ
+ENDM
+CFI_ADJUST_CFA_OFFSET MACRO offset:REQ
+ENDM
+CFI_OFFSET MACRO reg:REQ, offset:REQ
+ENDM
+CFI_REGISTER MACRO reg1:REQ, reg2:REQ
+ENDM
+CFI_REL_OFFSET MACRO reg:REQ, offset:REQ
+ENDM
+CFI_SAME_VALUE MACRO reg:REQ
+ENDM
 
 #else /***/
 
@@ -387,14 +397,14 @@
 /* CFI annotations */
 #define CFI_STARTPROC .cfi_startproc
 #define CFI_ENDPROC .cfi_endproc
+#define CFI_DEF_CFA .cfi_def_cfa
+#define CFI_DEF_CFA_OFFSET .cfi_def_cfa_offset
+#define CFI_DEF_CFA_REGISTER .cfi_def_cfa_register
 #define CFI_ADJUST_CFA_OFFSET .cfi_adjust_cfa_offset
 #define CFI_OFFSET .cfi_offset
 #define CFI_REGISTER .cfi_register
-#define CFI_DEF_CFA_REGISTER .cfi_def_cfa_register
-#define CFI_DEF_CFA .cfi_def_cfa
 #define CFI_REL_OFFSET .cfi_rel_offset
 #define CFI_SAME_VALUE .cfi_same_value
-#define CFI_DEF_CFA_OFFSET .cfi_def_cfa_offset
 
 #endif
 




[ros-diffs] [hbelusca] 75995: [ASM]: Code formatting only.

2017-09-30 Thread hbelusca
Author: hbelusca
Date: Sat Sep 30 10:29:06 2017
New Revision: 75995

URL: http://svn.reactos.org/svn/reactos?rev=75995&view=rev
Log:
[ASM]: Code formatting only.

Modified:
trunk/reactos/sdk/include/asm/asm.inc

Modified: trunk/reactos/sdk/include/asm/asm.inc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/asm/asm.inc?rev=75995&r1=75994&r2=75995&view=diff
==
--- trunk/reactos/sdk/include/asm/asm.inc   [iso-8859-1] (original)
+++ trunk/reactos/sdk/include/asm/asm.inc   [iso-8859-1] Sat Sep 30 
10:29:06 2017
@@ -11,9 +11,9 @@
 
 /* Common definitions for FPO macro
see http://msdn.microsoft.com/en-us/library/ms679352%28VS.85%29.aspx */
-#define FRAME_FPO 0
-#define FRAME_TRAP 1
-#define FRAME_TSS 2
+#define FRAME_FPO0
+#define FRAME_TRAP   1
+#define FRAME_TSS2
 #define FRAME_NONFPO 3
 
 #ifdef _USE_ML
@@ -193,7 +193,6 @@
 __absolute__address__ = __absolute__address__ + size
 ENDM
 
-
 /* We need this to distinguish repeat from macros */
 #define ENDR ENDM
 
@@ -201,7 +200,7 @@
 #define LF 10
 #define NUL 0
 
-/* For compatibility with gas */
+/* For compatibility with GAS */
 #define CFI_STARTPROC
 #define CFI_ENDPROC
 #define CFI_ADJUST_CFA_OFFSET
@@ -237,7 +236,7 @@
 .macro .PROC name
 .func \name
 #ifdef _X86_
-/* x86 gas expects a label with _ prefix */
+/* x86 GAS expects a label with _ prefix */
 _\name:
 #endif
 \name:
@@ -381,8 +380,8 @@
 #define else .else
 #define elseif .elseif
 
-#define CR "\r"
-#define LF "\n"
+#define CR  "\r"
+#define LF  "\n"
 #define NUL "\0"
 
 /* CFI annotations */




[ros-diffs] [hbelusca] 75994: [CMD]: Fix translations for the COLOR command. For few translations, the COLOR command help contained a deprecated /F switch, which was changed long time ago to the /-F s

2017-09-30 Thread hbelusca
Author: hbelusca
Date: Sat Sep 30 09:50:08 2017
New Revision: 75994

URL: http://svn.reactos.org/svn/reactos?rev=75994&view=rev
Log:
[CMD]: Fix translations for the COLOR command.

For few translations, the COLOR command help contained a deprecated /F switch,
which was changed long time ago to the /-F switch ("Does not fill the console
blank space with color attribute").
Also, remove a now-unneeded localized informative string for the COLOR command 
(which rendered it Windows-incompatible).

Modified:
trunk/reactos/base/shell/cmd/color.c
trunk/reactos/base/shell/cmd/lang/cs-CZ.rc
trunk/reactos/base/shell/cmd/lang/de-DE.rc
trunk/reactos/base/shell/cmd/lang/el-GR.rc
trunk/reactos/base/shell/cmd/lang/en-US.rc
trunk/reactos/base/shell/cmd/lang/es-ES.rc
trunk/reactos/base/shell/cmd/lang/fr-FR.rc
trunk/reactos/base/shell/cmd/lang/hu-HU.rc
trunk/reactos/base/shell/cmd/lang/id-ID.rc
trunk/reactos/base/shell/cmd/lang/it-IT.rc
trunk/reactos/base/shell/cmd/lang/ja-JP.rc
trunk/reactos/base/shell/cmd/lang/no-NO.rc
trunk/reactos/base/shell/cmd/lang/pl-PL.rc
trunk/reactos/base/shell/cmd/lang/ro-RO.rc
trunk/reactos/base/shell/cmd/lang/ru-RU.rc
trunk/reactos/base/shell/cmd/lang/sk-SK.rc
trunk/reactos/base/shell/cmd/lang/sq-AL.rc
trunk/reactos/base/shell/cmd/lang/sv-SE.rc
trunk/reactos/base/shell/cmd/lang/tr-TR.rc
trunk/reactos/base/shell/cmd/lang/uk-UA.rc
trunk/reactos/base/shell/cmd/lang/zh-CN.rc
trunk/reactos/base/shell/cmd/lang/zh-TW.rc
trunk/reactos/base/shell/cmd/resource.h

Modified: trunk/reactos/base/shell/cmd/color.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/color.c?rev=75994&r1=75993&r2=75994&view=diff
==
--- trunk/reactos/base/shell/cmd/color.c[iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/color.c[iso-8859-1] Sat Sep 30 
09:50:08 2017
@@ -73,7 +73,7 @@
 /* Let's prepare %ERRORLEVEL% */
 nErrorLevel = 0;
 
-/* No parameter. Set the default colors */
+/* No parameter: Set the default colors */
 if (rest[0] == _T('\0'))
 {
 SetScreenColor(wDefColor, FALSE);
@@ -111,11 +111,7 @@
 return 1;
 }
 
-/* Print the chosen color if we are in echo mode (NOTE: Not 
Windows-compliant) */
-if ((bc && bc->bEcho) || !bc)
-{
-ConErrResPrintf(STRING_COLOR_ERROR3, wColor);
-}
+TRACE("Color %02x\n", wColor);
 
 /*
  * Set the chosen color. Use also the following advanced flag:

Modified: trunk/reactos/base/shell/cmd/lang/cs-CZ.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/cs-CZ.rc?rev=75994&r1=75993&r2=75994&view=diff
==
--- trunk/reactos/base/shell/cmd/lang/cs-CZ.rc  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/cs-CZ.rc  [iso-8859-1] Sat Sep 30 
09:50:08 2017
@@ -76,9 +76,9 @@
   (cannot be terminated).\n\
   /T:bf   Sets the background/foreground color (see COLOR command).\n"
 STRING_COLOR_HELP1 "Sets the default foreground and background colors.\n\n\
-COLOR [attr [/-F]] \n\n\
-  attrSpecifies color attribute of console output\n\
-  /-F Does not fill the console blank space with color attribute\n\n\
+COLOR [attr [/-F]]\n\n\
+  attrSpecifies color attribute of console output.\n\
+  /-F Does not fill the console blank space with color attribute.\n\n\
 There are three ways to specify the colors:\n\
 1) [bright] name on [bright] name  (only the first three letters are 
required)\n\
 2) decimal on decimal\n\
@@ -479,8 +479,7 @@
 STRING_CMD_ERROR4 "Spouští se %s...\n"
 STRING_CMD_ERROR5 "Spouští se cmdexit.bat...\n"
 STRING_COLOR_ERROR1 "Chyba stejných barev! (Pozadí a popředí nemohou 
mít stejnou barvu)"
-STRING_COLOR_ERROR2 "chyba ve specifikaci barvy"
-STRING_COLOR_ERROR3 "Barva %02x\n"
+STRING_COLOR_ERROR2 "Chyba ve specifikaci barvy"
 STRING_CONSOLE_ERROR "Neznámá chyba: %d\n"
 STRING_COPY_ERROR1 "Chyba: Nelze otevřít zdroj - %s!\n"
 STRING_COPY_ERROR2 "Chyba: Zdroj a cíl jsou shodné!\n"

Modified: trunk/reactos/base/shell/cmd/lang/de-DE.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/de-DE.rc?rev=75994&r1=75993&r2=75994&view=diff
==
--- trunk/reactos/base/shell/cmd/lang/de-DE.rc  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/de-DE.rc  [iso-8859-1] Sat Sep 30 
09:50:08 2017
@@ -74,9 +74,9 @@
 (kann nicht beendet werden).\n\
   /T:bf Ändert die Hintergrund- und Vordergrund-Fa

[ros-diffs] [hbelusca] 75993: [CMD]: Fix few comments & use ARRAYSIZE(str) instead of sizeof(str)/sizeof(str[0]) for strings.

2017-09-30 Thread hbelusca
Author: hbelusca
Date: Sat Sep 30 09:13:04 2017
New Revision: 75993

URL: http://svn.reactos.org/svn/reactos?rev=75993&view=rev
Log:
[CMD]: Fix few comments & use ARRAYSIZE(str) instead of 
sizeof(str)/sizeof(str[0]) for strings.

Modified:
trunk/reactos/base/shell/cmd/del.c
trunk/reactos/base/shell/cmd/dir.c
trunk/reactos/base/shell/cmd/locale.c
trunk/reactos/base/shell/cmd/msgbox.c

Modified: trunk/reactos/base/shell/cmd/del.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/del.c?rev=75993&r1=75992&r2=75993&view=diff
==
--- trunk/reactos/base/shell/cmd/del.c  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/del.c  [iso-8859-1] Sat Sep 30 09:13:04 2017
@@ -84,7 +84,7 @@
 static VOID LoadStrings(VOID)
 {
 LoadString(CMD_ModuleHandle, STRING_DELETE_WIPE, szDeleteWipe, 
ARRAYSIZE(szDeleteWipe));
-GetModuleFileName(NULL, CMDPath, MAX_PATH);
+GetModuleFileName(NULL, CMDPath, ARRAYSIZE(CMDPath));
 StringsLoaded = TRUE;
 }
 

Modified: trunk/reactos/base/shell/cmd/dir.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/dir.c?rev=75993&r1=75992&r2=75993&view=diff
==
--- trunk/reactos/base/shell/cmd/dir.c  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/dir.c  [iso-8859-1] Sat Sep 30 09:13:04 2017
@@ -389,10 +389,10 @@
 ptrEnd = Line;
 
 /* Copy it to the entries list */
-temp = cmd_alloc((ptrEnd - ptrStart + 1) * sizeof (TCHAR));
+temp = cmd_alloc((ptrEnd - ptrStart + 1) * sizeof(TCHAR));
 if (!temp)
 return FALSE;
-memcpy(temp, ptrStart, (ptrEnd - ptrStart) * sizeof (TCHAR));
+memcpy(temp, ptrStart, (ptrEnd - ptrStart) * sizeof(TCHAR));
 temp[ptrEnd - ptrStart] = _T('\0');
 StripQuotes(temp);
 if (!add_entry(entries, params, temp))
@@ -419,7 +419,7 @@
 continue;
 }
 /* Process parameter switch */
-switch(cCurSwitch)
+switch (cCurSwitch)
 {
 case _T('A'):   /* Switch parameters for /A (attributes filter) */
 if (cCurChar == _T('-'))
@@ -583,7 +583,7 @@
 if (lpFlags->bBareFormat)
 return TRUE;
 
-if (GetFullPathName(szPath, sizeof(szFullDir) / sizeof(TCHAR), szFullDir, 
&pszFilePart) == 0)
+if (GetFullPathName(szPath, ARRAYSIZE(szFullDir), szFullDir, &pszFilePart) 
== 0)
 {
 ErrorMessage(GetLastError(), _T("Failed to build full directory 
path"));
 return FALSE;
@@ -593,7 +593,7 @@
 *pszFilePart = _T('\0');
 
 /* get the media ID of the drive */
-if (!GetVolumePathName(szFullDir, szRootName, sizeof(szRootName) / 
sizeof(TCHAR)) ||
+if (!GetVolumePathName(szFullDir, szRootName, ARRAYSIZE(szRootName)) ||
 !GetVolumeInformation(szRootName, szVolName, 80, &dwSerialNr,
   NULL, NULL, NULL, 0))
 {
@@ -780,7 +780,7 @@
 /* Take this code offline to fix /S does not print double info */
 if (TotalSummary && lpFlags->bRecursive)
 {
-ConvertULargeInteger(u64Bytes, szBuffer, sizeof(szBuffer), 
lpFlags->bTSeparator);
+ConvertULargeInteger(u64Bytes, szBuffer, ARRAYSIZE(szBuffer), 
lpFlags->bTSeparator);
 LoadString(CMD_ModuleHandle, STRING_DIR_HELP5, szMsg, 
ARRAYSIZE(szMsg));
 DirPrintf(lpFlags, szMsg, ulFiles, szBuffer);
 }
@@ -798,7 +798,7 @@
 if (!lpFlags->bRecursive || TotalSummary)
 {
 GetUserDiskFreeSpace(szPath, &uliFree);
-ConvertULargeInteger(uliFree.QuadPart, szBuffer, sizeof(szBuffer), 
lpFlags->bTSeparator);
+ConvertULargeInteger(uliFree.QuadPart, szBuffer, ARRAYSIZE(szBuffer), 
lpFlags->bTSeparator);
 LoadString(CMD_ModuleHandle, STRING_DIR_HELP6, szMsg, 
ARRAYSIZE(szMsg));
 DirPrintf(lpFlags, szMsg, ulDirs, szBuffer);
 }
@@ -1136,7 +1136,7 @@
 /* Condition to print header:
We are not printing in bare format
and if we are in recursive mode... we must have results */
-if (!(lpFlags->bBareFormat ) && !((lpFlags->bRecursive) && (dwCount <= 0)))
+if (!lpFlags->bBareFormat && !(lpFlags->bRecursive && (dwCount <= 0)))
 {
 LoadString(CMD_ModuleHandle, STRING_DIR_HELP7, szMsg, 
ARRAYSIZE(szMsg));
 if (DirPrintf(lpFlags, szMsg, szTemp))
@@ -1186,11 +1186,11 @@
   long iComp = 0;   /* The comparison result */
 
 /* Calculate criteria by order given from user */
-for (i = 0;i < lpFlags->stOrderBy.sCriteriaCount;i++)
+for (i = 0; i < lpFlags->stOrderBy.sCriteria

[ros-diffs] [hbelusca] 75977: [TIMEOUT]: Use a waitable timer to wait for a maximum of 1 second, instead of using some Sleep(100) calls. The only Sleep() call allowed is the Sleep(INFINITE) one.

2017-09-26 Thread hbelusca
Author: hbelusca
Date: Tue Sep 26 14:29:25 2017
New Revision: 75977

URL: http://svn.reactos.org/svn/reactos?rev=75977&view=rev
Log:
[TIMEOUT]: Use a waitable timer to wait for a maximum of 1 second, instead of 
using some Sleep(100) calls. The only Sleep() call allowed is the 
Sleep(INFINITE) one.

Modified:
trunk/reactos/base/applications/cmdutils/timeout/timeout.c

Modified: trunk/reactos/base/applications/cmdutils/timeout/timeout.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils/timeout/timeout.c?rev=75977&r1=75976&r2=75977&view=diff
==
--- trunk/reactos/base/applications/cmdutils/timeout/timeout.c  [iso-8859-1] 
(original)
+++ trunk/reactos/base/applications/cmdutils/timeout/timeout.c  [iso-8859-1] 
Tue Sep 26 14:29:25 2017
@@ -49,6 +49,7 @@
 INT Status = EXIT_SUCCESS;
 HANDLE hInput;
 BOOL bUseTimer = (timerValue != -1);
+HANDLE hTimer = NULL;
 DWORD dwStartTime;
 LONG timeElapsed;
 DWORD dwWaitState;
@@ -67,6 +68,16 @@
 }
 
 /* Start a new wait if we use the timer */
+if (bNoBreak && bUseTimer)
+{
+hTimer = CreateWaitableTimer(NULL, TRUE, NULL);
+if (hTimer == NULL)
+{
+/* A problem happened, bail out */
+PrintError(GetLastError());
+return EXIT_FAILURE;
+}
+}
 if (bUseTimer)
 dwStartTime = GetTickCount();
 
@@ -138,8 +149,34 @@
 {
 if (bUseTimer)
 {
-/* We use the timer: wait a little bit before updating it */
-Sleep(100);
+LARGE_INTEGER DueTime;
+
+/* We use the timer: use a passive wait of maximum 1 second */
+timeElapsed = GetTickCount() - dwStartTime;
+if (timeElapsed < 1000)
+{
+/*
+ * For whatever reason, x86 MSVC generates a ntdll!_allmul
+ * call when using Int32x32To64(), instead of an imul
+ * instruction. This leads the linker to error that _allmul
+ * is missing, since we do not link against ntdll.
+ * Everything is however OK with GCC...
+ * We therefore use the __emul() intrinsic which does
+ * the correct job.
+ */
+DueTime.QuadPart = __emul(1000 - timeElapsed, -1);
+SetWaitableTimer(hTimer, &DueTime, 0, NULL, NULL, FALSE);
+dwWaitState = WaitForSingleObject(hTimer, INFINITE);
+
+/* Check whether the timer has been signaled */
+if (dwWaitState != WAIT_OBJECT_0)
+{
+/* An error happened, bail out */
+PrintError(GetLastError());
+Status = EXIT_FAILURE;
+break;
+}
+}
 }
 else
 {
@@ -170,7 +207,7 @@
 else
 dwWaitState = WAIT_TIMEOUT;
 
-/* Check whether the input handle has been signaled, or a timeout 
happened */
+/* Check whether the input event has been signaled, or a timeout 
happened */
 if (dwWaitState == WAIT_TIMEOUT)
 continue;
 if (dwWaitState != WAIT_OBJECT_0)
@@ -234,6 +271,9 @@
 Quit:
 if (bNoBreak)
 SetConsoleCtrlHandler(NULL, FALSE);
+
+if (bNoBreak && bUseTimer)
+CloseHandle(hTimer);
 
 return Status;
 }




[ros-diffs] [hbelusca] 75968: [TIMEOUT]: Implement the TIMEOUT utility (found on Win2k3 and upwards). This is an improved "pause" command, with elapsed time count display. Based from a patch by Lee Sc

2017-09-25 Thread hbelusca
Author: hbelusca
Date: Mon Sep 25 23:31:44 2017
New Revision: 75968

URL: http://svn.reactos.org/svn/reactos?rev=75968&view=rev
Log:
[TIMEOUT]: Implement the TIMEOUT utility (found on Win2k3 and upwards). This is 
an improved "pause" command, with elapsed time count display.
Based from a patch by Lee Schröder, with modifications by myself.
CORE-10044 #resolve

Added:
trunk/reactos/base/applications/cmdutils/timeout/
trunk/reactos/base/applications/cmdutils/timeout/CMakeLists.txt   (with 
props)
trunk/reactos/base/applications/cmdutils/timeout/lang/
trunk/reactos/base/applications/cmdutils/timeout/lang/en-US.rc   (with 
props)
trunk/reactos/base/applications/cmdutils/timeout/lang/fr-FR.rc   (with 
props)
trunk/reactos/base/applications/cmdutils/timeout/resource.h   (with props)
trunk/reactos/base/applications/cmdutils/timeout/timeout.c   (with props)
trunk/reactos/base/applications/cmdutils/timeout/timeout.rc   (with props)
Modified:
trunk/reactos/base/applications/cmdutils/CMakeLists.txt

Modified: trunk/reactos/base/applications/cmdutils/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils/CMakeLists.txt?rev=75968&r1=75967&r2=75968&view=diff
==
--- trunk/reactos/base/applications/cmdutils/CMakeLists.txt [iso-8859-1] 
(original)
+++ trunk/reactos/base/applications/cmdutils/CMakeLists.txt [iso-8859-1] 
Mon Sep 25 23:31:44 2017
@@ -18,6 +18,7 @@
 add_subdirectory(schtasks)
 add_subdirectory(sort)
 add_subdirectory(taskkill)
+add_subdirectory(timeout)
 add_subdirectory(tree)
 add_subdirectory(whoami)
 add_subdirectory(wmic)

Added: trunk/reactos/base/applications/cmdutils/timeout/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils/timeout/CMakeLists.txt?rev=75968
==
--- trunk/reactos/base/applications/cmdutils/timeout/CMakeLists.txt (added)
+++ trunk/reactos/base/applications/cmdutils/timeout/CMakeLists.txt 
[iso-8859-1] Mon Sep 25 23:31:44 2017
@@ -0,0 +1,8 @@
+
+include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils)
+
+add_executable(timeout timeout.c timeout.rc)
+set_module_type(timeout win32cui UNICODE)
+target_link_libraries(timeout conutils ${PSEH_LIB})
+add_importlibs(timeout msvcrt kernel32)
+add_cd_file(TARGET timeout DESTINATION reactos/system32 FOR all)

Propchange: trunk/reactos/base/applications/cmdutils/timeout/CMakeLists.txt
--
svn:eol-style = native

Added: trunk/reactos/base/applications/cmdutils/timeout/lang/en-US.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils/timeout/lang/en-US.rc?rev=75968
==
--- trunk/reactos/base/applications/cmdutils/timeout/lang/en-US.rc  (added)
+++ trunk/reactos/base/applications/cmdutils/timeout/lang/en-US.rc  
[iso-8859-1] Mon Sep 25 23:31:44 2017
@@ -0,0 +1,33 @@
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+STRINGTABLE
+BEGIN
+IDS_USAGE "ReactOS Timeout Utility\n\
+\n\
+TIMEOUT [/?] [/T] delay [/NOBREAK]\n\
+\n\
+Description:\n\
+This tool waits until a specified time period (in seconds) has elapsed,\n\
+or until any key is pressed. A parameter to ignore the key press is also\n\
+accepted.\n\
+\n\
+Parameters:\n\
+/?Display this help screen.\n\
+\n\
+/T delay  Specify the number of seconds to wait (-1 to 9).\n\
+  A value of -1 means the program will wait until a key is 
pressed.\n\
+  Note that the ""/T"" specification is optional, you can just\n\
+  specify the delay value without it.\n\
+\n\
+/NOBREAK  Ignore all keyboard input except for Ctrl+C.\n\
+"
+IDS_ERROR_OUT_OF_RANGE "ERROR: The timer value must be within range (-1 to 
9).\n"
+IDS_ERROR_INVALID_HANDLE_VALUE "ERROR: Unable to get the standard handle 
for the console (error %lu).\n"
+IDS_ERROR_READ_INPUT "ERROR: Unable to read the console input (error 
%lu).\n"
+IDS_ERROR_NO_TIMER_VALUE "ERROR: The timer value must be specified (-1 to 
9).\n"
+IDS_ERROR_ONE_TIME "ERROR: Only one timer value is needed.\n"
+IDS_NOBREAK_INPUT "Press Ctrl+C to quit..."
+IDS_USER_INPUT "Press any key to continue..."
+IDS_NOBREAK_INPUT_COUNT "Waiting for %d second(s), press Ctrl+C to quit..."
+IDS_USER_INPUT_COUNT "Waiting for %d second(s), press any key to 
continue..."
+END

Propchange: trunk/reactos/base/applications/cmdutils/timeout/lang/en-US.rc
--
svn:eol-style = native

Added: trunk/react

[ros-diffs] [hbelusca] 75964: [MORE]: Remove an unused library import (user32).

2017-09-24 Thread hbelusca
Author: hbelusca
Date: Sun Sep 24 19:02:29 2017
New Revision: 75964

URL: http://svn.reactos.org/svn/reactos?rev=75964&view=rev
Log:
[MORE]: Remove an unused library import (user32).

Modified:
trunk/reactos/base/applications/cmdutils/more/CMakeLists.txt

Modified: trunk/reactos/base/applications/cmdutils/more/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils/more/CMakeLists.txt?rev=75964&r1=75963&r2=75964&view=diff
==
--- trunk/reactos/base/applications/cmdutils/more/CMakeLists.txt
[iso-8859-1] (original)
+++ trunk/reactos/base/applications/cmdutils/more/CMakeLists.txt
[iso-8859-1] Sun Sep 24 19:02:29 2017
@@ -6,6 +6,6 @@
 add_executable(more more.c more.rc)
 set_module_type(more win32cui UNICODE)
 target_link_libraries(more conutils ${PSEH_LIB})
-add_importlibs(more advapi32 user32 msvcrt kernel32)
+add_importlibs(more advapi32 msvcrt kernel32)
 set_target_properties(more PROPERTIES SUFFIX ".com")
 add_cd_file(TARGET more DESTINATION reactos/system32 FOR all)




[ros-diffs] [hbelusca] 75963: [CHCP][CMD]: Make the CHCP command a standalone executable, for backwards compatibility with Windows etc. This allows the user to be able to replace it with a 3rd-party o

2017-09-24 Thread hbelusca
Author: hbelusca
Date: Sun Sep 24 19:00:47 2017
New Revision: 75963

URL: http://svn.reactos.org/svn/reactos?rev=75963&view=rev
Log:
[CHCP][CMD]: Make the CHCP command a standalone executable, for backwards 
compatibility with Windows etc. This allows the user to be able to replace it 
with a 3rd-party one.
CORE-10295 #resolve
CORE-9444

Added:
trunk/reactos/base/applications/cmdutils/chcp/
trunk/reactos/base/applications/cmdutils/chcp/CMakeLists.txt   (with props)
trunk/reactos/base/applications/cmdutils/chcp/chcp.c
  - copied, changed from r75962, trunk/reactos/base/shell/cmd/chcp.c
trunk/reactos/base/applications/cmdutils/chcp/chcp.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/
trunk/reactos/base/applications/cmdutils/chcp/lang/cs-CZ.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/de-DE.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/el-GR.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/en-US.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/es-ES.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/fr-FR.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/hu-HU.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/id-ID.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/it-IT.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/ja-JP.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/no-NO.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/pl-PL.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/ro-RO.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/ru-RU.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/sk-SK.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/sq-AL.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/sv-SE.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/tr-TR.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/uk-UA.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/zh-CN.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/lang/zh-TW.rc   (with props)
trunk/reactos/base/applications/cmdutils/chcp/resource.h   (with props)
Removed:
trunk/reactos/base/shell/cmd/chcp.c
Modified:
trunk/reactos/base/applications/cmdutils/CMakeLists.txt
trunk/reactos/base/shell/cmd/CMakeLists.txt
trunk/reactos/base/shell/cmd/cmd.h
trunk/reactos/base/shell/cmd/cmdtable.c
trunk/reactos/base/shell/cmd/config.h
trunk/reactos/base/shell/cmd/lang/cs-CZ.rc
trunk/reactos/base/shell/cmd/lang/de-DE.rc
trunk/reactos/base/shell/cmd/lang/el-GR.rc
trunk/reactos/base/shell/cmd/lang/en-US.rc
trunk/reactos/base/shell/cmd/lang/es-ES.rc
trunk/reactos/base/shell/cmd/lang/fr-FR.rc
trunk/reactos/base/shell/cmd/lang/hu-HU.rc
trunk/reactos/base/shell/cmd/lang/id-ID.rc
trunk/reactos/base/shell/cmd/lang/it-IT.rc
trunk/reactos/base/shell/cmd/lang/ja-JP.rc
trunk/reactos/base/shell/cmd/lang/no-NO.rc
trunk/reactos/base/shell/cmd/lang/pl-PL.rc
trunk/reactos/base/shell/cmd/lang/ro-RO.rc
trunk/reactos/base/shell/cmd/lang/ru-RU.rc
trunk/reactos/base/shell/cmd/lang/sk-SK.rc
trunk/reactos/base/shell/cmd/lang/sq-AL.rc
trunk/reactos/base/shell/cmd/lang/sv-SE.rc
trunk/reactos/base/shell/cmd/lang/tr-TR.rc
trunk/reactos/base/shell/cmd/lang/uk-UA.rc
trunk/reactos/base/shell/cmd/lang/zh-CN.rc
trunk/reactos/base/shell/cmd/lang/zh-TW.rc
trunk/reactos/base/shell/cmd/resource.h

Modified: trunk/reactos/base/applications/cmdutils/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils/CMakeLists.txt?rev=75963&r1=75962&r2=75963&view=diff
==
--- trunk/reactos/base/applications/cmdutils/CMakeLists.txt [iso-8859-1] 
(original)
+++ trunk/reactos/base/applications/cmdutils/CMakeLists.txt [iso-8859-1] 
Sun Sep 24 19:00:47 2017
@@ -1,4 +1,5 @@
 add_subdirectory(at)
+add_subdirectory(chcp)
 add_subdirectory(clip)
 add_subdirectory(comp)
 add_subdirectory(cscript)

Added: trunk/reactos/base/applications/cmdutils/chcp/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils/chcp/CMakeLists.txt?rev=75963
==
--- trunk/reactos/base/applications/cmdutils/chcp/CMakeLists.txt(added)
+++ trunk/reactos/base/applications/cmdutils/chcp/CMakeLists.txt
[iso-8859-1] Sun Sep 24 19:00:47 2017
@@ -0,0 +1,9 @@
+
+include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils)
+
+add_executable(chcp chcp.c chcp.rc)
+set_

[ros-diffs] [hbelusca] 75762: [USETUP]: Move the SetupExtractFile() function to where it is (only) used.

2017-09-04 Thread hbelusca
Author: hbelusca
Date: Mon Sep  4 20:00:22 2017
New Revision: 75762

URL: http://svn.reactos.org/svn/reactos?rev=75762&view=rev
Log:
[USETUP]: Move the SetupExtractFile() function to where it is (only) used.

Modified:
branches/setup_improvements/base/setup/usetup/filequeue.c
branches/setup_improvements/base/setup/usetup/filequeue.h
branches/setup_improvements/base/setup/usetup/filesup.c
branches/setup_improvements/base/setup/usetup/filesup.h

Modified: branches/setup_improvements/base/setup/usetup/filequeue.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/filequeue.c?rev=75762&r1=75761&r2=75762&view=diff
==
--- branches/setup_improvements/base/setup/usetup/filequeue.c   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/filequeue.c   [iso-8859-1] 
Mon Sep  4 20:00:22 2017
@@ -57,6 +57,90 @@
 
 /* FUNCTIONS /
 
+#ifdef __REACTOS__
+static BOOLEAN HasCurrentCabinet = FALSE;
+static WCHAR CurrentCabinetName[MAX_PATH];
+static CAB_SEARCH Search;
+
+NTSTATUS
+SetupExtractFile(
+PWCHAR CabinetFileName,
+PWCHAR SourceFileName,
+PWCHAR DestinationPathName)
+{
+ULONG CabStatus;
+
+DPRINT("SetupExtractFile(CabinetFileName %S, SourceFileName %S, 
DestinationPathName %S)\n",
+   CabinetFileName, SourceFileName, DestinationPathName);
+
+if (HasCurrentCabinet)
+{
+DPRINT("CurrentCabinetName: %S\n", CurrentCabinetName);
+}
+
+if ((HasCurrentCabinet) && (wcscmp(CabinetFileName, CurrentCabinetName) == 
0))
+{
+DPRINT("Using same cabinet as last time\n");
+
+/* Use our last location because the files should be sequential */
+CabStatus = CabinetFindNextFileSequential(SourceFileName, &Search);
+if (CabStatus != CAB_STATUS_SUCCESS)
+{
+DPRINT("Sequential miss on file: %S\n", SourceFileName);
+
+/* Looks like we got unlucky */
+CabStatus = CabinetFindFirst(SourceFileName, &Search);
+}
+}
+else
+{
+DPRINT("Using new cabinet\n");
+
+if (HasCurrentCabinet)
+{
+CabinetCleanup();
+}
+
+wcscpy(CurrentCabinetName, CabinetFileName);
+
+CabinetInitialize();
+CabinetSetEventHandlers(NULL, NULL, NULL);
+CabinetSetCabinetName(CabinetFileName);
+
+CabStatus = CabinetOpen();
+if (CabStatus == CAB_STATUS_SUCCESS)
+{
+DPRINT("Opened cabinet %S\n", CabinetGetCabinetName());
+HasCurrentCabinet = TRUE;
+}
+else
+{
+DPRINT("Cannot open cabinet (%d)\n", CabStatus);
+return STATUS_UNSUCCESSFUL;
+}
+
+/* We have to start at the beginning here */
+CabStatus = CabinetFindFirst(SourceFileName, &Search);
+}
+
+if (CabStatus != CAB_STATUS_SUCCESS)
+{
+DPRINT1("Unable to find '%S' in cabinet '%S'\n", SourceFileName, 
CabinetGetCabinetName());
+return STATUS_UNSUCCESSFUL;
+}
+
+CabinetSetDestinationPath(DestinationPathName);
+CabStatus = CabinetExtractFile(&Search);
+if (CabStatus != CAB_STATUS_SUCCESS)
+{
+DPRINT("Cannot extract file %S (%d)\n", SourceFileName, CabStatus);
+return STATUS_UNSUCCESSFUL;
+}
+
+return STATUS_SUCCESS;
+}
+#endif
+
 HSPFILEQ
 WINAPI
 SetupOpenFileQueue(VOID)

Modified: branches/setup_improvements/base/setup/usetup/filequeue.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/filequeue.h?rev=75762&r1=75761&r2=75762&view=diff
==
--- branches/setup_improvements/base/setup/usetup/filequeue.h   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/filequeue.h   [iso-8859-1] 
Mon Sep  4 20:00:22 2017
@@ -69,6 +69,12 @@
 
 /* FUNCTIONS /
 
+NTSTATUS
+SetupExtractFile(
+PWCHAR CabinetFileName,
+PWCHAR SourceFileName,
+PWCHAR DestinationFileName);
+
 HSPFILEQ
 WINAPI
 SetupOpenFileQueue(VOID);

Modified: branches/setup_improvements/base/setup/usetup/filesup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/filesup.c?rev=75762&r1=75761&r2=75762&view=diff
==
--- branches/setup_improvements/base/setup/usetup/filesup.c [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/filesup.c [iso-8859-1] 
Mon Sep  4 20:00:22 2017
@@ -15,10 +15,6 @@
 #include 
 
 /* FUNCTIONS ***

[ros-diffs] [hbelusca] 75757: [SETUPLIB]: Use strsafe functions (cont).

2017-09-03 Thread hbelusca
Author: hbelusca
Date: Sun Sep  3 20:34:29 2017
New Revision: 75757

URL: http://svn.reactos.org/svn/reactos?rev=75757&view=rev
Log:
[SETUPLIB]: Use strsafe functions (cont).

Modified:
branches/setup_improvements/base/setup/lib/bootsup.c
branches/setup_improvements/base/setup/lib/mui.c
branches/setup_improvements/base/setup/lib/settings.c
branches/setup_improvements/base/setup/lib/setuplib.c

Modified: branches/setup_improvements/base/setup/lib/bootsup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/bootsup.c?rev=75757&r1=75756&r2=75757&view=diff
==
--- branches/setup_improvements/base/setup/lib/bootsup.c[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/bootsup.c[iso-8859-1] 
Sun Sep  3 20:34:29 2017
@@ -368,7 +368,7 @@
 goto SkipThisEntry;
 }
 
-swprintf(SystemPath, L"\"%s\"", Data->ArcPath);
+StringCchPrintfW(SystemPath, ARRAYSIZE(SystemPath), L"\"%s\"", 
Data->ArcPath);
 if ((_wcsicmp(Options->OsLoadPath, Data->ArcPath) != 0) &&
 (_wcsicmp(Options->OsLoadPath, SystemPath)!= 0))
 {

Modified: branches/setup_improvements/base/setup/lib/mui.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/mui.c?rev=75757&r1=75756&r2=75757&view=diff
==
--- branches/setup_improvements/base/setup/lib/mui.c[iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/lib/mui.c[iso-8859-1] Sun Sep  3 
20:34:29 2017
@@ -298,10 +298,10 @@
 {
 if (uIndex > 19) break;
 
-swprintf(szValueName, L"%u", uIndex + 1);
+StringCchPrintfW(szValueName, ARRAYSIZE(szValueName), L"%u", uIndex + 
1);
 RtlInitUnicodeString(&ValueName, szValueName);
 
-swprintf(szLangID, L"%s", MuiLayouts[uIndex].LangID);
+StringCchPrintfW(szLangID, ARRAYSIZE(szLangID), L"%s", 
MuiLayouts[uIndex].LangID);
 
 if (_wcsicmp(szLangID, MuiLayouts[uIndex].LayoutID) == 0)
 {
@@ -321,7 +321,7 @@
 }
 else
 {
-swprintf(szLangID, L"d%03lu%s", uCount, MuiLayouts[uIndex].LangID);
+StringCchPrintfW(szLangID, ARRAYSIZE(szLangID), L"d%03lu%s", 
uCount, MuiLayouts[uIndex].LangID);
 Status = NtSetValueKey(KeyHandle,
&ValueName,
0,

Modified: branches/setup_improvements/base/setup/lib/settings.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/settings.c?rev=75757&r1=75756&r2=75757&view=diff
==
--- branches/setup_improvements/base/setup/lib/settings.c   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/settings.c   [iso-8859-1] 
Sun Sep  3 20:34:29 2017
@@ -423,7 +423,7 @@
 }
 
 wcscpy((PWCHAR)*UserData, KeyName);
-wcscpy(DisplayText, KeyValue);
+StringCbCopyW(DisplayText, DisplayTextSize, KeyValue);
 
 *Current = (CompareKey ? !_wcsicmp(KeyName, CompareKey) : FALSE);
 
@@ -484,7 +484,7 @@
 }
 
 DPRINT("Computer key: %S\n", KeyName);
-wcscpy(ComputerKey, KeyName);
+StringCchCopyW(ComputerKey, ARRAYSIZE(ComputerKey), KeyName);
 INF_FreeData(KeyName);
 } while (SetupFindNextLine(&Context, &Context));
 
@@ -549,7 +549,7 @@
 BusInstance = 0;
 while (TRUE)
 {
-swprintf(Buffer, L"%lu", BusInstance);
+StringCchPrintfW(Buffer, ARRAYSIZE(Buffer), L"%lu", BusInstance);
 RtlInitUnicodeString(&KeyName, Buffer);
 InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
@@ -585,7 +585,7 @@
 while (TRUE)
 {
 /* Open the pointer controller instance key */
-swprintf(Buffer, L"%lu", ControllerInstance);
+StringCchPrintfW(Buffer, ARRAYSIZE(Buffer), L"%lu", 
ControllerInstance);
 RtlInitUnicodeString(&KeyName, Buffer);
 InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
@@ -720,7 +720,7 @@
 }
 
 DPRINT("Display key: %S\n", KeyName);
-wcscpy(DisplayKey, KeyName);
+StringCchCopyW(DisplayKey, ARRAYSIZE(DisplayKey), KeyName);
 INF_FreeData(KeyName);
 } while (SetupFindNextLine(&Context, &Context));
 
@@ -765,8 +765,8 @@
 return FALSE;
 }
 
-wcscpy(SectionName, L"Files.");
-wcscat(SectionName, (const 

[ros-diffs] [hbelusca] 75755: [SETUPLIB]: Use strsafe functions.

2017-09-03 Thread hbelusca
Author: hbelusca
Date: Sun Sep  3 20:05:11 2017
New Revision: 75755

URL: http://svn.reactos.org/svn/reactos?rev=75755&view=rev
Log:
[SETUPLIB]: Use strsafe functions.

Modified:
branches/setup_improvements/base/setup/lib/utils/bldrsup.c
branches/setup_improvements/base/setup/lib/utils/genlist.c

Modified: branches/setup_improvements/base/setup/lib/utils/bldrsup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/utils/bldrsup.c?rev=75755&r1=75754&r2=75755&view=diff
==
--- branches/setup_improvements/base/setup/lib/utils/bldrsup.c  [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/utils/bldrsup.c  [iso-8859-1] 
Sun Sep  3 20:05:11 2017
@@ -999,13 +999,13 @@
 return STATUS_INSUFFICIENT_RESOURCES;
 
 *Buffer = UNICODE_NULL;
-if (IsNameNotQuoted) wcscat(Buffer, L"\"");
-wcscat(Buffer, InstallName);
-if (IsNameNotQuoted) wcscat(Buffer, L"\"");
+if (IsNameNotQuoted) StringCchCatW(Buffer, BufferLength, L"\"");
+StringCchCatW(Buffer, BufferLength, InstallName);
+if (IsNameNotQuoted) StringCchCatW(Buffer, BufferLength, L"\"");
 if (OsOptions)
 {
-wcscat(Buffer, L" ");
-wcscat(Buffer, OsOptions);
+StringCchCatW(Buffer, BufferLength, L" ");
+StringCchCatW(Buffer, BufferLength, OsOptions);
 }
 
 /* Insert the entry into the "Operating Systems" section */

Modified: branches/setup_improvements/base/setup/lib/utils/genlist.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/utils/genlist.c?rev=75755&r1=75754&r2=75755&view=diff
==
--- branches/setup_improvements/base/setup/lib/utils/genlist.c  [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/utils/genlist.c  [iso-8859-1] 
Sun Sep  3 20:05:11 2017
@@ -23,9 +23,7 @@
 {
 PGENERIC_LIST List;
 
-List = (PGENERIC_LIST)RtlAllocateHeap(ProcessHeap,
-  0,
-  sizeof(GENERIC_LIST));
+List = RtlAllocateHeap(ProcessHeap, 0, sizeof(GENERIC_LIST));
 if (List == NULL)
 return NULL;
 
@@ -72,15 +70,15 @@
 IN BOOLEAN Current)
 {
 PGENERIC_LIST_ENTRY Entry;
+SIZE_T TextSize;
 
-Entry = (PGENERIC_LIST_ENTRY)RtlAllocateHeap(ProcessHeap,
- 0,
- sizeof(GENERIC_LIST_ENTRY) +
-(wcslen(Text) + 1) * 
sizeof(WCHAR));
+TextSize = (wcslen(Text) + 1) * sizeof(WCHAR);
+Entry = RtlAllocateHeap(ProcessHeap, 0,
+sizeof(GENERIC_LIST_ENTRY) + TextSize);
 if (Entry == NULL)
 return FALSE;
 
-wcscpy(Entry->Text, Text);
+StringCbCopyW(Entry->Text, TextSize, Text);
 Entry->List = List;
 Entry->UserData = UserData;
 




[ros-diffs] [hbelusca] 75753: [SETUPLIB][USETUP]: Make the GENERIC_LIST store the items display text in UNICODE (and not in ANSI). Only convert to ANSI when needed (e.g. in the display code for usetup

2017-09-03 Thread hbelusca
Author: hbelusca
Date: Sun Sep  3 19:46:26 2017
New Revision: 75753

URL: http://svn.reactos.org/svn/reactos?rev=75753&view=rev
Log:
[SETUPLIB][USETUP]: Make the GENERIC_LIST store the items display text in 
UNICODE (and not in ANSI). Only convert to ANSI when needed (e.g. in the 
display code for usetup).
The 1st-stage GUI setup will however use the UNICODE strings directly.

Modified:
branches/setup_improvements/base/setup/lib/settings.c
branches/setup_improvements/base/setup/lib/utils/genlist.c
branches/setup_improvements/base/setup/lib/utils/genlist.h
branches/setup_improvements/base/setup/lib/utils/osdetect.c
branches/setup_improvements/base/setup/usetup/genlist.c
branches/setup_improvements/base/setup/usetup/genlist.h
branches/setup_improvements/base/setup/usetup/usetup.c

Modified: branches/setup_improvements/base/setup/lib/settings.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/settings.c?rev=75753&r1=75752&r2=75753&view=diff
==
--- branches/setup_improvements/base/setup/lib/settings.c   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/settings.c   [iso-8859-1] 
Sun Sep  3 19:46:26 2017
@@ -324,7 +324,7 @@
 (NTAPI *PPROCESS_ENTRY_ROUTINE)(
 IN PWCHAR KeyName,
 IN PWCHAR KeyValue,
-IN PCHAR DisplayText,
+OUT PWCHAR DisplayText,
 IN SIZE_T DisplayTextSize,
 OUT PVOID* UserData,
 OUT PBOOLEAN Current,
@@ -345,7 +345,7 @@
 PVOID UserData;
 BOOLEAN Current;
 UCHAR RetVal;
-CHAR DisplayText[128];
+WCHAR DisplayText[128];
 
 if (!SetupFindFirstLineW(InfFile, SectionName, NULL, pContext))
 return -1;
@@ -405,7 +405,7 @@
 DefaultProcessEntry(
 IN PWCHAR KeyName,
 IN PWCHAR KeyValue,
-IN PCHAR DisplayText,
+OUT PWCHAR DisplayText,
 IN SIZE_T DisplayTextSize,
 OUT PVOID* UserData,
 OUT PBOOLEAN Current,
@@ -423,7 +423,7 @@
 }
 
 wcscpy((PWCHAR)*UserData, KeyName);
-sprintf(DisplayText, "%S", KeyValue);
+wcscpy(DisplayText, KeyValue);
 
 *Current = (CompareKey ? !_wcsicmp(KeyName, CompareKey) : FALSE);
 
@@ -740,7 +740,7 @@
 }
 
 #if 0
-AppendGenericListEntry(List, "Other display driver", NULL, TRUE);
+AppendGenericListEntry(List, L"Other display driver", NULL, TRUE);
 #endif
 
 return List;
@@ -1087,7 +1087,7 @@
 ProcessLangEntry(
 IN PWCHAR KeyName,
 IN PWCHAR KeyValue,
-IN PCHAR DisplayText,
+OUT PWCHAR DisplayText,
 IN SIZE_T DisplayTextSize,
 OUT PVOID* UserData,
 OUT PBOOLEAN Current,
@@ -,7 +,7 @@
 }
 
 wcscpy((PWCHAR)*UserData, KeyName);
-sprintf(DisplayText, "%S", KeyValue);
+wcscpy(DisplayText, KeyValue);
 
 *Current = FALSE;
 

Modified: branches/setup_improvements/base/setup/lib/utils/genlist.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/utils/genlist.c?rev=75753&r1=75752&r2=75753&view=diff
==
--- branches/setup_improvements/base/setup/lib/utils/genlist.c  [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/utils/genlist.c  [iso-8859-1] 
Sun Sep  3 19:46:26 2017
@@ -67,7 +67,7 @@
 BOOLEAN
 AppendGenericListEntry(
 IN OUT PGENERIC_LIST List,
-IN PCHAR Text,
+IN PCWSTR Text,
 IN PVOID UserData,
 IN BOOLEAN Current)
 {
@@ -75,11 +75,12 @@
 
 Entry = (PGENERIC_LIST_ENTRY)RtlAllocateHeap(ProcessHeap,
  0,
- sizeof(GENERIC_LIST_ENTRY) + 
strlen(Text));
+ sizeof(GENERIC_LIST_ENTRY) +
+(wcslen(Text) + 1) * 
sizeof(WCHAR));
 if (Entry == NULL)
 return FALSE;
 
-strcpy (Entry->Text, Text);
+wcscpy(Entry->Text, Text);
 Entry->List = List;
 Entry->UserData = UserData;
 
@@ -140,7 +141,7 @@
 return Entry->UserData;
 }
 
-LPCSTR
+PCWSTR
 GetListEntryText(
 IN PGENERIC_LIST_ENTRY Entry)
 {

Modified: branches/setup_improvements/base/setup/lib/utils/genlist.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/utils/genlist.h?rev=75753&r1=75752&r2=75753&view=diff
==
--- branches/setup_improvements/base/setup/lib/utils/genlist.h  [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/utils/genlist.h  [iso-8859-1] 
Sun Sep  3 19:46:26 2017
@@ -13,7 +13,7 @@
 LIST_ENTRY Entry;
 struct _GENERIC_LIST* List;
 PVOID UserData;
-CHAR Text[1];   // FIXME: UI stuff
+WCHAR Text[1];  // FIXME: UI stuff
 
 } GENERIC_LIST_ENTRY, *PGENERIC_LIST_ENTRY

[ros-diffs] [hbelusca] 75752: [USETUP]: Whitespace fixes only.

2017-09-03 Thread hbelusca
Author: hbelusca
Date: Sun Sep  3 19:31:36 2017
New Revision: 75752

URL: http://svn.reactos.org/svn/reactos?rev=75752&view=rev
Log:
[USETUP]: Whitespace fixes only.

Modified:
branches/setup_improvements/base/setup/usetup/genlist.c

Modified: branches/setup_improvements/base/setup/usetup/genlist.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/genlist.c?rev=75752&r1=75751&r2=75752&view=diff
==
--- branches/setup_improvements/base/setup/usetup/genlist.c [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/genlist.c [iso-8859-1] 
Sun Sep  3 19:31:36 2017
@@ -16,7 +16,8 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-/* COPYRIGHT:   See COPYING in the top level directory
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT: ReactOS text-mode setup
  * FILE:base/setup/usetup/genlist.c
  * PURPOSE: Generic list functions
@@ -61,75 +62,75 @@
 /* Draw upper left corner */
 coPos.X = ListUi->Left;
 coPos.Y = ListUi->Top;
-FillConsoleOutputCharacterA (StdOutput,
- 0xDA, // '+',
- 1,
- coPos,
- &Written);
+FillConsoleOutputCharacterA(StdOutput,
+0xDA, // '+',
+1,
+coPos,
+&Written);
 
 /* Draw upper edge */
 coPos.X = ListUi->Left + 1;
 coPos.Y = ListUi->Top;
-FillConsoleOutputCharacterA (StdOutput,
- 0xC4, // '-',
- ListUi->Right - ListUi->Left - 1,
- coPos,
- &Written);
+FillConsoleOutputCharacterA(StdOutput,
+0xC4, // '-',
+ListUi->Right - ListUi->Left - 1,
+coPos,
+&Written);
 
 /* Draw upper right corner */
 coPos.X = ListUi->Right;
 coPos.Y = ListUi->Top;
-FillConsoleOutputCharacterA (StdOutput,
- 0xBF, // '+',
- 1,
- coPos,
- &Written);
+FillConsoleOutputCharacterA(StdOutput,
+0xBF, // '+',
+1,
+coPos,
+&Written);
 
 /* Draw left and right edge */
 for (i = ListUi->Top + 1; i < ListUi->Bottom; i++)
 {
 coPos.X = ListUi->Left;
 coPos.Y = i;
-FillConsoleOutputCharacterA (StdOutput,
- 0xB3, // '|',
- 1,
- coPos,
- &Written);
+FillConsoleOutputCharacterA(StdOutput,
+0xB3, // '|',
+1,
+coPos,
+&Written);
 
 coPos.X = ListUi->Right;
-FillConsoleOutputCharacterA (StdOutput,
- 0xB3, //'|',
- 1,
- coPos,
- &Written);
+FillConsoleOutputCharacterA(StdOutput,
+0xB3, //'|',
+1,
+coPos,
+&Written);
 }
 
 /* Draw lower left corner */
 coPos.X = ListUi->Left;
 coPos.Y = ListUi->Bottom;
-FillConsoleOutputCharacterA (StdOutput,
- 0xC0, // '+',
- 1,
- coPos,
- &Written);
+FillConsoleOutputCharacterA(StdOutput,
+0xC0, // '+',
+1,
+coPos,
+&Written);
 
 /* Draw lower edge */
 coPos.X = ListUi->Left + 1;
 coPos.Y = ListUi->Bottom;
-FillConsoleOutputCharacterA (StdOutput,
- 0xC4, // '-',
- ListUi->Right - ListUi->Left - 1,
-

[ros-diffs] [hbelusca] 75751: [SETUPLIB][USETUP]: Move the floppy-disk accessibility check into InstallFatBootcodeToFloppy().

2017-09-03 Thread hbelusca
Author: hbelusca
Date: Sun Sep  3 16:19:59 2017
New Revision: 75751

URL: http://svn.reactos.org/svn/reactos?rev=75751&view=rev
Log:
[SETUPLIB][USETUP]: Move the floppy-disk accessibility check into 
InstallFatBootcodeToFloppy().

Modified:
branches/setup_improvements/base/setup/lib/bootsup.c
branches/setup_improvements/base/setup/usetup/usetup.c

Modified: branches/setup_improvements/base/setup/lib/bootsup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/bootsup.c?rev=75751&r1=75750&r2=75751&view=diff
==
--- branches/setup_improvements/base/setup/lib/bootsup.c[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/bootsup.c[iso-8859-1] 
Sun Sep  3 16:19:59 2017
@@ -2268,7 +2268,11 @@
 WCHAR SrcPath[MAX_PATH];
 WCHAR DstPath[MAX_PATH];
 
-/* Format the floppy first */
+/* Verify that the floppy disk is accessible */
+if (DoesDirExist(NULL, FloppyDevice.Buffer) == FALSE)
+return STATUS_DEVICE_NOT_READY;
+
+/* Format the floppy disk */
 FatFS = GetFileSystemByName(L"FAT");
 if (!FatFS)
 {

Modified: branches/setup_improvements/base/setup/usetup/usetup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/usetup.c?rev=75751&r1=75750&r2=75751&view=diff
==
--- branches/setup_improvements/base/setup/usetup/usetup.c  [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/usetup.c  [iso-8859-1] 
Sun Sep  3 16:19:59 2017
@@ -4186,16 +4186,14 @@
 }
 else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D)/* ENTER */
 {
-if (DoesDirExist(NULL, L"\\Device\\Floppy0\\") == FALSE)
-{
-MUIDisplayError(ERROR_NO_FLOPPY, Ir, POPUP_WAIT_ENTER);
-return BOOT_LOADER_FLOPPY_PAGE;
-}
-
-Status = InstallFatBootcodeToFloppy(&USetupData.SourceRootPath, 
&USetupData.DestinationArcPath);
+Status = InstallFatBootcodeToFloppy(&USetupData.SourceRootPath,
+
&USetupData.DestinationArcPath);
 if (!NT_SUCCESS(Status))
 {
-/* Print error message */
+if (Status == STATUS_DEVICE_NOT_READY)
+MUIDisplayError(ERROR_NO_FLOPPY, Ir, POPUP_WAIT_ENTER);
+
+/* TODO: Print error message */
 return BOOT_LOADER_FLOPPY_PAGE;
 }
 
@@ -4279,8 +4277,7 @@
   DestinationDevicePathBuffer);
 if (!NT_SUCCESS(Status))
 {
-DPRINT1("InstallMbrBootCodeToDisk() failed (Status %lx)\n",
-Status);
+DPRINT1("InstallMbrBootCodeToDisk() failed (Status %lx)\n", Status);
 MUIDisplayError(ERROR_INSTALL_BOOTCODE, Ir, POPUP_WAIT_ENTER);
 return QUIT_PAGE;
 }




[ros-diffs] [hbelusca] 75750: [SETUPLIB][USETUP]: Move the registry-update procedure into setuplib, where it can also be used by the 1st-stage GUI setup, and make the necessary changes in usetup. [REA

2017-09-03 Thread hbelusca
Author: hbelusca
Date: Sun Sep  3 16:17:27 2017
New Revision: 75750

URL: http://svn.reactos.org/svn/reactos?rev=75750&view=rev
Log:
[SETUPLIB][USETUP]: Move the registry-update procedure into setuplib, where it 
can also be used by the 1st-stage GUI setup, and make the necessary changes in 
usetup.
[REACTOS]: Fix build.

Modified:
branches/setup_improvements/base/setup/lib/setuplib.c
branches/setup_improvements/base/setup/lib/setuplib.h
branches/setup_improvements/base/setup/reactos/CMakeLists.txt
branches/setup_improvements/base/setup/usetup/usetup.c

Modified: branches/setup_improvements/base/setup/lib/setuplib.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/setuplib.c?rev=75750&r1=75749&r2=75750&view=diff
==
--- branches/setup_improvements/base/setup/lib/setuplib.c   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/setuplib.c   [iso-8859-1] 
Sun Sep  3 16:17:27 2017
@@ -565,4 +565,240 @@
 return ERROR_SUCCESS;
 }
 
+/*
+ * SIDEEFFECTS
+ *  Calls RegInitializeRegistry
+ *  Calls ImportRegistryFile
+ *  Calls SetDefaultPagefile
+ *  Calls SetMountedDeviceValues
+ */
+ERROR_NUMBER
+UpdateRegistry(
+IN HINF SetupInf,
+IN OUT PUSETUP_DATA pSetupData,
+/**/IN BOOLEAN RepairUpdateFlag, /* HACK HACK! */
+/**/IN PPARTLIST PartitionList,  /* HACK HACK! */
+/**/IN WCHAR DestinationDriveLetter, /* HACK HACK! */
+/**/IN PWCHAR SelectedLanguageId,/* HACK HACK! */
+IN PGENERIC_LIST DisplayList,
+IN PGENERIC_LIST LayoutList,
+IN PGENERIC_LIST LanguageList,
+IN PREGISTRY_STATUS_ROUTINE StatusRoutine OPTIONAL)
+{
+ERROR_NUMBER ErrorNumber;
+NTSTATUS Status;
+INFCONTEXT InfContext;
+PWSTR Action;
+PWSTR File;
+PWSTR Section;
+BOOLEAN Success;
+BOOLEAN ShouldRepairRegistry = FALSE;
+BOOLEAN Delete;
+
+if (RepairUpdateFlag)
+{
+DPRINT1("TODO: Updating / repairing the registry is not completely 
implemented yet!\n");
+
+/* Verify the registry hives and check whether we need to update or 
repair any of them */
+Status = VerifyRegistryHives(&pSetupData->DestinationPath, 
&ShouldRepairRegistry);
+if (!NT_SUCCESS(Status))
+{
+DPRINT1("VerifyRegistryHives failed, Status 0x%08lx\n", Status);
+ShouldRepairRegistry = FALSE;
+}
+if (!ShouldRepairRegistry)
+DPRINT1("No need to repair the registry\n");
+}
+
+DoUpdate:
+ErrorNumber = ERROR_SUCCESS;
+
+/* Update the registry */
+if (StatusRoutine) StatusRoutine(RegHiveUpdate);
+
+/* Initialize the registry and setup the registry hives */
+Status = RegInitializeRegistry(&pSetupData->DestinationPath);
+if (!NT_SUCCESS(Status))
+{
+DPRINT1("RegInitializeRegistry() failed\n");
+/** HACK!!! **/
+if (Status == STATUS_NOT_IMPLEMENTED)
+{
+/* The hack was called, return its corresponding error */
+return ERROR_INITIALIZE_REGISTRY;
+}
+else
+/*/
+{
+/* Something else failed */
+return ERROR_CREATE_HIVE;
+}
+}
+
+if (!RepairUpdateFlag || ShouldRepairRegistry)
+{
+/*
+ * We fully setup the hives, in case we are doing a fresh installation
+ * (RepairUpdateFlag == FALSE), or in case we are doing an update
+ * (RepairUpdateFlag == TRUE) BUT we have some registry hives to
+ * "repair" (aka. recreate: ShouldRepairRegistry == TRUE).
+ */
+
+Success = SetupFindFirstLineW(SetupInf, L"HiveInfs.Fresh", NULL, 
&InfContext);   // Windows-compatible
+if (!Success)
+Success = SetupFindFirstLineW(SetupInf, L"HiveInfs.Install", NULL, 
&InfContext); // ReactOS-specific
+
+if (!Success)
+{
+DPRINT1("SetupFindFirstLine() failed\n");
+ErrorNumber = ERROR_FIND_REGISTRY;
+goto Cleanup;
+}
+}
+else // if (RepairUpdateFlag && !ShouldRepairRegistry)
+{
+/*
+ * In case we are doing an update (RepairUpdateFlag == TRUE) and
+ * NO registry hives need a repair (ShouldRepairRegistry == FALSE),
+ * we only update the hives.
+ */
+
+Success = SetupFindFirstLineW(SetupInf, L"HiveInfs.Upgrade", NULL, 
&InfContext);
+if (!Success)
+{
+/* Nothing to do for update! */
+DPRINT1("No update needed for the registry!\n");
+goto Cleanup;
+}
+}
+
+do
+{
+INF_GetDataField(&InfContext, 0, &Action);
+INF_GetDataField(&InfContext,

[ros-diffs] [hbelusca] 75749: [USETUP]: Introduce some -V functions for CONSOLE_ConOutPrintf, CONSOLE_SetStatusText and CONSOLE_SetStatusTextX. Fix also the whitespace in consup.h.

2017-09-03 Thread hbelusca
Author: hbelusca
Date: Sun Sep  3 16:03:21 2017
New Revision: 75749

URL: http://svn.reactos.org/svn/reactos?rev=75749&view=rev
Log:
[USETUP]: Introduce some -V functions for CONSOLE_ConOutPrintf, 
CONSOLE_SetStatusText and CONSOLE_SetStatusTextX.
Fix also the whitespace in consup.h.

Modified:
branches/setup_improvements/base/setup/usetup/consup.c
branches/setup_improvements/base/setup/usetup/consup.h

Modified: branches/setup_improvements/base/setup/usetup/consup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/consup.c?rev=75749&r1=75748&r2=75749&view=diff
==
--- branches/setup_improvements/base/setup/usetup/consup.c  [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/consup.c  [iso-8859-1] 
Sun Sep  3 16:03:21 2017
@@ -109,16 +109,14 @@
 }
 
 VOID
-CONSOLE_ConOutPrintf(
-IN LPCSTR szFormat, ...)
+CONSOLE_ConOutPrintfV(
+IN LPCSTR szFormat,
+IN va_list args)
 {
 CHAR szOut[256];
 DWORD dwWritten;
-va_list arg_ptr;
-
-va_start(arg_ptr, szFormat);
-vsprintf(szOut, szFormat, arg_ptr);
-va_end(arg_ptr);
+
+vsprintf(szOut, szFormat, args);
 
 WriteConsole(
 StdOutput,
@@ -126,6 +124,18 @@
 (ULONG)strlen(szOut),
 &dwWritten,
 NULL);
+}
+
+VOID
+CONSOLE_ConOutPrintf(
+IN LPCSTR szFormat,
+...)
+{
+va_list arg_ptr;
+
+va_start(arg_ptr, szFormat);
+CONSOLE_ConOutPrintfV(szFormat, arg_ptr);
+va_end(arg_ptr);
 }
 
 BOOL
@@ -385,17 +395,16 @@
 }
 
 VOID
-CONSOLE_SetStatusText(
-IN LPCSTR fmt, ...)
-{
+CONSOLE_SetStatusTextXV(
+IN SHORT x,
+IN LPCSTR fmt,
+IN va_list args)
+{
+COORD coPos;
+DWORD Written;
 CHAR Buffer[128];
-va_list ap;
-COORD coPos;
-DWORD Written;
-
-va_start(ap, fmt);
-vsprintf(Buffer, fmt, ap);
-va_end(ap);
+
+vsprintf(Buffer, fmt, args);
 
 coPos.X = 0;
 coPos.Y = yScreen - 1;
@@ -414,6 +423,8 @@
 coPos,
 &Written);
 
+coPos.X = x;
+
 WriteConsoleOutputCharacterA(
 StdOutput,
 Buffer,
@@ -425,42 +436,34 @@
 VOID
 CONSOLE_SetStatusTextX(
 IN SHORT x,
-IN LPCSTR fmt, ...)
-{
-CHAR Buffer[128];
+IN LPCSTR fmt,
+...)
+{
 va_list ap;
-COORD coPos;
-DWORD Written;
 
 va_start(ap, fmt);
-vsprintf(Buffer, fmt, ap);
+CONSOLE_SetStatusTextXV(x, fmt, ap);
 va_end(ap);
-
-coPos.X = 0;
-coPos.Y = yScreen - 1;
-
-FillConsoleOutputAttribute(
-StdOutput,
-BACKGROUND_WHITE,
-xScreen,
-coPos,
-&Written);
-
-FillConsoleOutputCharacterA(
-StdOutput,
-' ',
-xScreen,
-coPos,
-&Written);
-
-coPos.X = x;
-
-WriteConsoleOutputCharacterA(
-StdOutput,
-Buffer,
-(ULONG)strlen(Buffer),
-coPos,
-&Written);
+}
+
+VOID
+CONSOLE_SetStatusTextV(
+IN LPCSTR fmt,
+IN va_list args)
+{
+CONSOLE_SetStatusTextXV(0, fmt, args);
+}
+
+VOID
+CONSOLE_SetStatusText(
+IN LPCSTR fmt,
+...)
+{
+va_list ap;
+
+va_start(ap, fmt);
+CONSOLE_SetStatusTextV(fmt, ap);
+va_end(ap);
 }
 
 static

Modified: branches/setup_improvements/base/setup/usetup/consup.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/consup.h?rev=75749&r1=75748&r2=75749&view=diff
==
--- branches/setup_improvements/base/setup/usetup/consup.h  [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/consup.h  [iso-8859-1] 
Sun Sep  3 16:03:21 2017
@@ -55,26 +55,32 @@
 
 BOOLEAN
 CONSOLE_Init(
-   VOID);
+VOID);
 
 VOID
 CONSOLE_ClearScreen(VOID);
 
 VOID
 CONSOLE_ConInKey(
-   OUT PINPUT_RECORD Buffer);
+OUT PINPUT_RECORD Buffer);
 
 VOID
 CONSOLE_ConOutChar(
-   IN CHAR c);
+IN CHAR c);
+
+VOID
+CONSOLE_ConOutPrintfV(
+IN LPCSTR szFormat,
+IN va_list args);
 
 VOID
 CONSOLE_ConOutPrintf(
-   IN LPCSTR szFormat, ...);
+IN LPCSTR szFormat,
+...);
 
 VOID
 CONSOLE_ConOutPuts(
-   IN LPCSTR szText);
+IN LPCSTR szText);
 
 BOOL
 CONSOLE_Flush(VOID);
@@ -92,97 +98,110 @@
 
 VOID
 CONSOLE_InvertTextXY(
-   IN SHORT x,
-   IN SHORT y,
-   IN SHORT col,
-   IN SHORT row);
+IN SHORT x,
+IN SHORT y,
+IN SHORT col,
+IN SHORT row);
 
 VOID
 CONSOLE_NormalTextXY(
-   IN SHORT x,
-   IN SHORT y,
-   IN SHORT col,
-   IN SHORT row);
+IN SHORT x,
+IN SHORT y,
+IN SHORT col,
+IN SHORT row);
 
 VOID
 CONSOLE_PrintTextXY(
-   IN SHORT x,
-   IN SHORT y,
-   IN LPCSTR fmt, ...);
+IN SHORT x,
+IN SHORT y,
+IN LPCSTR fmt, ...);
 
 VOID
 CONSOLE_PrintTextXYN(
-   IN SHORT x,
-

[ros-diffs] [hbelusca] 75748: [USETUP]: Fix a typo.

2017-09-03 Thread hbelusca
Author: hbelusca
Date: Sun Sep  3 12:08:39 2017
New Revision: 75748

URL: http://svn.reactos.org/svn/reactos?rev=75748&view=rev
Log:
[USETUP]: Fix a typo.

Modified:
branches/setup_improvements/base/setup/usetup/lang/bg-BG.h
branches/setup_improvements/base/setup/usetup/lang/bn-BD.h
branches/setup_improvements/base/setup/usetup/lang/cs-CZ.h
branches/setup_improvements/base/setup/usetup/lang/da-DK.h
branches/setup_improvements/base/setup/usetup/lang/de-DE.h
branches/setup_improvements/base/setup/usetup/lang/el-GR.h
branches/setup_improvements/base/setup/usetup/lang/en-US.h
branches/setup_improvements/base/setup/usetup/lang/es-ES.h
branches/setup_improvements/base/setup/usetup/lang/et-EE.h
branches/setup_improvements/base/setup/usetup/lang/fr-FR.h
branches/setup_improvements/base/setup/usetup/lang/he-IL.h
branches/setup_improvements/base/setup/usetup/lang/it-IT.h
branches/setup_improvements/base/setup/usetup/lang/ja-JP.h
branches/setup_improvements/base/setup/usetup/lang/lt-LT.h
branches/setup_improvements/base/setup/usetup/lang/ms-MY.h
branches/setup_improvements/base/setup/usetup/lang/nl-NL.h
branches/setup_improvements/base/setup/usetup/lang/pl-PL.h
branches/setup_improvements/base/setup/usetup/lang/pt-BR.h
branches/setup_improvements/base/setup/usetup/lang/ro-RO.h
branches/setup_improvements/base/setup/usetup/lang/ru-RU.h
branches/setup_improvements/base/setup/usetup/lang/sk-SK.h
branches/setup_improvements/base/setup/usetup/lang/sq-AL.h
branches/setup_improvements/base/setup/usetup/lang/sv-SE.h
branches/setup_improvements/base/setup/usetup/lang/tr-TR.h
branches/setup_improvements/base/setup/usetup/lang/uk-UA.h
branches/setup_improvements/base/setup/usetup/mui.h
branches/setup_improvements/base/setup/usetup/usetup.c

Modified: branches/setup_improvements/base/setup/usetup/lang/bg-BG.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/lang/bg-BG.h?rev=75748&r1=75747&r2=75748&view=diff
==
--- branches/setup_improvements/base/setup/usetup/lang/bg-BG.h  [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/lang/bg-BG.h  [iso-8859-1] 
Sun Sep  3 12:08:39 2017
@@ -1771,7 +1771,7 @@
 "   Žáê¢à¥¬¥­ï¢ ­¥ ­  ॣ¨áâê୨⥠஥¢¥..."},
 {STRING_IMPORTFILE,
 "   ‚­ áï­¥ ­  %S..."},
-{STRING_DISPLAYETTINGSUPDATE,
+{STRING_DISPLAYSETTINGSUPDATE,
 "   Žáê¢à¥¬¥­ï¢ ­¥ ॣ¨áâ஢¨â¥ ­ áâனª¨ ­  ¥ªà ­ ..."},
 {STRING_LOCALESETTINGSUPDATE,
 "   Žáê¢à¥¬¥­ï¢ ­¥ ­  ¬¥á⭨⥠­ áâனª¨..."},

Modified: branches/setup_improvements/base/setup/usetup/lang/bn-BD.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/lang/bn-BD.h?rev=75748&r1=75747&r2=75748&view=diff
==
--- branches/setup_improvements/base/setup/usetup/lang/bn-BD.h  [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/lang/bn-BD.h  [iso-8859-1] 
Sun Sep  3 12:08:39 2017
@@ -1759,7 +1759,7 @@
 "   Updating registry hives..."},
 {STRING_IMPORTFILE,
 "   Importing %S..."},
-{STRING_DISPLAYETTINGSUPDATE,
+{STRING_DISPLAYSETTINGSUPDATE,
 "   Updating display registry settings..."},
 {STRING_LOCALESETTINGSUPDATE,
 "   Updating locale settings..."},

Modified: branches/setup_improvements/base/setup/usetup/lang/cs-CZ.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/lang/cs-CZ.h?rev=75748&r1=75747&r2=75748&view=diff
==
--- branches/setup_improvements/base/setup/usetup/lang/cs-CZ.h  [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/lang/cs-CZ.h  [iso-8859-1] 
Sun Sep  3 12:08:39 2017
@@ -1765,7 +1765,7 @@
 "   Aktualizuji registr..."},
 {STRING_IMPORTFILE,
 "   Importuji %S..."},
-{STRING_DISPLAYETTINGSUPDATE,
+{STRING_DISPLAYSETTINGSUPDATE,
 "   Aktualizuji nastaven¡ zobrazen¡ registru..."}, //display registry 
settings
 {STRING_LOCALESETTINGSUPDATE,
 "   Aktualizuji m¡stn¡ nastaven¡..."},

Modified: branches/setup_improvements/base/setup/usetup/lang/da-DK.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/lang/da-DK.h?rev=75748&r1=75747&r2=75748&view=diff
==
--- branches/setup_improvements/base/setup/usetup/lang/da-DK.h  [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/lang/da-DK.h  [iso-8859-1] 
Sun Sep  3 12:08:39 2017
@@ -1773,7 +1773,7 @@
 "   Op

[ros-diffs] [hbelusca] 75733: [EVENTCREATE]: Use wcstoul() to retrieve and check for valid numerical values.

2017-09-01 Thread hbelusca
Author: hbelusca
Date: Fri Sep  1 20:35:25 2017
New Revision: 75733

URL: http://svn.reactos.org/svn/reactos?rev=75733&view=rev
Log:
[EVENTCREATE]: Use wcstoul() to retrieve and check for valid numerical values.

Modified:
trunk/reactos/base/applications/cmdutils/eventcreate/eventcreate.c

Modified: trunk/reactos/base/applications/cmdutils/eventcreate/eventcreate.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils/eventcreate/eventcreate.c?rev=75733&r1=75732&r2=75733&view=diff
==
--- trunk/reactos/base/applications/cmdutils/eventcreate/eventcreate.c  
[iso-8859-1] (original)
+++ trunk/reactos/base/applications/cmdutils/eventcreate/eventcreate.c  
[iso-8859-1] Fri Sep  1 20:35:25 2017
@@ -914,7 +914,18 @@
 // case TYPE_U16:
 case TYPE_U32:
 {
-*(ULONG*)Options[Option].Value = (ULONG)_wtol(argv[i]);
+PWCHAR pszNext = NULL;
+
+/* The number is specified in base 10 */
+// NOTE: We might use '0' so that the base is 
automatically determined.
+*(ULONG*)Options[Option].Value = wcstoul(argv[i], 
&pszNext, 10);
+if (*pszNext)
+{
+/* The value is not a valid numeric value and is not 
allowed */
+if (PrintErrorFunc)
+PrintErrorFunc(InvalidValue, argv[i], OptionStr);
+return FALSE;
+}
 break;
 }
 




[ros-diffs] [hbelusca] 75732: [CONSOLE.CPL]: Fix an invalid success check after calling wcstoul(), plus usage fixes for the True-Type combobox edit box.

2017-09-01 Thread hbelusca
Author: hbelusca
Date: Fri Sep  1 20:17:25 2017
New Revision: 75732

URL: http://svn.reactos.org/svn/reactos?rev=75732&view=rev
Log:
[CONSOLE.CPL]: Fix an invalid success check after calling wcstoul(), plus usage 
fixes for the True-Type combobox edit box.

Modified:
trunk/reactos/dll/cpl/console/font.c

Modified: trunk/reactos/dll/cpl/console/font.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/font.c?rev=75732&r1=75731&r2=75732&view=diff
==
--- trunk/reactos/dll/cpl/console/font.c[iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/console/font.c[iso-8859-1] Fri Sep  1 
20:17:25 2017
@@ -168,6 +168,7 @@
 {
 INT nSel;
 LONG FontSize;
+PWCHAR pszNext = NULL;
 WCHAR szFontSize[100];
 
 if (SizeList->UseRasterOrTTList)
@@ -196,6 +197,11 @@
  */
 nSel = SendMessageW(SizeList->hWndTTSizeList, CB_GETCURSEL, 0, 0);
 SendMessageW(SizeList->hWndTTSizeList, CB_GETLBTEXT, nSel, 
(LPARAM)szFontSize);
+
+/* Validate the font size */
+FontSize = wcstoul(szFontSize, &pszNext, 10);
+if ((FontSize == 0) || (*pszNext))
+return 0;
 }
 else
 {
@@ -203,7 +209,12 @@
 // ComboBox_GetText(...)
 GetWindowTextW(SizeList->hWndTTSizeList, szFontSize, 
ARRAYSIZE(szFontSize));
 
-// HACK???
+/* Validate the font size */
+FontSize = wcstoul(szFontSize, &pszNext, 10);
+if ((FontSize == 0) || (*pszNext))
+return 0;
+
+/* Find if the font size already exists in the list; if not, add 
it */
 nSel = SendMessageW(SizeList->hWndTTSizeList, CB_FINDSTRINGEXACT, 
0, (LPARAM)szFontSize);
 if (nSel == CB_ERR)
 {
@@ -216,11 +227,6 @@
 }
 
 SizeList->bIsTTSizeDirty = FALSE;
-
-/* If _wtol fails and returns 0, the font size is considered invalid */
-// FontSize = wcstoul(szFontSize, &pszNext, 10); if (!*pszNext) { /* 
Error */ }
-FontSize = _wtol(szFontSize);
-if (FontSize == 0) return 0;
 
 SizeList->CurrentTTSize = FontSize;
 
@@ -601,7 +607,10 @@
  *   if SizeList->TTSizePixelUnit is TRUE, then the font size is in pixels;
  * - If SizeList->TTSizePixelUnit is FALSE, then the font size is in 
points.
  */
-FontSize   = FontSizeList_GetSelectedFontSize(SizeList);
+FontSize = FontSizeList_GetSelectedFontSize(SizeList);
+if (FontSize == 0)
+return FALSE; // We have got an invalid font size...
+
 CharHeight = (SizeList->UseRasterOrTTList ? (LONG)HIWORD(FontSize) : 
FontSize);
 CharWidth  = (SizeList->UseRasterOrTTList ? (LONG)LOWORD(FontSize) : 0);
 
@@ -776,14 +785,16 @@
 WCHAR szFontSize[100];
 WCHAR szMessage[260];
 
+/* Read the ComboBox edit string, as the user has entered a 
custom size */
 GetWindowTextW(SizeList->hWndTTSizeList, szFontSize, 
ARRAYSIZE(szFontSize));
+
+/* Validate the font size */
 FontSize = wcstoul(szFontSize, &pszNext, 10);
-if (!*pszNext)
+if ((FontSize == 0) || (*pszNext))
 {
 // FIXME: Localize!
 StringCchPrintfW(szMessage, ARRAYSIZE(szMessage), L"\"%s\" 
is not a valid font size.", szFontSize);
 MessageBoxW(hDlg, szMessage, L"Error", MB_ICONINFORMATION 
| MB_OK);
-FontSizeList_SelectFontSize(SizeList, FontSize);
 }
 /**/SizeList->bIsTTSizeDirty = TRUE;/**/
 }




[ros-diffs] [hbelusca] 75729: [NET]: Whitespace fixes only.

2017-09-01 Thread hbelusca
Author: hbelusca
Date: Fri Sep  1 18:00:06 2017
New Revision: 75729

URL: http://svn.reactos.org/svn/reactos?rev=75729&view=rev
Log:
[NET]: Whitespace fixes only.

Modified:
trunk/reactos/base/applications/network/net/cmdAccounts.c
trunk/reactos/base/applications/network/net/help.c

Modified: trunk/reactos/base/applications/network/net/cmdAccounts.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/net/cmdAccounts.c?rev=75729&r1=75728&r2=75729&view=diff
==
--- trunk/reactos/base/applications/network/net/cmdAccounts.c   [iso-8859-1] 
(original)
+++ trunk/reactos/base/applications/network/net/cmdAccounts.c   [iso-8859-1] 
Fri Sep  1 18:00:06 2017
@@ -90,9 +90,9 @@
 value = wcstoul(p, &endptr, 10);
 if (*endptr != 0)
 {
-ConResPrintf(StdErr, IDS_ERROR_INVALID_OPTION_VALUE, 
L"/MINPWLEN");
-result = 1;
-goto done;
+ConResPrintf(StdErr, IDS_ERROR_INVALID_OPTION_VALUE, 
L"/MINPWLEN");
+result = 1;
+goto done;
 }
 
 Info0->usrmod0_min_passwd_len = value;

Modified: trunk/reactos/base/applications/network/net/help.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/net/help.c?rev=75729&r1=75728&r2=75729&view=diff
==
--- trunk/reactos/base/applications/network/net/help.c  [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/net/help.c  [iso-8859-1] Fri Sep  1 
18:00:06 2017
@@ -17,139 +17,139 @@
 return 0;
 }
 
-if (_wcsicmp(argv[2],L"ACCOUNTS") == 0)
+if (_wcsicmp(argv[2], L"ACCOUNTS") == 0)
 {
 ConResPuts(StdOut, IDS_ACCOUNTS_HELP);
 return 0;
 }
 
-if (_wcsicmp(argv[2],L"COMPUTER") == 0)
+if (_wcsicmp(argv[2], L"COMPUTER") == 0)
 {
 ConResPuts(StdOut, IDS_COMPUTER_HELP);
 return 0;
 }
 
-if (_wcsicmp(argv[2],L"CONFIG") == 0)
+if (_wcsicmp(argv[2], L"CONFIG") == 0)
 {
 ConResPuts(StdOut, IDS_CONFIG_HELP);
 return 0;
 }
 
-if (_wcsicmp(argv[2],L"CONTINUE") == 0)
+if (_wcsicmp(argv[2], L"CONTINUE") == 0)
 {
 ConResPuts(StdOut, IDS_CONTINUE_HELP);
 return 0;
 }
 
-if (_wcsicmp(argv[2],L"FILE") == 0)
+if (_wcsicmp(argv[2], L"FILE") == 0)
 {
 ConResPuts(StdOut, IDS_FILE_HELP);
 return 0;
 }
 
-if (_wcsicmp(argv[2],L"GROUP") == 0)
+if (_wcsicmp(argv[2], L"GROUP") == 0)
 {
 ConResPuts(StdOut, IDS_GROUP_HELP);
 return 0;
 }
 
-if (_wcsicmp(argv[2],L"HELPMSG") == 0)
+if (_wcsicmp(argv[2], L"HELPMSG") == 0)
 {
 ConResPuts(StdOut, IDS_HELPMSG_HELP);
 return 0;
 }
 
-if (_wcsicmp(argv[2],L"LOCALGROUP") == 0)
+if (_wcsicmp(argv[2], L"LOCALGROUP") == 0)
 {
 ConResPuts(StdOut, IDS_LOCALGROUP_HELP);
 return 0;
 }
 
-if (_wcsicmp(argv[2],L"NAME") == 0)
+if (_wcsicmp(argv[2], L"NAME") == 0)
 {
 ConResPuts(StdOut, IDS_NAME_HELP);
 return 0;
 }
 
-if (_wcsicmp(argv[2],L"PAUSE") == 0)
+if (_wcsicmp(argv[2], L"PAUSE") == 0)
 {
 ConResPuts(StdOut, IDS_PAUSE_HELP);
 return 0;
 }
 
-if (_wcsicmp(argv[2],L"PRINT") == 0)
+if (_wcsicmp(argv[2], L"PRINT") == 0)
 {
 ConResPuts(StdOut, IDS_PRINT_HELP);
 return 0;
 }
 
-if (_wcsicmp(argv[2],L"SEND") == 0)
+if (_wcsicmp(argv[2], L"SEND") == 0)
 {
 ConResPuts(StdOut, IDS_SEND_HELP);
 return 0;
 }
 
-if (_wcsicmp(argv[2],L"SESSION") == 0)
+if (_wcsicmp(argv[2], L"SESSION") == 0)
 {
 ConResPuts(StdOut, IDS_SESSION_HELP);
 return 0;
 }
 
-if (_wcsicmp(argv[2],L"SHARE") == 0)
+if (_wcsicmp(argv[2], L"SHARE") == 0)
 {
 ConResPuts(StdOut, IDS_SHARE_HELP);
 return 0;
 }
 
-if (_wcsicmp(argv[2],L"START") == 0)
+if (_wcsicmp(argv[2], L"START") == 0)
 {
 ConResPuts(StdOut, IDS_START_HELP);
 return 0;
 }
 
-if (_wcsicmp(argv[2],L"STATISTICS") == 0)
+if (_wcsicmp(argv[2], L"STATISTICS") == 0)
 {
 ConResPuts(StdOut, IDS_STATISTICS_HELP);
 return 0;
 }
 
-if (_wcsicmp(argv[2],L"STOP") == 0)
+if (_wcsicmp(argv[2], L"STOP") == 0)
 {
 ConResPuts(StdOut, IDS_STOP_HELP);
 return 0;

[ros-diffs] [hbelusca] 75726: [ACPPAGE]: "Sync fail" with Mark Jansen's translation work in CORE-13693, sorry :(

2017-08-31 Thread hbelusca
Author: hbelusca
Date: Thu Aug 31 20:49:02 2017
New Revision: 75726

URL: http://svn.reactos.org/svn/reactos?rev=75726&view=rev
Log:
[ACPPAGE]: "Sync fail" with Mark Jansen's translation work in CORE-13693, sorry 
:(

Modified:
trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp
trunk/reactos/dll/shellext/acppage/lang/bg-BG.rc
trunk/reactos/dll/shellext/acppage/lang/cs-CZ.rc
trunk/reactos/dll/shellext/acppage/lang/de-DE.rc
trunk/reactos/dll/shellext/acppage/lang/en-US.rc
trunk/reactos/dll/shellext/acppage/lang/es-ES.rc
trunk/reactos/dll/shellext/acppage/lang/eu-ES.rc
trunk/reactos/dll/shellext/acppage/lang/fr-FR.rc
trunk/reactos/dll/shellext/acppage/lang/he-IL.rc
trunk/reactos/dll/shellext/acppage/lang/hu-HU.rc
trunk/reactos/dll/shellext/acppage/lang/id-ID.rc
trunk/reactos/dll/shellext/acppage/lang/it-IT.rc
trunk/reactos/dll/shellext/acppage/lang/nl-NL.rc
trunk/reactos/dll/shellext/acppage/lang/no-NO.rc
trunk/reactos/dll/shellext/acppage/lang/pl-PL.rc
trunk/reactos/dll/shellext/acppage/lang/ro-RO.rc
trunk/reactos/dll/shellext/acppage/lang/ru-RU.rc
trunk/reactos/dll/shellext/acppage/lang/sk-SK.rc
trunk/reactos/dll/shellext/acppage/lang/sq-AL.rc
trunk/reactos/dll/shellext/acppage/lang/sv-SE.rc
trunk/reactos/dll/shellext/acppage/lang/tr-TR.rc
trunk/reactos/dll/shellext/acppage/lang/uk-UA.rc
trunk/reactos/dll/shellext/acppage/lang/zh-CN.rc
trunk/reactos/dll/shellext/acppage/lang/zh-TW.rc
trunk/reactos/dll/shellext/acppage/resource.h

Modified: trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp?rev=75726&r1=75725&r2=75726&view=diff
==
--- trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp [iso-8859-1] 
(original)
+++ trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp [iso-8859-1] 
Thu Aug 31 20:49:02 2017
@@ -393,7 +393,7 @@
 UpdateControls(hWnd);
 break;
 case IDC_EDITCOMPATIBILITYMODES:
-if (DialogBoxParamW(g_hModule, 
MAKEINTRESOURCEW(IDD_EDITCOMPATIBILITYMODES), hWnd, EditModesProc, 
(LPARAM)this) == IDOK)
+if (DialogBoxParam(g_hModule, 
MAKEINTRESOURCE(IDD_EDITCOMPATIBILITYMODES), hWnd, EditModesProc, (LPARAM)this) 
== IDOK)
 {
 UpdateControls(hWnd);
 }
@@ -572,7 +572,7 @@
 if (ComboHasData(hWnd))
 {
 CComBSTR question, title;
-title.LoadString(g_hModule, IDS_COMPAT_TITLE);
+title.LoadString(g_hModule, IDS_TABTITLE);
 question.LoadString(g_hModule, IDS_YOU_DID_NOT_ADD);
 int result = MessageBoxW(hWnd, question, title, MB_YESNOCANCEL 
| MB_ICONQUESTION);
 switch (result)
@@ -694,9 +694,10 @@
 {
 PROPSHEETPAGEW psp = { 0 };
 psp.dwSize = sizeof(psp);
-psp.dwFlags = PSP_USEREFPARENT;
+psp.dwFlags = PSP_USEREFPARENT | PSP_USETITLE;
 psp.hInstance = g_hModule;
-psp.pszTemplate = MAKEINTRESOURCEW(IDD_ACPPAGESHEET);
+psp.pszTemplate = MAKEINTRESOURCE(IDD_ACPPAGESHEET);
+psp.pszTitle = MAKEINTRESOURCE(IDS_TABTITLE);
 psp.pfnDlgProc = PropDlgProc;
 psp.lParam = (LPARAM)this;
 psp.pcRefParent = (PUINT)&g_ModuleRefCnt;

Modified: trunk/reactos/dll/shellext/acppage/lang/bg-BG.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/acppage/lang/bg-BG.rc?rev=75726&r1=75725&r2=75726&view=diff
==
--- trunk/reactos/dll/shellext/acppage/lang/bg-BG.rc[iso-8859-1] (original)
+++ trunk/reactos/dll/shellext/acppage/lang/bg-BG.rc[iso-8859-1] Thu Aug 31 
20:49:02 2017
@@ -33,7 +33,7 @@
 
 STRINGTABLE
 BEGIN
-IDS_COMPAT_TITLE "Съвместимост"
+IDS_TABTITLE "Compatibility"
 IDS_FAILED_NETWORK "Compatibility modes cannot be set on this program 
because it is on a network drive."
 IDS_FAILED_PROTECTED "Compatibility modes cannot be set on this program 
because it is a part of ReactOS."
 IDS_YOU_DID_NOT_ADD "You did not add the mode, do you want to add it now?"

Modified: trunk/reactos/dll/shellext/acppage/lang/cs-CZ.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/acppage/lang/cs-CZ.rc?rev=75726&r1=75725&r2=75726&view=diff
==
--- trunk/reactos/dll/shellext/acppage/lang/cs-CZ.rc[iso-8859-1] (original)
+++ trunk/reactos/dll/shellext/acppage/lang/cs-CZ.rc[iso-8859-1] Thu Aug 31 
20:49:02 2017
@@ -38,7 +38,7 @@
 
 STRINGTABLE
 BEGIN
-IDS_COMPAT_TITLE "Kompatibilita"
+IDS_TABTITLE "Compatibility"
 IDS_FAILED_NETWORK "Compatibility modes cannot b

[ros-diffs] [hbelusca] 75725: [ACPPAGE]: Improve the compatibility tab: - Use the tab title from the corresponding dialog resource caption string. - Fix some translations, and complete the french one.

2017-08-31 Thread hbelusca
Author: hbelusca
Date: Thu Aug 31 20:38:38 2017
New Revision: 75725

URL: http://svn.reactos.org/svn/reactos?rev=75725&view=rev
Log:
[ACPPAGE]: Improve the compatibility tab:
- Use the tab title from the corresponding dialog resource caption string.
- Fix some translations, and complete the french one.
- Use DialogBoxParamW and MAKEINTRESOURCEW (with W).

Modified:
trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp
trunk/reactos/dll/shellext/acppage/lang/bg-BG.rc
trunk/reactos/dll/shellext/acppage/lang/cs-CZ.rc
trunk/reactos/dll/shellext/acppage/lang/de-DE.rc
trunk/reactos/dll/shellext/acppage/lang/en-US.rc
trunk/reactos/dll/shellext/acppage/lang/es-ES.rc
trunk/reactos/dll/shellext/acppage/lang/eu-ES.rc
trunk/reactos/dll/shellext/acppage/lang/fr-FR.rc
trunk/reactos/dll/shellext/acppage/lang/he-IL.rc
trunk/reactos/dll/shellext/acppage/lang/hu-HU.rc
trunk/reactos/dll/shellext/acppage/lang/id-ID.rc
trunk/reactos/dll/shellext/acppage/lang/it-IT.rc
trunk/reactos/dll/shellext/acppage/lang/nl-NL.rc
trunk/reactos/dll/shellext/acppage/lang/no-NO.rc
trunk/reactos/dll/shellext/acppage/lang/pl-PL.rc
trunk/reactos/dll/shellext/acppage/lang/ro-RO.rc
trunk/reactos/dll/shellext/acppage/lang/ru-RU.rc
trunk/reactos/dll/shellext/acppage/lang/sk-SK.rc
trunk/reactos/dll/shellext/acppage/lang/sq-AL.rc
trunk/reactos/dll/shellext/acppage/lang/sv-SE.rc
trunk/reactos/dll/shellext/acppage/lang/tr-TR.rc
trunk/reactos/dll/shellext/acppage/lang/uk-UA.rc
trunk/reactos/dll/shellext/acppage/lang/zh-CN.rc
trunk/reactos/dll/shellext/acppage/lang/zh-TW.rc
trunk/reactos/dll/shellext/acppage/resource.h

Modified: trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp?rev=75725&r1=75724&r2=75725&view=diff
==
--- trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp [iso-8859-1] 
(original)
+++ trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp [iso-8859-1] 
Thu Aug 31 20:38:38 2017
@@ -393,7 +393,7 @@
 UpdateControls(hWnd);
 break;
 case IDC_EDITCOMPATIBILITYMODES:
-if (DialogBoxParam(g_hModule, 
MAKEINTRESOURCE(IDD_EDITCOMPATIBILITYMODES), hWnd, EditModesProc, (LPARAM)this) 
== IDOK)
+if (DialogBoxParamW(g_hModule, 
MAKEINTRESOURCEW(IDD_EDITCOMPATIBILITYMODES), hWnd, EditModesProc, 
(LPARAM)this) == IDOK)
 {
 UpdateControls(hWnd);
 }
@@ -572,7 +572,7 @@
 if (ComboHasData(hWnd))
 {
 CComBSTR question, title;
-title.LoadString(g_hModule, IDS_TABTITLE);
+title.LoadString(g_hModule, IDS_COMPAT_TITLE);
 question.LoadString(g_hModule, IDS_YOU_DID_NOT_ADD);
 int result = MessageBoxW(hWnd, question, title, MB_YESNOCANCEL 
| MB_ICONQUESTION);
 switch (result)
@@ -694,10 +694,9 @@
 {
 PROPSHEETPAGEW psp = { 0 };
 psp.dwSize = sizeof(psp);
-psp.dwFlags = PSP_USEREFPARENT | PSP_USETITLE;
+psp.dwFlags = PSP_USEREFPARENT;
 psp.hInstance = g_hModule;
-psp.pszTemplate = MAKEINTRESOURCE(IDD_ACPPAGESHEET);
-psp.pszTitle = MAKEINTRESOURCE(IDS_TABTITLE);
+psp.pszTemplate = MAKEINTRESOURCEW(IDD_ACPPAGESHEET);
 psp.pfnDlgProc = PropDlgProc;
 psp.lParam = (LPARAM)this;
 psp.pcRefParent = (PUINT)&g_ModuleRefCnt;

Modified: trunk/reactos/dll/shellext/acppage/lang/bg-BG.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/acppage/lang/bg-BG.rc?rev=75725&r1=75724&r2=75725&view=diff
==
--- trunk/reactos/dll/shellext/acppage/lang/bg-BG.rc[iso-8859-1] (original)
+++ trunk/reactos/dll/shellext/acppage/lang/bg-BG.rc[iso-8859-1] Thu Aug 31 
20:38:38 2017
@@ -33,7 +33,7 @@
 
 STRINGTABLE
 BEGIN
-IDS_TABTITLE "Compatibility"
+IDS_COMPAT_TITLE "Съвместимост"
 IDS_FAILED_NETWORK "Compatibility modes cannot be set on this program 
because it is on a network drive."
 IDS_FAILED_PROTECTED "Compatibility modes cannot be set on this program 
because it is a part of ReactOS."
 IDS_YOU_DID_NOT_ADD "You did not add the mode, do you want to add it now?"

Modified: trunk/reactos/dll/shellext/acppage/lang/cs-CZ.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/acppage/lang/cs-CZ.rc?rev=75725&r1=75724&r2=75725&view=diff
==
--- trunk/reactos/dll/shellext/acppage/lang/cs-CZ.rc[iso-8859-1] (original)
+++ trunk/reactos/dll/shellext/acppage/lang/cs-CZ.rc[iso-8859-1] Thu Aug 31 
20:38:38 2017
@@ -38,7 +38,7 @@
 
 STRINGTABLE
 BEGIN
-IDS_TABTITLE &quo

[ros-diffs] [hbelusca] 75724: [SETUPLIB]: Addendum to r75720.

2017-08-31 Thread hbelusca
Author: hbelusca
Date: Thu Aug 31 19:39:52 2017
New Revision: 75724

URL: http://svn.reactos.org/svn/reactos?rev=75724&view=rev
Log:
[SETUPLIB]: Addendum to r75720.

Modified:
branches/setup_improvements/base/setup/lib/settings.c
branches/setup_improvements/base/setup/lib/settings.h

Modified: branches/setup_improvements/base/setup/lib/settings.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/settings.c?rev=75724&r1=75723&r2=75724&view=diff
==
--- branches/setup_improvements/base/setup/lib/settings.c   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/settings.c   [iso-8859-1] 
Thu Aug 31 19:39:52 2017
@@ -1178,7 +1178,7 @@
 CreateKeyboardLayoutList(
 IN HINF InfFile,
 IN PCWSTR LanguageId,
-OUT PWCHAR DefaultKBLayout)
+OUT PWSTR DefaultKBLayout)
 {
 PGENERIC_LIST List;
 INFCONTEXT Context;

Modified: branches/setup_improvements/base/setup/lib/settings.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/settings.h?rev=75724&r1=75723&r2=75724&view=diff
==
--- branches/setup_improvements/base/setup/lib/settings.h   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/settings.h   [iso-8859-1] 
Thu Aug 31 19:39:52 2017
@@ -54,7 +54,7 @@
 CreateKeyboardLayoutList(
 IN HINF InfFile,
 IN PCWSTR LanguageId,
-OUT PWCHAR DefaultKBLayout);
+OUT PWSTR DefaultKBLayout);
 
 PGENERIC_LIST
 CreateLanguageList(




[ros-diffs] [hbelusca] 75723: [USETUP]: Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721.

2017-08-31 Thread hbelusca
Author: hbelusca
Date: Thu Aug 31 18:49:39 2017
New Revision: 75723

URL: http://svn.reactos.org/svn/reactos?rev=75723&view=rev
Log:
[USETUP]: Adjust some MUI & settings calls, following the commits r75719, 
r75720 and r75721.

Modified:
branches/setup_improvements/base/setup/usetup/usetup.c
branches/setup_improvements/base/setup/usetup/usetup.h

Modified: branches/setup_improvements/base/setup/usetup/usetup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/usetup.c?rev=75723&r1=75722&r2=75723&view=diff
==
--- branches/setup_improvements/base/setup/usetup/usetup.c  [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/usetup.c  [iso-8859-1] 
Thu Aug 31 18:49:39 2017
@@ -400,13 +400,13 @@
 UpdateKBLayout(VOID)
 {
 PGENERIC_LIST_ENTRY ListEntry;
-LPCWSTR pszNewLayout;
-
-pszNewLayout = MUIDefaultKeyboardLayout();
+PCWSTR pszNewLayout;
+
+pszNewLayout = MUIDefaultKeyboardLayout(SelectedLanguageId);
 
 if (LayoutList == NULL)
 {
-LayoutList = CreateKeyboardLayoutList(SetupInf, DefaultKBLayout);
+LayoutList = CreateKeyboardLayoutList(SetupInf, SelectedLanguageId, 
DefaultKBLayout);
 if (LayoutList == NULL)
 {
 /* FIXME: Handle error! */
@@ -463,9 +463,10 @@
 }
 }
 
+SelectedLanguageId = DefaultLanguage;
+USetupData.LanguageId = 0;
+
 /* Load the font */
-USetupData.LanguageId = 0;
-SelectedLanguageId = DefaultLanguage;
 SetConsoleCodePage();
 UpdateKBLayout();
 
@@ -551,7 +552,7 @@
 {
 NewLanguageId = 
(PWCHAR)GetListEntryUserData(GetCurrentListEntry(LanguageList));
 
-if (SelectedLanguageId != NewLanguageId)
+if (wcscmp(SelectedLanguageId, NewLanguageId))
 {
 /* Clear the language page */
 MUIClearPage(LANGUAGE_PAGE);
@@ -642,12 +643,15 @@
 ComputerList = CreateComputerTypeList(SetupInf);
 DisplayList = CreateDisplayDriverList(SetupInf);
 KeyboardList = CreateKeyboardDriverList(SetupInf);
-LayoutList = CreateKeyboardLayoutList(SetupInf, DefaultKBLayout);
+
 LanguageList = CreateLanguageList(SetupInf, DefaultLanguage);
 
 /* new part */
+SelectedLanguageId = DefaultLanguage;
 wcscpy(SelectedLanguageId, USetupData.LocaleID);
 USetupData.LanguageId = (LANGID)(wcstol(SelectedLanguageId, NULL, 16) 
& 0x);
+
+LayoutList = CreateKeyboardLayoutList(SetupInf, SelectedLanguageId, 
DefaultKBLayout);
 
 /* first we hack LanguageList */
 ListEntry = GetFirstListEntry(LanguageList);
@@ -1078,7 +1082,7 @@
 /* Initialize the keyboard layout list */
 if (LayoutList == NULL)
 {
-LayoutList = CreateKeyboardLayoutList(SetupInf, DefaultKBLayout);
+LayoutList = CreateKeyboardLayoutList(SetupInf, SelectedLanguageId, 
DefaultKBLayout);
 if (LayoutList == NULL)
 {
 /* FIXME: report error */
@@ -4032,14 +4036,14 @@
 
 /* Add keyboard layouts */
 CONSOLE_SetStatusText(MUIGetString(STRING_ADDKBLAYOUTS));
-if (!AddKeyboardLayouts())
+if (!AddKeyboardLayouts(SelectedLanguageId))
 {
 MUIDisplayError(ERROR_ADDING_KBLAYOUTS, Ir, POPUP_WAIT_ENTER);
 goto Cleanup;
 }
 
 /* Set GeoID */
-if (!SetGeoID(MUIGetGeoID()))
+if (!SetGeoID(MUIGetGeoID(SelectedLanguageId)))
 {
 MUIDisplayError(ERROR_UPDATE_GEOID, Ir, POPUP_WAIT_ENTER);
 goto Cleanup;
@@ -4049,7 +4053,7 @@
 {
 /* Update keyboard layout settings */
 CONSOLE_SetStatusText(MUIGetString(STRING_KEYBOARDSETTINGSUPDATE));
-if (!ProcessKeyboardLayoutRegistry(LayoutList))
+if (!ProcessKeyboardLayoutRegistry(LayoutList, SelectedLanguageId))
 {
 MUIDisplayError(ERROR_UPDATE_KBSETTINGS, Ir, POPUP_WAIT_ENTER);
 goto Cleanup;
@@ -4058,7 +4062,7 @@
 
 /* Add codepage information to registry */
 CONSOLE_SetStatusText(MUIGetString(STRING_CODEPAGEINFOUPDATE));
-if (!AddCodePage())
+if (!AddCodePage(SelectedLanguageId))
 {
 MUIDisplayError(ERROR_ADDING_CODEPAGE, Ir, POPUP_WAIT_ENTER);
 goto Cleanup;

Modified: branches/setup_improvements/base/setup/usetup/usetup.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/usetup.h?rev=75723&r1=75722&r2=75723&view=diff
==
--- branches/setup_improvements/base/setup/usetup/usetup.h  [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/usetup.h  [iso-8859-1] 
Thu Aug 31 18:49:39 2017
@@ -128,4 +128,10 @@
 #

[ros-diffs] [hbelusca] 75722: [USETUP]: Adaptations 1: - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUI

2017-08-31 Thread hbelusca
Author: hbelusca
Date: Thu Aug 31 18:31:52 2017
New Revision: 75722

URL: http://svn.reactos.org/svn/reactos?rev=75722&view=rev
Log:
[USETUP]: Adaptations 1:
- Transform some do{}while() loops into while(){} ones, since the lists on 
which we work may only contain one single {NULL} element.
- Modify MUIGetOEMCodePage() call after r75719.
- Use PCWSTR where needed.

Modified:
branches/setup_improvements/base/setup/usetup/mui.c
branches/setup_improvements/base/setup/usetup/mui.h

Modified: branches/setup_improvements/base/setup/usetup/mui.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/mui.c?rev=75722&r1=75721&r2=75722&view=diff
==
--- branches/setup_improvements/base/setup/usetup/mui.c [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/mui.c [iso-8859-1] Thu Aug 31 
18:31:52 2017
@@ -30,13 +30,6 @@
 #define NDEBUG
 #include 
 
-extern
-VOID
-PopupError(IN PCCH Text,
-   IN PCCH Status,
-   IN PINPUT_RECORD Ir,
-   IN ULONG WaitEvent);
-
 static
 ULONG
 FindLanguageIndex(VOID)
@@ -45,11 +38,12 @@
 
 if (SelectedLanguageId == NULL)
 {
-/* default to english */
-return 0;
-}
-
-do
+/* Default to en-US */
+return 0;   // FIXME!!
+// SelectedLanguageId = L"0409";
+}
+
+while (ResourceList[lngIndex].MuiPages != NULL)
 {
 if (_wcsicmp(ResourceList[lngIndex].LanguageID, SelectedLanguageId) == 
0)
 {
@@ -57,7 +51,7 @@
 }
 
 lngIndex++;
-} while (ResourceList[lngIndex].MuiPages != NULL);
+}
 
 return 0;
 }
@@ -70,13 +64,13 @@
 {
 ULONG lngIndex = 0;
 
-do
+while (ResourceList[lngIndex].MuiPages != NULL)
 {
 if (_wcsicmp(ResourceList[lngIndex].LanguageID, LanguageId) == 0)
 return TRUE;
 
 lngIndex++;
-} while (ResourceList[lngIndex].MuiPages != NULL);
+}
 
 return FALSE;
 }
@@ -95,13 +89,13 @@
 lngIndex = max(FindLanguageIndex(), 0);
 Pages = ResourceList[lngIndex].MuiPages;
 
-do
+while (Pages[muiIndex].MuiEntry != NULL)
 {
 if (Pages[muiIndex].Number == PageNumber)
 return Pages[muiIndex].MuiEntry;
 
 muiIndex++;
-} while (Pages[muiIndex].MuiEntry != NULL);
+}
 
 return NULL;
 }
@@ -128,7 +122,7 @@
 IN ULONG page)
 {
 const MUI_ENTRY * entry;
-int index;
+ULONG index;
 
 entry = FindMUIEntriesOfPage(page);
 if (!entry)
@@ -141,7 +135,7 @@
 }
 
 index = 0;
-do
+while (entry[index].Buffer != NULL)
 {
 CONSOLE_ClearStyledText(entry[index].X,
 entry[index].Y,
@@ -149,7 +143,6 @@
 strlen(entry[index].Buffer));
 index++;
 }
-while (entry[index].Buffer != NULL);
 }
 
 VOID
@@ -157,7 +150,7 @@
 IN ULONG page)
 {
 const MUI_ENTRY * entry;
-int index;
+ULONG index;
 
 entry = FindMUIEntriesOfPage(page);
 if (!entry)
@@ -170,7 +163,7 @@
 }
 
 index = 0;
-do
+while (entry[index].Buffer != NULL)
 {
 CONSOLE_SetStyledText(entry[index].X,
   entry[index].Y,
@@ -179,7 +172,6 @@
 
 index++;
 }
-while (entry[index].Buffer != NULL);
 }
 
 VOID
@@ -261,7 +253,7 @@
 #if 0
 ULONG lngIndex = 0;
 
-do
+while (ResourceList[lngIndex].MuiPages != NULL)
 {
 if (_wcsicmp(ResourceList[lngIndex].LanguageID, SelectedLanguageId) == 
0)
 {
@@ -272,9 +264,8 @@
 
 lngIndex++;
 }
-while (ResourceList[lngIndex].MuiPages != NULL);
 #else
-wCodePage = (UINT)wcstoul(MUIGetOEMCodePage(), NULL, 10);
+wCodePage = (UINT)wcstoul(MUIGetOEMCodePage(SelectedLanguageId), NULL, 10);
 SetConsoleOutputCP(wCodePage);
 #endif
 }

Modified: branches/setup_improvements/base/setup/usetup/mui.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/mui.h?rev=75722&r1=75721&r2=75722&view=diff
==
--- branches/setup_improvements/base/setup/usetup/mui.h [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/mui.h [iso-8859-1] Thu Aug 31 
18:31:52 2017
@@ -28,8 +28,8 @@
 
 typedef struct
 {
-PWCHAR LanguageID;
-PWCHAR LanguageDescriptor;
+PCWSTR LanguageID;
+PCWSTR LanguageDescriptor;
 const MUI_PAGE * MuiPages;
 const MUI_ERROR * MuiErrors;
 const MUI_STRING * MuiStrings;




[ros-diffs] [hbelusca] 75721: [REACTOS]: We don't need "SelectedLanguageId" anymore.

2017-08-31 Thread hbelusca
Author: hbelusca
Date: Thu Aug 31 18:27:44 2017
New Revision: 75721

URL: http://svn.reactos.org/svn/reactos?rev=75721&view=rev
Log:
[REACTOS]: We don't need "SelectedLanguageId" anymore.

Modified:
branches/setup_improvements/base/setup/reactos/reactos.c
branches/setup_improvements/base/setup/reactos/reactos.h

Modified: branches/setup_improvements/base/setup/reactos/reactos.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/reactos/reactos.c?rev=75721&r1=75720&r2=75721&view=diff
==
--- branches/setup_improvements/base/setup/reactos/reactos.c[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/reactos/reactos.c[iso-8859-1] 
Thu Aug 31 18:27:44 2017
@@ -34,10 +34,7 @@
 /* GLOBALS **/
 
 HANDLE ProcessHeap;
-
 BOOLEAN IsUnattendedSetup = FALSE;
-PWCHAR SelectedLanguageId;
-
 SETUPDATA SetupData;
 
 

Modified: branches/setup_improvements/base/setup/reactos/reactos.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/reactos/reactos.h?rev=75721&r1=75720&r2=75721&view=diff
==
--- branches/setup_improvements/base/setup/reactos/reactos.h[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/reactos/reactos.h[iso-8859-1] 
Thu Aug 31 18:27:44 2017
@@ -123,7 +123,6 @@
 
 extern HANDLE ProcessHeap;
 extern BOOLEAN IsUnattendedSetup;
-extern PWCHAR SelectedLanguageId;
 
 typedef struct _IMGINFO
 {




[ros-diffs] [hbelusca] 75720: [SETUPLIB]: Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), D

2017-08-31 Thread hbelusca
Author: hbelusca
Date: Thu Aug 31 18:27:07 2017
New Revision: 75720

URL: http://svn.reactos.org/svn/reactos?rev=75720&view=rev
Log:
[SETUPLIB]: Change some function prototypes so that the usetup-specific 
"SelectedLanguageId" variable is not used in the library. Also, make 
AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef 
PPROCESS_ENTRY_ROUTINE private again.

Modified:
branches/setup_improvements/base/setup/lib/settings.c
branches/setup_improvements/base/setup/lib/settings.h

Modified: branches/setup_improvements/base/setup/lib/settings.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/settings.c?rev=75720&r1=75719&r2=75720&view=diff
==
--- branches/setup_improvements/base/setup/lib/settings.c   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/settings.c   [iso-8859-1] 
Thu Aug 31 18:27:07 2017
@@ -212,8 +212,8 @@
 static
 BOOLEAN
 GetComputerIdentifier(
-PWSTR Identifier,
-ULONG IdentifierLength)
+OUT PWSTR Identifier,
+IN ULONG IdentifierLength)
 {
 OBJECT_ATTRIBUTES ObjectAttributes;
 UNICODE_STRING KeyName;
@@ -314,7 +314,23 @@
 }
 
 
-LONG
+/*
+ * Return values:
+ * 0x00: Failure, stop the enumeration;
+ * 0x01: Add the entry and continue the enumeration;
+ * 0x02: Skip the entry but continue the enumeration.
+ */
+typedef UCHAR
+(NTAPI *PPROCESS_ENTRY_ROUTINE)(
+IN PWCHAR KeyName,
+IN PWCHAR KeyValue,
+IN PCHAR DisplayText,
+IN SIZE_T DisplayTextSize,
+OUT PVOID* UserData,
+OUT PBOOLEAN Current,
+IN PVOID Parameter OPTIONAL);
+
+static LONG
 AddEntriesFromInfSection(
 IN OUT PGENERIC_LIST List,
 IN HINF InfFile,
@@ -384,7 +400,7 @@
 return TotalCount;
 }
 
-UCHAR
+static UCHAR
 NTAPI
 DefaultProcessEntry(
 IN PWCHAR KeyName,
@@ -418,7 +434,7 @@
 
 PGENERIC_LIST
 CreateComputerTypeList(
-HINF InfFile)
+IN HINF InfFile)
 {
 PGENERIC_LIST List;
 INFCONTEXT Context;
@@ -493,8 +509,8 @@
 static
 BOOLEAN
 GetDisplayIdentifier(
-PWSTR Identifier,
-ULONG IdentifierLength)
+OUT PWSTR Identifier,
+IN ULONG IdentifierLength)
 {
 OBJECT_ATTRIBUTES ObjectAttributes;
 UNICODE_STRING KeyName;
@@ -654,7 +670,7 @@
 
 PGENERIC_LIST
 CreateDisplayDriverList(
-HINF InfFile)
+IN HINF InfFile)
 {
 PGENERIC_LIST List;
 INFCONTEXT Context;
@@ -733,9 +749,9 @@
 
 BOOLEAN
 ProcessComputerFiles(
-HINF InfFile,
-PGENERIC_LIST List,
-PWCHAR *AdditionalSectionName)
+IN HINF InfFile,
+IN PGENERIC_LIST List,
+OUT PWSTR* AdditionalSectionName)
 {
 PGENERIC_LIST_ENTRY Entry;
 static WCHAR SectionName[128];
@@ -758,8 +774,8 @@
 
 BOOLEAN
 ProcessDisplayRegistry(
-HINF InfFile,
-PGENERIC_LIST List)
+IN HINF InfFile,
+IN PGENERIC_LIST List)
 {
 NTSTATUS Status;
 PGENERIC_LIST_ENTRY Entry;
@@ -916,7 +932,7 @@
 
 BOOLEAN
 ProcessLocaleRegistry(
-PGENERIC_LIST List)
+IN PGENERIC_LIST List)
 {
 PGENERIC_LIST_ENTRY Entry;
 PWCHAR LanguageId;
@@ -1030,7 +1046,7 @@
 
 PGENERIC_LIST
 CreateKeyboardDriverList(
-HINF InfFile)
+IN HINF InfFile)
 {
 PGENERIC_LIST List;
 INFCONTEXT Context;
@@ -1110,8 +1126,8 @@
 
 PGENERIC_LIST
 CreateLanguageList(
-HINF InfFile,
-WCHAR *DefaultLanguage)
+IN HINF InfFile,
+OUT PWSTR DefaultLanguage)
 {
 PGENERIC_LIST List;
 INFCONTEXT Context;
@@ -1130,7 +1146,6 @@
 return NULL;
 
 wcscpy(DefaultLanguage, KeyValue);
-SelectedLanguageId = KeyValue;
 
 List = CreateGenericList();
 if (List == NULL)
@@ -1161,13 +1176,14 @@
 
 PGENERIC_LIST
 CreateKeyboardLayoutList(
-HINF InfFile,
-WCHAR *DefaultKBLayout)
+IN HINF InfFile,
+IN PCWSTR LanguageId,
+OUT PWCHAR DefaultKBLayout)
 {
 PGENERIC_LIST List;
 INFCONTEXT Context;
 PWCHAR KeyValue;
-const MUI_LAYOUTS * LayoutsList;
+const MUI_LAYOUTS* LayoutsList;
 ULONG uIndex = 0;
 
 /* Get default layout id */
@@ -1183,7 +1199,7 @@
 if (List == NULL)
 return NULL;
 
-LayoutsList = MUIGetLayoutsList();
+LayoutsList = MUIGetLayoutsList(LanguageId);
 
 do
 {
@@ -1218,11 +1234,12 @@
 
 BOOLEAN
 ProcessKeyboardLayoutRegistry(
-PGENERIC_LIST List)
+IN PGENERIC_LIST List,
+IN PCWSTR LanguageId)
 {
 PGENERIC_LIST_ENTRY Entry;
 PWCHAR LayoutId;
-const MUI_LAYOUTS * LayoutsList;
+const MUI_LAYOUTS* LayoutsList;
 MUI_LAYOUTS NewLayoutsList[20];
 ULONG uIndex;
 ULONG uOldPos = 0;
@@ -1235,39 +1252,37 @@
 if (LayoutId == NULL)
 return FALSE;
 
-LayoutsList = MUIGetLayoutsList();
-
-if (_wcsicmp(LayoutsList[0].LayoutID, LayoutId) != 0)
-{
-for (uIndex = 1; LayoutsList[uIndex].LangID != NULL; uIndex++)
-{
-if (_wcsicmp(LayoutsList[uIndex].LayoutID, LayoutId) == 0)
-

[ros-diffs] [hbelusca] 75719: [SETUPLIB]: Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library.

2017-08-31 Thread hbelusca
Author: hbelusca
Date: Thu Aug 31 18:25:38 2017
New Revision: 75719

URL: http://svn.reactos.org/svn/reactos?rev=75719&view=rev
Log:
[SETUPLIB]: Change some string pointer types & function prototypes so that the 
usetup-specific "SelectedLanguageId" variable is not used in the library.

Modified:
branches/setup_improvements/base/setup/lib/mui.c
branches/setup_improvements/base/setup/lib/mui.h

Modified: branches/setup_improvements/base/setup/lib/mui.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/mui.c?rev=75719&r1=75718&r2=75719&view=diff
==
--- branches/setup_improvements/base/setup/lib/mui.c[iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/lib/mui.c[iso-8859-1] Thu Aug 31 
18:25:38 2017
@@ -40,72 +40,78 @@
 
 static
 ULONG
-FindLanguageIndex(VOID)
+FindLanguageIndex(
+IN PCWSTR LanguageId)
 {
 ULONG lngIndex = 0;
 
-if (SelectedLanguageId == NULL)
-{
-/* default to english */
-return 0;
-}
-
-do
-{
-if (_wcsicmp(LanguageList[lngIndex].LanguageID, SelectedLanguageId) == 
0)
+if (LanguageId == NULL)
+{
+/* Default to en-US */
+// return 0;   // FIXME!!
+LanguageId = L"0409";
+}
+
+while (LanguageList[lngIndex].LanguageID != NULL)
+{
+if (_wcsicmp(LanguageList[lngIndex].LanguageID, LanguageId) == 0)
 {
 return lngIndex;
 }
 
 lngIndex++;
-} while (LanguageList[lngIndex].LanguageID != NULL);
+}
 
 return 0;
 }
 
 BOOLEAN
 IsLanguageAvailable(
-PWCHAR LanguageId)
+IN PCWSTR LanguageId)
 {
 ULONG lngIndex = 0;
 
-do
+while (LanguageList[lngIndex].LanguageID != NULL)
 {
 if (_wcsicmp(LanguageList[lngIndex].LanguageID, LanguageId) == 0)
 return TRUE;
 
 lngIndex++;
-} while (LanguageList[lngIndex].LanguageID != NULL);
+}
 
 return FALSE;
 }
 
 
 PCWSTR
-MUIDefaultKeyboardLayout(VOID)
-{
-ULONG lngIndex = max(FindLanguageIndex(), 0);
+MUIDefaultKeyboardLayout(
+IN PCWSTR LanguageId)
+{
+ULONG lngIndex = max(FindLanguageIndex(LanguageId), 0);
 return LanguageList[lngIndex].MuiLayouts[0].LayoutID;
 }
 
-PWCHAR
-MUIGetOEMCodePage(VOID)
-{
-ULONG lngIndex = max(FindLanguageIndex(), 0);
+PCWSTR
+MUIGetOEMCodePage(
+IN PCWSTR LanguageId)
+{
+ULONG lngIndex = max(FindLanguageIndex(LanguageId), 0);
 return LanguageList[lngIndex].OEMCPage;
 }
 
-PWCHAR
-MUIGetGeoID(VOID)
-{
-ULONG lngIndex = max(FindLanguageIndex(), 0);
+PCWSTR
+MUIGetGeoID(
+IN PCWSTR LanguageId)
+{
+ULONG lngIndex = max(FindLanguageIndex(LanguageId), 0);
 return LanguageList[lngIndex].GeoID;
 }
 
-const MUI_LAYOUTS *
-MUIGetLayoutsList(VOID)
-{
-ULONG lngIndex = max(FindLanguageIndex(), 0);
+const MUI_LAYOUTS*
+MUIGetLayoutsList(
+IN PCWSTR LanguageId)
+{
+ULONG lngIndex = max(FindLanguageIndex(LanguageId), 0);
 return LanguageList[lngIndex].MuiLayouts;
 }
 
@@ -139,8 +145,7 @@
   NULL,
   REG_OPTION_NON_VOLATILE,
   &Disposition);
-
-if(!NT_SUCCESS(Status))
+if (!NT_SUCCESS(Status))
 {
 DPRINT1("NtCreateKey() failed (Status %lx)\n", Status);
 return FALSE;
@@ -230,14 +235,13 @@
   NULL,
   REG_OPTION_NON_VOLATILE,
   &Disposition);
-
-if(NT_SUCCESS(Status))
-NtClose(KeyHandle);
-else
+if (!NT_SUCCESS(Status))
 {
 DPRINT1("NtCreateKey() failed (Status %lx)\n", Status);
 return FALSE;
 }
+
+NtClose(KeyHandle);
 
 KeyName.MaximumLength = sizeof(szKeyName);
 Status = RtlAppendUnicodeToString(&KeyName, L"\\Preload");
@@ -262,7 +266,6 @@
  NULL,
  REG_OPTION_NON_VOLATILE,
  &Disposition);
-
 if (!NT_SUCCESS(Status))
 {
 DPRINT1("NtCreateKey() failed (Status %lx)\n", Status);
@@ -283,8 +286,7 @@
   NULL,
   REG_OPTION_NON_VOLATILE,
   &Disposition);
-
-if(!NT_SUCCESS(Status))
+if (!NT_SUCCESS(Status))
 {
 DPRINT1("NtCreateKey() failed (Status %lx)\n", Status);
 NtClose(SubKeyHandle);
@@ -292,7 +294,7 @@
 return FALSE;
 }
 
-do
+while (MuiLayouts[uIndex].LangID != NULL)
 {
 if (uIndex > 19) break;
 
@@ -355,7 +357,6 @@
 
 uIndex++;
 }
-while (MuiLayouts[uIndex].LangID != NULL);
 
 if (uIndex > 1)
 AddHotkeySettings(L"2", L"2", L"1");
@@ -368,20 +369,20 @@
 }
 
 BOOLEAN
-AddKeyboardLayouts(VOID)
+AddKeyboardLayouts(
+IN 

[ros-diffs] [hbelusca] 75717: [SETUPLIB][USETUP]: Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. -

2017-08-30 Thread hbelusca
Author: hbelusca
Date: Wed Aug 30 19:00:17 2017
New Revision: 75717

URL: http://svn.reactos.org/svn/reactos?rev=75717&view=rev
Log:
[SETUPLIB][USETUP]: Adjust MUI and settings code.
- Re-enable settings code concerning language, keyboards & layout in the 
setuplib, and remove the old code in usetup.
- Remove useless code in setuplib's mui.c
- Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid 
colliding with the "LanguageList" of setuplib.
- Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot 
previously, that caused the "LanguageList" of setuplib to be empty!

The code compiles and works during my tests.

Removed:
branches/setup_improvements/base/setup/usetup/settings.c
branches/setup_improvements/base/setup/usetup/settings.h
Modified:
branches/setup_improvements/base/setup/lib/CMakeLists.txt
branches/setup_improvements/base/setup/lib/mui.c
branches/setup_improvements/base/setup/lib/mui.h
branches/setup_improvements/base/setup/lib/muilanguages.h
branches/setup_improvements/base/setup/lib/settings.c
branches/setup_improvements/base/setup/lib/settings.h
branches/setup_improvements/base/setup/lib/setuplib.h
branches/setup_improvements/base/setup/usetup/CMakeLists.txt
branches/setup_improvements/base/setup/usetup/mui.c
branches/setup_improvements/base/setup/usetup/muilanguages.h
branches/setup_improvements/base/setup/usetup/usetup.c

Modified: branches/setup_improvements/base/setup/lib/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/CMakeLists.txt?rev=75717&r1=75716&r2=75717&view=diff
==
--- branches/setup_improvements/base/setup/lib/CMakeLists.txt   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/CMakeLists.txt   [iso-8859-1] 
Wed Aug 30 19:00:17 2017
@@ -1,3 +1,5 @@
+
+add_definitions(${I18N_DEFS})
 
 include_directories(utils)
 

Modified: branches/setup_improvements/base/setup/lib/mui.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/mui.c?rev=75717&r1=75716&r2=75717&view=diff
==
--- branches/setup_improvements/base/setup/lib/mui.c[iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/lib/mui.c[iso-8859-1] Wed Aug 30 
19:00:17 2017
@@ -38,13 +38,6 @@
 
 /* FUNCTIONS /
 
-extern
-VOID
-PopupError(IN PCCH Text,
-   IN PCCH Status,
-   IN PINPUT_RECORD Ir,
-   IN ULONG WaitEvent);
-
 static
 ULONG
 FindLanguageIndex(VOID)
@@ -59,17 +52,16 @@
 
 do
 {
-if (_wcsicmp(LanguageList[lngIndex].LanguageID , SelectedLanguageId) 
== 0)
+if (_wcsicmp(LanguageList[lngIndex].LanguageID, SelectedLanguageId) == 
0)
 {
 return lngIndex;
 }
 
 lngIndex++;
-} while (LanguageList[lngIndex].MuiPages != NULL);
+} while (LanguageList[lngIndex].LanguageID != NULL);
 
 return 0;
 }
-
 
 BOOLEAN
 IsLanguageAvailable(
@@ -79,65 +71,29 @@
 
 do
 {
-if (_wcsicmp(LanguageList[lngIndex].LanguageID , LanguageId) == 0)
+if (_wcsicmp(LanguageList[lngIndex].LanguageID, LanguageId) == 0)
 return TRUE;
 
 lngIndex++;
-} while (LanguageList[lngIndex].MuiPages != NULL);
+} while (LanguageList[lngIndex].LanguageID != NULL);
 
 return FALSE;
 }
 
 
-static
-const MUI_ENTRY *
-FindMUIEntriesOfPage(
-IN ULONG PageNumber)
-{
-ULONG muiIndex = 0;
-ULONG lngIndex;
-const MUI_PAGE * Pages = NULL;
-
-lngIndex = max(FindLanguageIndex(), 0);
-Pages = LanguageList[lngIndex].MuiPages;
-
-do
-{
- if (Pages[muiIndex].Number == PageNumber)
- return Pages[muiIndex].MuiEntry;
-
- muiIndex++;
-} while (Pages[muiIndex].MuiEntry != NULL);
-
-return NULL;
-}
-
-
-static
-const MUI_ERROR *
-FindMUIErrorEntries(VOID)
-{
-ULONG lngIndex = max(FindLanguageIndex(), 0);
-return LanguageList[lngIndex].MuiErrors;
-}
-
-
-static
-const MUI_STRING *
-FindMUIStringEntries(VOID)
-{
-ULONG lngIndex = max(FindLanguageIndex(), 0);
-return LanguageList[lngIndex].MuiStrings;
-}
-
-
-LPCWSTR
+PCWSTR
 MUIDefaultKeyboardLayout(VOID)
 {
 ULONG lngIndex = max(FindLanguageIndex(), 0);
 return LanguageList[lngIndex].MuiLayouts[0].LayoutID;
 }
 
+PWCHAR
+MUIGetOEMCodePage(VOID)
+{
+ULONG lngIndex = max(FindLanguageIndex(), 0);
+return LanguageList[lngIndex].OEMCPage;
+}
 
 PWCHAR
 MUIGetGeoID(VOID)
@@ -146,7 +102,6 @@
 return LanguageList[lngIndex].GeoID;
 }
 
-
 const MUI_LAYOUTS *
 MUIGetLayoutsList(VOID)
 {
@@ -155,146 +110,12 @@
 }
 
 
-VOID
-MUIClearPage(
-IN ULONG page)
-{
-const M

[ros-diffs] [hbelusca] 75716: [SETUPLIB]: Add the necessary headers to mui.c to be able to compile. [USETUP]: Comment out the languages that don't have any resources.

2017-08-30 Thread hbelusca
Author: hbelusca
Date: Wed Aug 30 13:41:52 2017
New Revision: 75716

URL: http://svn.reactos.org/svn/reactos?rev=75716&view=rev
Log:
[SETUPLIB]: Add the necessary headers to mui.c to be able to compile.
[USETUP]: Comment out the languages that don't have any resources.

Modified:
branches/setup_improvements/base/setup/lib/mui.c
branches/setup_improvements/base/setup/usetup/muilanguages.h

Modified: branches/setup_improvements/base/setup/lib/mui.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/mui.c?rev=75716&r1=75715&r2=75716&view=diff
==
--- branches/setup_improvements/base/setup/lib/mui.c[iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/lib/mui.c[iso-8859-1] Wed Aug 30 
13:41:52 2017
@@ -24,12 +24,19 @@
  * PROGRAMMER:
  */
 
-#include "usetup.h"
+/* INCLUDES */
+
+#include "precomp.h"
+#include "mui.h"
 #include "muifonts.h"
 #include "muilanguages.h"
+#include "registry.h"
 
 #define NDEBUG
 #include 
+
+
+/* FUNCTIONS /
 
 extern
 VOID

Modified: branches/setup_improvements/base/setup/usetup/muilanguages.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/muilanguages.h?rev=75716&r1=75715&r2=75716&view=diff
==
--- branches/setup_improvements/base/setup/usetup/muilanguages.h
[iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/muilanguages.h
[iso-8859-1] Wed Aug 30 13:41:52 2017
@@ -2,414 +2,414 @@
 
 #include 
 
-#ifdef LANGUAGE_AF_ZA
-#include "lang/af-ZA.h"
-#endif
-#ifdef LANGUAGE_AR_AE
-#include "lang/ar-AE.h"
-#endif
-#ifdef LANGUAGE_AR_BH
-#include "lang/ar-BH.h"
-#endif
-#ifdef LANGUAGE_AR_DZ
-#include "lang/ar-DZ.h"
-#endif
-#ifdef LANGUAGE_AR_EG
-#include "lang/ar-EG.h"
-#endif
-#ifdef LANGUAGE_AR_IQ
-#include "lang/ar-IQ.h"
-#endif
-#ifdef LANGUAGE_AR_JO
-#include "lang/ar-JO.h"
-#endif
-#ifdef LANGUAGE_AR_KW
-#include "lang/ar-KW.h"
-#endif
-#ifdef LANGUAGE_AR_LB
-#include "lang/ar-LB.h"
-#endif
-#ifdef LANGUAGE_AR_LY
-#include "lang/ar-LY.h"
-#endif
-#ifdef LANGUAGE_AR_MA
-#include "lang/ar-MA.h"
-#endif
-#ifdef LANGUAGE_AR_OM
-#include "lang/ar-OM.h"
-#endif
-#ifdef LANGUAGE_AR_QA
-#include "lang/ar-QA.h"
-#endif
-#ifdef LANGUAGE_AR_SA
-#include "lang/ar-SA.h"
-#endif
-#ifdef LANGUAGE_AR_SY
-#include "lang/ar-SY.h"
-#endif
-#ifdef LANGUAGE_AR_TN
-#include "lang/ar-TN.h"
-#endif
-#ifdef LANGUAGE_AR_YE
-#include "lang/ar-YE.h"
-#endif
-#ifdef LANGUAGE_AZ_AZ
-#include "lang/az-AZ.h"
-#endif
-#ifdef LANGUAGE_BE_BY
-#include "lang/be-BY.h"
-#endif
+// #ifdef LANGUAGE_AF_ZA
+// #include "lang/af-ZA.h"
+// #endif
+// #ifdef LANGUAGE_AR_AE
+// #include "lang/ar-AE.h"
+// #endif
+// #ifdef LANGUAGE_AR_BH
+// #include "lang/ar-BH.h"
+// #endif
+// #ifdef LANGUAGE_AR_DZ
+// #include "lang/ar-DZ.h"
+// #endif
+// #ifdef LANGUAGE_AR_EG
+// #include "lang/ar-EG.h"
+// #endif
+// #ifdef LANGUAGE_AR_IQ
+// #include "lang/ar-IQ.h"
+// #endif
+// #ifdef LANGUAGE_AR_JO
+// #include "lang/ar-JO.h"
+// #endif
+// #ifdef LANGUAGE_AR_KW
+// #include "lang/ar-KW.h"
+// #endif
+// #ifdef LANGUAGE_AR_LB
+// #include "lang/ar-LB.h"
+// #endif
+// #ifdef LANGUAGE_AR_LY
+// #include "lang/ar-LY.h"
+// #endif
+// #ifdef LANGUAGE_AR_MA
+// #include "lang/ar-MA.h"
+// #endif
+// #ifdef LANGUAGE_AR_OM
+// #include "lang/ar-OM.h"
+// #endif
+// #ifdef LANGUAGE_AR_QA
+// #include "lang/ar-QA.h"
+// #endif
+// #ifdef LANGUAGE_AR_SA
+// #include "lang/ar-SA.h"
+// #endif
+// #ifdef LANGUAGE_AR_SY
+// #include "lang/ar-SY.h"
+// #endif
+// #ifdef LANGUAGE_AR_TN
+// #include "lang/ar-TN.h"
+// #endif
+// #ifdef LANGUAGE_AR_YE
+// #include "lang/ar-YE.h"
+// #endif
+// #ifdef LANGUAGE_AZ_AZ
+// #include "lang/az-AZ.h"
+// #endif
+// #ifdef LANGUAGE_BE_BY
+// #include "lang/be-BY.h"
+// #endif
 #ifdef LANGUAGE_BG_BG
 #include "lang/bg-BG.h"
 #endif
 #ifdef LANGUAGE_BN_BD
 #include "lang/bn-BD.h"
 #endif
-#ifdef LANGUAGE_BN_IN
-#include "lang/bn-IN.h"
-#endif
-#ifdef LANGUAGE_CA_ES
-#include "lang/ca-ES.h"
-#endif
+// #ifdef LANGUAGE_BN_IN

[ros-diffs] [hbelusca] 75715: [SETUPLIB][USETUP]: Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib).

2017-08-30 Thread hbelusca
Author: hbelusca
Date: Wed Aug 30 13:30:29 2017
New Revision: 75715

URL: http://svn.reactos.org/svn/reactos?rev=75715&view=rev
Log:
[SETUPLIB][USETUP]: Start massaging the MUI files and split up what concerns 
only the usetup "resources", and what concerns general language parameters (in 
the setuplib). May be interesting to retrieve that from INF file (e.g. 
intl.inf) (suggested by Giannis).

Added:
branches/setup_improvements/base/setup/lib/lang/
  - copied from r75714, branches/setup_improvements/base/setup/usetup/lang/
Removed:
branches/setup_improvements/base/setup/usetup/lang/af-ZA.h
branches/setup_improvements/base/setup/usetup/lang/ar-AE.h
branches/setup_improvements/base/setup/usetup/lang/ar-BH.h
branches/setup_improvements/base/setup/usetup/lang/ar-DZ.h
branches/setup_improvements/base/setup/usetup/lang/ar-EG.h
branches/setup_improvements/base/setup/usetup/lang/ar-IQ.h
branches/setup_improvements/base/setup/usetup/lang/ar-JO.h
branches/setup_improvements/base/setup/usetup/lang/ar-KW.h
branches/setup_improvements/base/setup/usetup/lang/ar-LB.h
branches/setup_improvements/base/setup/usetup/lang/ar-LY.h
branches/setup_improvements/base/setup/usetup/lang/ar-MA.h
branches/setup_improvements/base/setup/usetup/lang/ar-OM.h
branches/setup_improvements/base/setup/usetup/lang/ar-QA.h
branches/setup_improvements/base/setup/usetup/lang/ar-SA.h
branches/setup_improvements/base/setup/usetup/lang/ar-SY.h
branches/setup_improvements/base/setup/usetup/lang/ar-TN.h
branches/setup_improvements/base/setup/usetup/lang/ar-YE.h
branches/setup_improvements/base/setup/usetup/lang/az-AZ.h
branches/setup_improvements/base/setup/usetup/lang/be-BY.h
branches/setup_improvements/base/setup/usetup/lang/bn-IN.h
branches/setup_improvements/base/setup/usetup/lang/ca-ES.h
branches/setup_improvements/base/setup/usetup/lang/de-AT.h
branches/setup_improvements/base/setup/usetup/lang/de-CH.h
branches/setup_improvements/base/setup/usetup/lang/de-LI.h
branches/setup_improvements/base/setup/usetup/lang/de-LU.h
branches/setup_improvements/base/setup/usetup/lang/dv-MV.h
branches/setup_improvements/base/setup/usetup/lang/en-AU.h
branches/setup_improvements/base/setup/usetup/lang/en-BZ.h
branches/setup_improvements/base/setup/usetup/lang/en-CA.h
branches/setup_improvements/base/setup/usetup/lang/en-CB.h
branches/setup_improvements/base/setup/usetup/lang/en-GB.h
branches/setup_improvements/base/setup/usetup/lang/en-IE.h
branches/setup_improvements/base/setup/usetup/lang/en-JM.h
branches/setup_improvements/base/setup/usetup/lang/en-NZ.h
branches/setup_improvements/base/setup/usetup/lang/en-PH.h
branches/setup_improvements/base/setup/usetup/lang/en-TT.h
branches/setup_improvements/base/setup/usetup/lang/en-ZA.h
branches/setup_improvements/base/setup/usetup/lang/en-ZW.h
branches/setup_improvements/base/setup/usetup/lang/eo-AA.h
branches/setup_improvements/base/setup/usetup/lang/es-AR.h
branches/setup_improvements/base/setup/usetup/lang/es-BO.h
branches/setup_improvements/base/setup/usetup/lang/es-CL.h
branches/setup_improvements/base/setup/usetup/lang/es-CO.h
branches/setup_improvements/base/setup/usetup/lang/es-CR.h
branches/setup_improvements/base/setup/usetup/lang/es-DO.h
branches/setup_improvements/base/setup/usetup/lang/es-EC.h
branches/setup_improvements/base/setup/usetup/lang/es-GT.h
branches/setup_improvements/base/setup/usetup/lang/es-HN.h
branches/setup_improvements/base/setup/usetup/lang/es-MX.h
branches/setup_improvements/base/setup/usetup/lang/es-NI.h
branches/setup_improvements/base/setup/usetup/lang/es-PA.h
branches/setup_improvements/base/setup/usetup/lang/es-PE.h
branches/setup_improvements/base/setup/usetup/lang/es-PR.h
branches/setup_improvements/base/setup/usetup/lang/es-PY.h
branches/setup_improvements/base/setup/usetup/lang/es-SV.h
branches/setup_improvements/base/setup/usetup/lang/es-UY.h
branches/setup_improvements/base/setup/usetup/lang/es-VE.h
branches/setup_improvements/base/setup/usetup/lang/eu-ES.h
branches/setup_improvements/base/setup/usetup/lang/fa-IR.h
branches/setup_improvements/base/setup/usetup/lang/fi-FI.h
branches/setup_improvements/base/setup/usetup/lang/fo-FO.h
branches/setup_improvements/base/setup/usetup/lang/fr-BE.h
branches/setup_improvements/base/setup/usetup/lang/fr-CA.h
branches/setup_improvements/base/setup/usetup/lang/fr-CH.h
branches/setup_improvements/base/setup/usetup/lang/fr-LU.h
branches/setup_improvements/base/setup/usetup/lang/fr-MC.h
branches/setup_improvements/base/setup/usetup/lang/gl-ES.h
branches/setup_improvements/base/setup/usetup/lang/gu-IN.h
branches/setup_improvements/base/setup/usetup/lang/hi-IN.h
branches/setup_improvements/base/setup/usetup/lang/hr-HR.h
branches/setup_imp

[ros-diffs] [hbelusca] 75711: [SETUPLIB]: Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build.

2017-08-30 Thread hbelusca
Author: hbelusca
Date: Wed Aug 30 11:28:52 2017
New Revision: 75711

URL: http://svn.reactos.org/svn/reactos?rev=75711&view=rev
Log:
[SETUPLIB]: Copy the mui* files from usetup into the setuplib for later usage, 
and add mui.c to build.

Added:
branches/setup_improvements/base/setup/lib/mui.c
  - copied unchanged from r75710, 
branches/setup_improvements/base/setup/usetup/mui.c
branches/setup_improvements/base/setup/lib/mui.h
  - copied unchanged from r75710, 
branches/setup_improvements/base/setup/usetup/mui.h
branches/setup_improvements/base/setup/lib/muifonts.h
  - copied unchanged from r75710, 
branches/setup_improvements/base/setup/usetup/muifonts.h
branches/setup_improvements/base/setup/lib/muilanguages.h
  - copied unchanged from r75710, 
branches/setup_improvements/base/setup/usetup/muilanguages.h
Modified:
branches/setup_improvements/base/setup/lib/CMakeLists.txt

Modified: branches/setup_improvements/base/setup/lib/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/CMakeLists.txt?rev=75711&r1=75710&r2=75711&view=diff
==
--- branches/setup_improvements/base/setup/lib/CMakeLists.txt   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/CMakeLists.txt   [iso-8859-1] 
Wed Aug 30 11:28:52 2017
@@ -14,6 +14,7 @@
 utils/regutil.c
 bootsup.c
 fsutil.c
+mui.c
 registry.c
 settings.c
 setuplib.c




[ros-diffs] [hbelusca] 75705: [CMD]: Russian translation for the START command, adapted from amber CORE-13248, jperm CORE-13560 and reviewed by Alexander Shaposhnikov (sanchaez). Thank you all :) Adde

2017-08-28 Thread hbelusca
Author: hbelusca
Date: Mon Aug 28 20:31:34 2017
New Revision: 75705

URL: http://svn.reactos.org/svn/reactos?rev=75705&view=rev
Log:
[CMD]: Russian translation for the START command, adapted from amber 
CORE-13248, jperm CORE-13560 and reviewed by Alexander Shaposhnikov (sanchaez). 
Thank you all :)
Addendum to r75369.

Modified:
trunk/reactos/base/shell/cmd/lang/ru-RU.rc

Modified: trunk/reactos/base/shell/cmd/lang/ru-RU.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/ru-RU.rc?rev=75705&r1=75704&r2=75705&view=diff
==
--- trunk/reactos/base/shell/cmd/lang/ru-RU.rc  [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/ru-RU.rc  [iso-8859-1] Mon Aug 28 
20:31:34 2017
@@ -385,18 +385,18 @@
   значениеСтрока символов, 
присваиваемая указанной переменной.\n\n\
 SET без параметров выводит текущие значения 
переменных среды.\n"
 STRING_START_HELP1 "Запуск указанной программы 
или команды.\n\n\
-START [""title""] [/D path] [/I] [/B] [/MIN] [/MAX] [/WAIT]\n\
-  [command/program] [parameters]\n\n\
-  ""title"" Title of the window.\n\
-  pathSpecifies the startup directory.\n\
-  I   Uses the original environment given to cmd.exe,\n\
-  instead of the current environment.\n\
-  B   Starts the command or program without creating any window.\n\
-  MIN Starts with a minimized window.\n\
-  MAX Starts with a maximized window.\n\
-  WAITStarts the command or program and waits for its termination.\n\
-  команда Команда или программа для 
запуска.\n\
-  parameters  Specifies the parameters to be given to the command or 
program.\n"
+START [""заголовок""] [/D путь] [/I] [/B] [/MIN] [/MAX] [/WAIT]\n\
+  [команда/программа] [параметры]\n\n\
+  ""заголовок""   Заголовок окна.\n\
+  путь  Каталог запуска.\n\
+  I Новой средой станет исходная 
среда, переданная cmd.exe\n\
+вместо текущей среды.\n\
+  B Запустить команду или программу 
без создания нового окна.\n\
+  MIN   Запустить в свернутом окне.\n\
+  MAX   Запустить в развернутом окне.\n\
+  WAIT  Запустить команду или программу и 
ждать завершения.\n\
+  команда   Команда или программа для 
запуска.\n\
+  параметры Параметры, передаваемые 
команде или программе.\n"
 STRING_TITLE_HELP "Изменение заголовка окна 
командной строки.\n\n\
 TITLE [строка]\n\n\
 строка   Будущий заголовок окна 
командной строки.\n"




[ros-diffs] [hbelusca] 75703: Sync with trunk r75702.

2017-08-28 Thread hbelusca
Author: hbelusca
Date: Mon Aug 28 18:35:55 2017
New Revision: 75703

URL: http://svn.reactos.org/svn/reactos?rev=75703&view=rev
Log:
Sync with trunk r75702.

Added:
branches/setup_improvements/dll/win32/browseui/res/214.bmp
  - copied unchanged from r75702, 
trunk/reactos/dll/win32/browseui/res/214.bmp
branches/setup_improvements/dll/win32/browseui/res/215.bmp
  - copied unchanged from r75702, 
trunk/reactos/dll/win32/browseui/res/215.bmp
branches/setup_improvements/dll/win32/browseui/res/216.bmp
  - copied unchanged from r75702, 
trunk/reactos/dll/win32/browseui/res/216.bmp
branches/setup_improvements/dll/win32/browseui/res/217.bmp
  - copied unchanged from r75702, 
trunk/reactos/dll/win32/browseui/res/217.bmp
branches/setup_improvements/dll/win32/browseui/res/230.bmp
  - copied unchanged from r75702, 
trunk/reactos/dll/win32/browseui/res/230.bmp
branches/setup_improvements/dll/win32/browseui/res/231.bmp
  - copied unchanged from r75702, 
trunk/reactos/dll/win32/browseui/res/231.bmp
branches/setup_improvements/dll/win32/browseui/res/240.bmp
  - copied unchanged from r75702, 
trunk/reactos/dll/win32/browseui/res/240.bmp
branches/setup_improvements/dll/win32/browseui/res/241.bmp
  - copied unchanged from r75702, 
trunk/reactos/dll/win32/browseui/res/241.bmp
branches/setup_improvements/dll/win32/browseui/res/242.bmp
  - copied unchanged from r75702, 
trunk/reactos/dll/win32/browseui/res/242.bmp
branches/setup_improvements/dll/win32/browseui/res/245.bmp
  - copied unchanged from r75702, 
trunk/reactos/dll/win32/browseui/res/245.bmp
branches/setup_improvements/dll/win32/browseui/res/246.bmp
  - copied unchanged from r75702, 
trunk/reactos/dll/win32/browseui/res/246.bmp
branches/setup_improvements/dll/win32/browseui/res/247.bmp
  - copied unchanged from r75702, 
trunk/reactos/dll/win32/browseui/res/247.bmp
branches/setup_improvements/media/rapps/utorrent.txt   (props changed)
  - copied unchanged from r75702, trunk/reactos/media/rapps/utorrent.txt
Removed:
branches/setup_improvements/dll/win32/shell32/res/bitmaps/214.bmp
branches/setup_improvements/dll/win32/shell32/res/bitmaps/215.bmp
branches/setup_improvements/dll/win32/shell32/res/bitmaps/216.bmp
branches/setup_improvements/dll/win32/shell32/res/bitmaps/217.bmp
branches/setup_improvements/dll/win32/shell32/res/bitmaps/230.bmp
branches/setup_improvements/dll/win32/shell32/res/bitmaps/231.bmp
branches/setup_improvements/dll/win32/shell32/res/bitmaps/240.bmp
branches/setup_improvements/dll/win32/shell32/res/bitmaps/241.bmp
branches/setup_improvements/dll/win32/shell32/res/bitmaps/242.bmp
branches/setup_improvements/dll/win32/shell32/res/bitmaps/245.bmp
branches/setup_improvements/dll/win32/shell32/res/bitmaps/246.bmp
branches/setup_improvements/dll/win32/shell32/res/bitmaps/247.bmp
Modified:
branches/setup_improvements/   (props changed)
branches/setup_improvements/boot/bootdata/bootcd/unattend.inf
branches/setup_improvements/boot/bootdata/bootcdregtest/unattend.inf
branches/setup_improvements/dll/win32/browseui/addressband.cpp
branches/setup_improvements/dll/win32/browseui/addresseditbox.cpp
branches/setup_improvements/dll/win32/browseui/addresseditbox.h
branches/setup_improvements/dll/win32/browseui/brandband.cpp
branches/setup_improvements/dll/win32/browseui/browseui.rc
branches/setup_improvements/dll/win32/browseui/explorerband.cpp
branches/setup_improvements/dll/win32/browseui/resource.h
branches/setup_improvements/dll/win32/browseui/toolsband.cpp
branches/setup_improvements/dll/win32/shell32/CIDLDataObj.cpp
branches/setup_improvements/dll/win32/shell32/bitmap_res.rc
branches/setup_improvements/dll/win32/shell32/folders/CRecycleBin.cpp
branches/setup_improvements/dll/win32/shell32/shresdef.h
branches/setup_improvements/dll/win32/userenv/lang/uk-UA.rc
branches/setup_improvements/dll/win32/uxtheme/msstyles.c
branches/setup_improvements/dll/win32/uxtheme/nonclient.c
branches/setup_improvements/win32ss/gdi/gdi32/wine/enhmetafile.c
branches/setup_improvements/win32ss/user/ntuser/msgqueue.c
branches/setup_improvements/win32ss/user/user32/windows/defwnd.c

Propchange: branches/setup_improvements/
--
--- svn:mergeinfo   (original)
+++ svn:mergeinfo   Mon Aug 28 18:35:55 2017
@@ -23,4 +23,4 @@
 
/branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859
 /branches/usb-bringup-trunk:55019-55543,55548-4,6-55567
 /branches/wlan-bringup:54809-54998
-/trunk/reactos:74526-75648
+/trunk/reactos:74526-75702

Modi

[ros-diffs] [hbelusca] 75701: [SETUPLIB][USETUP]: Move the settings code from usetup to setuplib (since it'll be needed for 1st-stage GUI installer as well...), apart from the code dealing with keyboa

2017-08-28 Thread hbelusca
Author: hbelusca
Date: Mon Aug 28 14:46:49 2017
New Revision: 75701

URL: http://svn.reactos.org/svn/reactos?rev=75701&view=rev
Log:
[SETUPLIB][USETUP]: Move the settings code from usetup to setuplib (since it'll 
be needed for 1st-stage GUI installer as well...), apart from the code dealing 
with keyboard layouts, since the latter uses MUI* functions from usetup.
I'll try to think how to include that in setuplib...

Added:
branches/setup_improvements/base/setup/lib/settings.c
  - copied, changed from r75700, 
branches/setup_improvements/base/setup/usetup/settings.c
branches/setup_improvements/base/setup/lib/settings.h
  - copied, changed from r75700, 
branches/setup_improvements/base/setup/usetup/settings.h
Modified:
branches/setup_improvements/base/setup/lib/CMakeLists.txt
branches/setup_improvements/base/setup/lib/setuplib.h
branches/setup_improvements/base/setup/usetup/settings.c
branches/setup_improvements/base/setup/usetup/settings.h

Modified: branches/setup_improvements/base/setup/lib/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/CMakeLists.txt?rev=75701&r1=75700&r2=75701&view=diff
==
--- branches/setup_improvements/base/setup/lib/CMakeLists.txt   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/CMakeLists.txt   [iso-8859-1] 
Mon Aug 28 14:46:49 2017
@@ -15,6 +15,7 @@
 bootsup.c
 fsutil.c
 registry.c
+settings.c
 setuplib.c
 precomp.h)
 

Copied: branches/setup_improvements/base/setup/lib/settings.c (from r75700, 
branches/setup_improvements/base/setup/usetup/settings.c)
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/settings.c?p2=branches/setup_improvements/base/setup/lib/settings.c&p1=branches/setup_improvements/base/setup/usetup/settings.c&r1=75700&r2=75701&rev=75701&view=diff
==
--- branches/setup_improvements/base/setup/usetup/settings.c[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/settings.c   [iso-8859-1] 
Mon Aug 28 14:46:49 2017
@@ -26,14 +26,21 @@
 
 /* INCLUDES */
 
-#include "usetup.h"
+#include "precomp.h"
+#include "genlist.h"
+#include "infsupp.h"
+#include "registry.h"
+
+#include "settings.h"
 
 #define NDEBUG
 #include 
 
 /* GLOBALS **/
 
+#if 0 // FIXME: Disabled for now because it uses MUI* functions from usetup
 ULONG DefaultLanguageIndex = 0;
+#endif
 
 /* FUNCTIONS /
 
@@ -308,22 +315,6 @@
 }
 
 
-/*
- * Return values:
- * 0x00: Failure, stop the enumeration;
- * 0x01: Add the entry and continue the enumeration;
- * 0x02: Skip the entry but continue the enumeration.
- */
-typedef UCHAR
-(NTAPI *PPROCESS_ENTRY_ROUTINE)(
-IN PWCHAR KeyName,
-IN PWCHAR KeyValue,
-IN PCHAR DisplayText,
-IN SIZE_T DisplayTextSize,
-OUT PVOID* UserData,
-OUT PBOOLEAN Current,
-IN PVOID Parameter OPTIONAL);
-
 LONG
 AddEntriesFromInfSection(
 IN OUT PGENERIC_LIST List,
@@ -394,7 +385,7 @@
 return TotalCount;
 }
 
-static UCHAR
+UCHAR
 NTAPI
 DefaultProcessEntry(
 IN PWCHAR KeyName,
@@ -1063,6 +1054,9 @@
 return List;
 }
 
+
+#if 0 // FIXME: Disabled for now because it uses MUI* functions from usetup
+
 ULONG
 GetDefaultLanguageIndex(VOID)
 {
@@ -1167,6 +1161,7 @@
 return List;
 }
 
+
 PGENERIC_LIST
 CreateKeyboardLayoutList(
 HINF InfFile,
@@ -1271,6 +1266,8 @@
 
 return TRUE;
 }
+
+#endif
 
 #if 0
 BOOLEAN

Copied: branches/setup_improvements/base/setup/lib/settings.h (from r75700, 
branches/setup_improvements/base/setup/usetup/settings.h)
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/settings.h?p2=branches/setup_improvements/base/setup/lib/settings.h&p1=branches/setup_improvements/base/setup/usetup/settings.h&r1=75700&r2=75701&rev=75701&view=diff
==
--- branches/setup_improvements/base/setup/usetup/settings.h[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/settings.h   [iso-8859-1] 
Mon Aug 28 14:46:49 2017
@@ -27,6 +27,43 @@
 
 #pragma once
 
+/*
+ * Return values:
+ * 0x00: Failure, stop the enumeration;
+ * 0x01: Add the entry and continue the enumeration;
+ * 0x02: Skip the entry but continue the enumeration.
+ */
+typedef UCHAR
+(NTAPI *PPROCESS_ENTRY_ROUTINE)(
+IN PWCHAR KeyName,
+IN PWCHAR KeyValue,
+IN PCHAR DisplayText,
+IN SIZE_T DisplayTextSize,
+OUT PVOID* UserData,
+OUT PBOOLEAN Current,
+IN PVOI

[ros-diffs] [hbelusca] 75700: [USETUP]: Add an AddEntriesFromInfSection() helper, inspired by the reactos/reactos.c!LoadGenEntry() function, that enumerates the entries of a given INF section, and add

2017-08-28 Thread hbelusca
Author: hbelusca
Date: Mon Aug 28 14:01:30 2017
New Revision: 75700

URL: http://svn.reactos.org/svn/reactos?rev=75700&view=rev
Log:
[USETUP]: Add an AddEntriesFromInfSection() helper, inspired by the 
reactos/reactos.c!LoadGenEntry() function, that enumerates the entries of a 
given INF section, and adds these into a (user-allocated) GENERIC_LIST after 
some pre-processing.
Use this helper in the different Create*List() functions.

Modified:
branches/setup_improvements/base/setup/usetup/settings.c

Modified: branches/setup_improvements/base/setup/usetup/settings.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/settings.c?rev=75700&r1=75699&r2=75700&view=diff
==
--- branches/setup_improvements/base/setup/usetup/settings.c[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/settings.c[iso-8859-1] 
Mon Aug 28 14:01:30 2017
@@ -308,16 +308,132 @@
 }
 
 
+/*
+ * Return values:
+ * 0x00: Failure, stop the enumeration;
+ * 0x01: Add the entry and continue the enumeration;
+ * 0x02: Skip the entry but continue the enumeration.
+ */
+typedef UCHAR
+(NTAPI *PPROCESS_ENTRY_ROUTINE)(
+IN PWCHAR KeyName,
+IN PWCHAR KeyValue,
+IN PCHAR DisplayText,
+IN SIZE_T DisplayTextSize,
+OUT PVOID* UserData,
+OUT PBOOLEAN Current,
+IN PVOID Parameter OPTIONAL);
+
+LONG
+AddEntriesFromInfSection(
+IN OUT PGENERIC_LIST List,
+IN HINF InfFile,
+IN PCWSTR SectionName,
+IN PINFCONTEXT pContext,
+IN PPROCESS_ENTRY_ROUTINE ProcessEntry,
+IN PVOID Parameter OPTIONAL)
+{
+LONG TotalCount = 0;
+PWCHAR KeyName;
+PWCHAR KeyValue;
+PVOID UserData;
+BOOLEAN Current;
+UCHAR RetVal;
+CHAR DisplayText[128];
+
+if (!SetupFindFirstLineW(InfFile, SectionName, NULL, pContext))
+return -1;
+
+do
+{
+/*
+ * NOTE: Do not use INF_GetData() as it expects INF entries of exactly
+ * two fields ("key = value"); however we expect to be able to deal 
with
+ * entries having more than two fields, the only requirement being that
+ * the second field (field number 1) contains the field description.
+ */
+if (!INF_GetDataField(pContext, 0, &KeyName))
+{
+DPRINT("INF_GetDataField() failed\n");
+return -1;
+}
+
+if (!INF_GetDataField(pContext, 1, &KeyValue))
+{
+DPRINT("INF_GetDataField() failed\n");
+INF_FreeData(KeyName);
+return -1;
+}
+
+UserData = NULL;
+Current  = FALSE;
+RetVal = ProcessEntry(KeyName,
+  KeyValue,
+  DisplayText,
+  sizeof(DisplayText),
+  &UserData,
+  &Current,
+  Parameter);
+INF_FreeData(KeyName);
+INF_FreeData(KeyValue);
+
+if (RetVal == 0)
+{
+DPRINT("ProcessEntry() failed\n");
+return -1;
+}
+else if (RetVal == 1)
+{
+AppendGenericListEntry(List, DisplayText, UserData, Current);
+++TotalCount;
+}
+// else if (RetVal == 2), skip the entry.
+
+} while (SetupFindNextLine(pContext, pContext));
+
+return TotalCount;
+}
+
+static UCHAR
+NTAPI
+DefaultProcessEntry(
+IN PWCHAR KeyName,
+IN PWCHAR KeyValue,
+IN PCHAR DisplayText,
+IN SIZE_T DisplayTextSize,
+OUT PVOID* UserData,
+OUT PBOOLEAN Current,
+IN PVOID Parameter OPTIONAL)
+{
+PWSTR CompareKey = (PWSTR)Parameter;
+
+*UserData = RtlAllocateHeap(ProcessHeap, 0,
+(wcslen(KeyName) + 1) * sizeof(WCHAR));
+if (*UserData == NULL)
+{
+/* Failure, stop enumeration */
+DPRINT1("RtlAllocateHeap() failed\n");
+return 0;
+}
+
+wcscpy((PWCHAR)*UserData, KeyName);
+sprintf(DisplayText, "%S", KeyValue);
+
+*Current = (CompareKey ? !_wcsicmp(KeyName, CompareKey) : FALSE);
+
+/* Add the entry */
+return 1;
+}
+
+
 PGENERIC_LIST
 CreateComputerTypeList(
 HINF InfFile)
 {
-CHAR Buffer[128];
 PGENERIC_LIST List;
 INFCONTEXT Context;
 PWCHAR KeyName;
 PWCHAR KeyValue;
-PWCHAR UserData;
 WCHAR ComputerIdentifier[128];
 WCHAR ComputerKey[32];
 
@@ -370,38 +486,16 @@
 if (List == NULL)
 return NULL;
 
-if (!SetupFindFirstLineW(InfFile, L"Computer", NULL, &Context))
-{
-DestroyGenericList(List, FALSE);
-return NULL;
-}
-
-do
-{
-if (!INF_GetData(&Context, &KeyName, &KeyValue))
-{
-/* FIXME: Handle error! */
-DPRIN

[ros-diffs] [hbelusca] 75699: [USETUP]: Whitespace fixes.

2017-08-28 Thread hbelusca
Author: hbelusca
Date: Mon Aug 28 13:54:53 2017
New Revision: 75699

URL: http://svn.reactos.org/svn/reactos?rev=75699&view=rev
Log:
[USETUP]: Whitespace fixes.

Modified:
branches/setup_improvements/base/setup/usetup/mui.c

Modified: branches/setup_improvements/base/setup/usetup/mui.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/mui.c?rev=75699&r1=75698&r2=75699&view=diff
==
--- branches/setup_improvements/base/setup/usetup/mui.c [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/mui.c [iso-8859-1] Mon Aug 28 
13:54:53 2017
@@ -58,7 +58,7 @@
 }
 
 lngIndex++;
-}while (LanguageList[lngIndex].MuiPages != NULL);
+} while (LanguageList[lngIndex].MuiPages != NULL);
 
 return 0;
 }
@@ -76,7 +76,7 @@
 return TRUE;
 
 lngIndex++;
-}while (LanguageList[lngIndex].MuiPages != NULL);
+} while (LanguageList[lngIndex].MuiPages != NULL);
 
 return FALSE;
 }
@@ -100,7 +100,7 @@
  return Pages[muiIndex].MuiEntry;
 
  muiIndex++;
-}while (Pages[muiIndex].MuiEntry != NULL);
+} while (Pages[muiIndex].MuiEntry != NULL);
 
 return NULL;
 }




[ros-diffs] [hbelusca] 75698: [USETUP]: Simplify code.

2017-08-28 Thread hbelusca
Author: hbelusca
Date: Mon Aug 28 13:51:25 2017
New Revision: 75698

URL: http://svn.reactos.org/svn/reactos?rev=75698&view=rev
Log:
[USETUP]: Simplify code.

Modified:
branches/setup_improvements/base/setup/usetup/settings.c

Modified: branches/setup_improvements/base/setup/usetup/settings.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/settings.c?rev=75698&r1=75697&r2=75698&view=diff
==
--- branches/setup_improvements/base/setup/usetup/settings.c[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/settings.c[iso-8859-1] 
Mon Aug 28 13:51:25 2017
@@ -338,6 +338,8 @@
 
 do
 {
+BOOLEAN FoundId;
+
 if (!INF_GetDataField(&Context, 1, &KeyValue))
 {
 /* FIXME: Handle error! */
@@ -346,21 +348,22 @@
 }
 
 DPRINT("KeyValue: %S\n", KeyValue);
-if (wcsstr(ComputerIdentifier, KeyValue))
-{
-INF_FreeData(KeyValue);
-if (!INF_GetDataField(&Context, 0, &KeyName))
-{
-/* FIXME: Handle error! */
-DPRINT("INF_GetDataField() failed\n");
-return NULL;
-}
-
-DPRINT("Computer key: %S\n", KeyName);
-wcscpy(ComputerKey, KeyName);
-INF_FreeData(KeyName);
-}
+FoundId = !!wcsstr(ComputerIdentifier, KeyValue);
 INF_FreeData(KeyValue);
+
+if (!FoundId)
+continue;
+
+if (!INF_GetDataField(&Context, 0, &KeyName))
+{
+/* FIXME: Handle error! */
+DPRINT("INF_GetDataField() failed\n");
+return NULL;
+}
+
+DPRINT("Computer key: %S\n", KeyName);
+wcscpy(ComputerKey, KeyName);
+INF_FreeData(KeyName);
 } while (SetupFindNextLine(&Context, &Context));
 
 List = CreateGenericList();
@@ -595,6 +598,8 @@
 
 do
 {
+BOOLEAN FoundId;
+
 if (!INF_GetDataField(&Context, 1, &KeyValue))
 {
 /* FIXME: Handle error! */
@@ -603,21 +608,22 @@
 }
 
 DPRINT("KeyValue: %S\n", KeyValue);
-if (wcsstr(DisplayIdentifier, KeyValue))
-{
-INF_FreeData(KeyValue);
-if (!INF_GetDataField(&Context, 0, &KeyName))
-{
-/* FIXME: Handle error! */
-DPRINT("INF_GetDataField() failed\n");
-return NULL;
-}
-
-DPRINT("Display key: %S\n", KeyName);
-wcscpy(DisplayKey, KeyName);
-INF_FreeData(KeyName);
-}
+FoundId = !!wcsstr(DisplayIdentifier, KeyValue);
 INF_FreeData(KeyValue);
+
+if (!FoundId)
+continue;
+
+if (!INF_GetDataField(&Context, 0, &KeyName))
+{
+/* FIXME: Handle error! */
+DPRINT("INF_GetDataField() failed\n");
+return NULL;
+}
+
+DPRINT("Display key: %S\n", KeyName);
+wcscpy(DisplayKey, KeyName);
+INF_FreeData(KeyName);
 } while (SetupFindNextLine(&Context, &Context));
 
 List = CreateGenericList();




[ros-diffs] [hbelusca] 75697: [USETUP]: Formatting fixes only.

2017-08-28 Thread hbelusca
Author: hbelusca
Date: Mon Aug 28 13:50:40 2017
New Revision: 75697

URL: http://svn.reactos.org/svn/reactos?rev=75697&view=rev
Log:
[USETUP]: Formatting fixes only.

Modified:
branches/setup_improvements/base/setup/usetup/settings.c

Modified: branches/setup_improvements/base/setup/usetup/settings.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/settings.c?rev=75697&r1=75696&r2=75697&view=diff
==
--- branches/setup_improvements/base/setup/usetup/settings.c[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/settings.c[iso-8859-1] 
Mon Aug 28 13:50:40 2017
@@ -71,113 +71,136 @@
 goto cleanup;
 }
 
-   pDeviceInformation = RtlAllocateHeap(RtlGetProcessHeap(), 0, 
DeviceInfoLength);
-   if (!pDeviceInformation)
-   {
-  DPRINT("RtlAllocateHeap() failed\n");
-  Status = STATUS_NO_MEMORY;
-  goto cleanup;
-   }
-
-   pValueInformation = RtlAllocateHeap(RtlGetProcessHeap(), 0, 
ValueInfoLength);
-   if (!pValueInformation)
-   {
-  DPRINT("RtlAllocateHeap() failed\n");
-  Status = STATUS_NO_MEMORY;
-  goto cleanup;
-   }
-
-   while (TRUE)
-   {
-  Status = NtEnumerateKey(hDevicesKey, IndexDevice, KeyBasicInformation, 
pDeviceInformation, DeviceInfoLength, &RequiredSize);
-  if (Status == STATUS_NO_MORE_ENTRIES)
- break;
-  else if (Status == STATUS_BUFFER_OVERFLOW || Status == 
STATUS_BUFFER_TOO_SMALL)
-  {
- RtlFreeHeap(RtlGetProcessHeap(), 0, pDeviceInformation);
- DeviceInfoLength = RequiredSize;
- pDeviceInformation = RtlAllocateHeap(RtlGetProcessHeap(), 0, 
DeviceInfoLength);
- if (!pDeviceInformation)
- {
-DPRINT("RtlAllocateHeap() failed\n");
-Status = STATUS_NO_MEMORY;
+pDeviceInformation = RtlAllocateHeap(RtlGetProcessHeap(), 0, 
DeviceInfoLength);
+if (!pDeviceInformation)
+{
+DPRINT("RtlAllocateHeap() failed\n");
+Status = STATUS_NO_MEMORY;
+goto cleanup;
+}
+
+pValueInformation = RtlAllocateHeap(RtlGetProcessHeap(), 0, 
ValueInfoLength);
+if (!pValueInformation)
+{
+DPRINT("RtlAllocateHeap() failed\n");
+Status = STATUS_NO_MEMORY;
+goto cleanup;
+}
+
+while (TRUE)
+{
+Status = NtEnumerateKey(hDevicesKey,
+IndexDevice,
+KeyBasicInformation,
+pDeviceInformation,
+DeviceInfoLength,
+&RequiredSize);
+if (Status == STATUS_NO_MORE_ENTRIES)
+break;
+else if (Status == STATUS_BUFFER_OVERFLOW || Status == 
STATUS_BUFFER_TOO_SMALL)
+{
+RtlFreeHeap(RtlGetProcessHeap(), 0, pDeviceInformation);
+DeviceInfoLength = RequiredSize;
+pDeviceInformation = RtlAllocateHeap(RtlGetProcessHeap(), 0, 
DeviceInfoLength);
+if (!pDeviceInformation)
+{
+DPRINT("RtlAllocateHeap() failed\n");
+Status = STATUS_NO_MEMORY;
+goto cleanup;
+}
+Status = NtEnumerateKey(hDevicesKey,
+IndexDevice,
+KeyBasicInformation,
+pDeviceInformation,
+DeviceInfoLength,
+&RequiredSize);
+}
+if (!NT_SUCCESS(Status))
+{
+DPRINT("NtEnumerateKey() failed with status 0x%08lx\n", Status);
 goto cleanup;
- }
- Status = NtEnumerateKey(hDevicesKey, IndexDevice, 
KeyBasicInformation, pDeviceInformation, DeviceInfoLength, &RequiredSize);
-  }
-  if (!NT_SUCCESS(Status))
-  {
- DPRINT("NtEnumerateKey() failed with status 0x%08lx\n", Status);
- goto cleanup;
-  }
-  IndexDevice++;
-
-  /* Open device key */
-  DeviceName.Length = DeviceName.MaximumLength = 
pDeviceInformation->NameLength;
-  DeviceName.Buffer = pDeviceInformation->Name;
-  InitializeObjectAttributes(&ObjectAttributes, &DeviceName, 
OBJ_CASE_INSENSITIVE, hDevicesKey, NULL);
-  Status = NtOpenKey(
- &hDeviceKey,
- KEY_QUERY_VALUE,
- &ObjectAttributes);
-  if (!NT_SUCCESS(Status))
-  {
- DPRINT("NtOpenKey() failed with status 0x%08lx\n", Status);
- goto cleanup;
-  }
-
-  /* Read identifier */
-  Status = NtQueryValueKey(hDeviceKey, &IdentifierU, 
KeyValuePartialInformation, pValueInformation, ValueInfoLength, &RequiredSize);
-  if (Status == STATUS_BUFFER_OVERFLOW || Status == 
STATUS_BUFFER_TOO

[ros-diffs] [hbelusca] 75695: [SETUPLIB]: Move the files that implement utility functions into their own subdirectory. The files remaining in the main directory implement setup procedures that use the

2017-08-28 Thread hbelusca
Author: hbelusca
Date: Mon Aug 28 11:28:08 2017
New Revision: 75695

URL: http://svn.reactos.org/svn/reactos?rev=75695&view=rev
Log:
[SETUPLIB]: Move the files that implement utility functions into their own 
subdirectory. The files remaining in the main directory implement setup 
procedures that use the utility functions.

Added:
branches/setup_improvements/base/setup/lib/utils/
branches/setup_improvements/base/setup/lib/utils/arcname.c
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/arcname.c
branches/setup_improvements/base/setup/lib/utils/arcname.h
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/arcname.h
branches/setup_improvements/base/setup/lib/utils/arcname_tests.c
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/arcname_tests.c
branches/setup_improvements/base/setup/lib/utils/bldrsup.c
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/bldrsup.c
branches/setup_improvements/base/setup/lib/utils/bldrsup.h
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/bldrsup.h
branches/setup_improvements/base/setup/lib/utils/filesup.c
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/filesup.c
branches/setup_improvements/base/setup/lib/utils/filesup.h
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/filesup.h
branches/setup_improvements/base/setup/lib/utils/genlist.c
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/genlist.c
branches/setup_improvements/base/setup/lib/utils/genlist.h
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/genlist.h
branches/setup_improvements/base/setup/lib/utils/infsupp.c
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/infsupp.c
branches/setup_improvements/base/setup/lib/utils/infsupp.h
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/infsupp.h
branches/setup_improvements/base/setup/lib/utils/inicache.c
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/inicache.c
branches/setup_improvements/base/setup/lib/utils/inicache.h
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/inicache.h
branches/setup_improvements/base/setup/lib/utils/linklist.h
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/linklist.h
branches/setup_improvements/base/setup/lib/utils/ntverrsrc.c
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/ntverrsrc.c
branches/setup_improvements/base/setup/lib/utils/ntverrsrc.h
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/ntverrsrc.h
branches/setup_improvements/base/setup/lib/utils/osdetect.c
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/osdetect.c
branches/setup_improvements/base/setup/lib/utils/osdetect.h
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/osdetect.h
branches/setup_improvements/base/setup/lib/utils/partlist.c
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/partlist.c
branches/setup_improvements/base/setup/lib/utils/partlist.h
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/partlist.h
branches/setup_improvements/base/setup/lib/utils/regutil.c
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/regutil.c
branches/setup_improvements/base/setup/lib/utils/regutil.h
  - copied unchanged from r75694, 
branches/setup_improvements/base/setup/lib/regutil.h
Removed:
branches/setup_improvements/base/setup/lib/arcname.c
branches/setup_improvements/base/setup/lib/arcname.h
branches/setup_improvements/base/setup/lib/arcname_tests.c
branches/setup_improvements/base/setup/lib/bldrsup.c
branches/setup_improvements/base/setup/lib/bldrsup.h
branches/setup_improvements/base/setup/lib/filesup.c
branches/setup_improvements/base/setup/lib/filesup.h
branches/setup_improvements/base/setup/lib/genlist.c
branches/setup_improvements/base/setup/lib/genlist.h
branches/setup_improvements/base/setup/lib/infsupp.c
branches/setup_improvements/base/setup/lib/infsupp.h
branches/setup_improvements/base/setup/lib/inicache.c
branches/setup_improvements/base/setup/lib/inicache.h
branches/setup_improvements/base/setup/lib/linklist.h
branches/setup_improvements/base/setup/lib/ntverrsrc.c
branches/setup_improvements/base/setup/lib/ntverrsrc.h
branches/setup_improvements/base/setup/lib/osdetect.c
branches/setup_improvements/base/setup/lib/osdetect.h
branches/setup_improvements/base/setup/lib/partlist.c
branches/setup_improvements/base/setup/lib/partli

[ros-diffs] [hbelusca] 75676: [SETUPLIB]: Initialization fixes: - Use correct inf style flags in SetupOpenInfFileEx() calls when opening txtsetup.sif and unattend.inf. Technically txtsetup.sif would b

2017-08-26 Thread hbelusca
Author: hbelusca
Date: Sat Aug 26 14:33:48 2017
New Revision: 75676

URL: http://svn.reactos.org/svn/reactos?rev=75676&view=rev
Log:
[SETUPLIB]: Initialization fixes:
- Use correct inf style flags in SetupOpenInfFileEx() calls when opening 
txtsetup.sif and unattend.inf. Technically txtsetup.sif would be INF_STYLE_WIN4
  but since we use "$ReactOS$" as its version signature, it would not work when 
opening it with setupapi.dll functions. Hence I combine the flag with 
INF_STYLE_OLDNT too.
- Don't fail if opening the \SystemRoot symbolic link doesn't work (usually due 
to incorrect access rights); in that case, just use the installer image file 
path as the installation source path.

Modified:
branches/setup_improvements/base/setup/lib/setuplib.c

Modified: branches/setup_improvements/base/setup/lib/setuplib.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/setuplib.c?rev=75676&r1=75675&r2=75676&view=diff
==
--- branches/setup_improvements/base/setup/lib/setuplib.c   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/setuplib.c   [iso-8859-1] 
Sat Aug 26 14:33:48 2017
@@ -49,7 +49,7 @@
 /* Load 'unattend.inf' from installation media */
 UnattendInf = SetupOpenInfFileExW(UnattendInfPath,
   NULL,
-  INF_STYLE_WIN4,
+  INF_STYLE_OLDNT,
   pSetupData->LanguageId,
   &ErrorLine);
 
@@ -262,7 +262,8 @@
 #if 0
 
 /* TODO: Append the standard unattend.inf file */
-CombinePaths(UnattendInfPath, ARRAYSIZE(UnattendInfPath), 2, 
pSetupData->SourcePath.Buffer, L"unattend.inf");
+CombinePaths(UnattendInfPath, ARRAYSIZE(UnattendInfPath), 2,
+ pSetupData->SourcePath.Buffer, L"unattend.inf");
 if (DoesFileExist(NULL, UnattendInfPath) == FALSE)
 {
 DPRINT("Does not exist: %S\n", UnattendInfPath);
@@ -437,7 +438,16 @@
   SYMBOLIC_LINK_QUERY,
   &ObjectAttributes);
 if (!NT_SUCCESS(Status))
-return Status;
+{
+/*
+ * We failed at opening the \SystemRoot link (usually due to wrong
+ * access rights). Do not consider this as a fatal error, but use
+ * instead the image file path as the installation source path.
+ */
+DPRINT1("NtOpenSymbolicLinkObject(%wZ) failed with Status 0x%08lx\n",
+&SystemRootPath, Status);
+goto InitPaths;
+}
 
 RtlInitEmptyUnicodeString(&SystemRootPath,
   SystemRootBuffer,
@@ -449,7 +459,7 @@
 NtClose(Handle);
 
 if (!NT_SUCCESS(Status))
-return Status;
+return Status; // Unexpected error
 
 /* Check whether the resolved \SystemRoot is a prefix of the image file 
path */
 if (RtlPrefixUnicodeString(&SystemRootPath, InstallSourcePath, TRUE))
@@ -459,6 +469,7 @@
 }
 
 
+InitPaths:
 /*
  * Retrieve the different source path components
  */
@@ -499,7 +510,7 @@
 
 *SetupInf = SetupOpenInfFileExW(FileNameBuffer,
NULL,
-   INF_STYLE_WIN4,
+   INF_STYLE_WIN4 | INF_STYLE_OLDNT,
pSetupData->LanguageId,
&ErrorLine);
 




[ros-diffs] [hbelusca] 75675: [BOOTDATA]: Move an inf comment where it belongs.

2017-08-26 Thread hbelusca
Author: hbelusca
Date: Sat Aug 26 12:52:28 2017
New Revision: 75675

URL: http://svn.reactos.org/svn/reactos?rev=75675&view=rev
Log:
[BOOTDATA]: Move an inf comment where it belongs.

Modified:
trunk/reactos/boot/bootdata/bootcd/unattend.inf
trunk/reactos/boot/bootdata/bootcdregtest/unattend.inf

Modified: trunk/reactos/boot/bootdata/bootcd/unattend.inf
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/bootcd/unattend.inf?rev=75675&r1=75674&r2=75675&view=diff
==
--- trunk/reactos/boot/bootdata/bootcd/unattend.inf [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/bootcd/unattend.inf [iso-8859-1] Sat Aug 26 
12:52:28 2017
@@ -1,8 +1,7 @@
-; Set UnattendSetupEnabled to yes in order to get unattended setup working
-
 [Unattend]
 Signature = "$ReactOS$"
 
+; Set UnattendSetupEnabled to yes in order to get unattended setup working
 ; yes - unattend setup enabled
 ; no - unattend setup disabled
 UnattendSetupEnabled = no

Modified: trunk/reactos/boot/bootdata/bootcdregtest/unattend.inf
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/bootcdregtest/unattend.inf?rev=75675&r1=75674&r2=75675&view=diff
==
--- trunk/reactos/boot/bootdata/bootcdregtest/unattend.inf  [iso-8859-1] 
(original)
+++ trunk/reactos/boot/bootdata/bootcdregtest/unattend.inf  [iso-8859-1] 
Sat Aug 26 12:52:28 2017
@@ -1,8 +1,7 @@
-; Set UnattendSetupEnabled to yes in order to get unattended setup working
-
 [Unattend]
 Signature = "$ReactOS$"
 
+; Set UnattendSetupEnabled to yes in order to get unattended setup working
 ; yes - unattend setup enabled
 ; no - unattend setup disabled
 UnattendSetupEnabled = yes




[ros-diffs] [hbelusca] 75674: [SETUPLIB]: Move the bootsup.c code into the setuplib, as the code is generic enough to be used by both USETUP and the 1st-stage GUI installer. [USETUP]: Perform the nece

2017-08-26 Thread hbelusca
Author: hbelusca
Date: Sat Aug 26 11:42:32 2017
New Revision: 75674

URL: http://svn.reactos.org/svn/reactos?rev=75674&view=rev
Log:
[SETUPLIB]: Move the bootsup.c code into the setuplib, as the code is generic 
enough to be used by both USETUP and the 1st-stage GUI installer.
[USETUP]: Perform the necessary adjustments.

Added:
branches/setup_improvements/base/setup/lib/bootsup.c
  - copied, changed from r75673, 
branches/setup_improvements/base/setup/usetup/bootsup.c
branches/setup_improvements/base/setup/lib/bootsup.h
  - copied, changed from r75673, 
branches/setup_improvements/base/setup/usetup/bootsup.h
Removed:
branches/setup_improvements/base/setup/usetup/bootsup.c
branches/setup_improvements/base/setup/usetup/bootsup.h
Modified:
branches/setup_improvements/base/setup/lib/CMakeLists.txt
branches/setup_improvements/base/setup/lib/fsutil.h
branches/setup_improvements/base/setup/lib/setuplib.h
branches/setup_improvements/base/setup/usetup/CMakeLists.txt
branches/setup_improvements/base/setup/usetup/usetup.c

[This mail would be too long, it was shortened to contain the URLs only.]

Modified: branches/setup_improvements/base/setup/lib/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/CMakeLists.txt?rev=75674&r1=75673&r2=75674&view=diff

Copied: branches/setup_improvements/base/setup/lib/bootsup.c (from r75673, 
branches/setup_improvements/base/setup/usetup/bootsup.c)
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/bootsup.c?p2=branches/setup_improvements/base/setup/lib/bootsup.c&p1=branches/setup_improvements/base/setup/usetup/bootsup.c&r1=75673&r2=75674&rev=75674&view=diff

Copied: branches/setup_improvements/base/setup/lib/bootsup.h (from r75673, 
branches/setup_improvements/base/setup/usetup/bootsup.h)
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/bootsup.h?p2=branches/setup_improvements/base/setup/lib/bootsup.h&p1=branches/setup_improvements/base/setup/usetup/bootsup.h&r1=75673&r2=75674&rev=75674&view=diff

Modified: branches/setup_improvements/base/setup/lib/fsutil.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/fsutil.h?rev=75674&r1=75673&r2=75674&view=diff

Modified: branches/setup_improvements/base/setup/lib/setuplib.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/setuplib.h?rev=75674&r1=75673&r2=75674&view=diff

Modified: branches/setup_improvements/base/setup/usetup/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/CMakeLists.txt?rev=75674&r1=75673&r2=75674&view=diff

Removed: branches/setup_improvements/base/setup/usetup/bootsup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/bootsup.c?rev=75673

Removed: branches/setup_improvements/base/setup/usetup/bootsup.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/bootsup.h?rev=75673

Modified: branches/setup_improvements/base/setup/usetup/usetup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/usetup.c?rev=75674&r1=75673&r2=75674&view=diff




[ros-diffs] [hbelusca] 75669: [USETUP]: Add few checks to forbid the user to attempt installing ReactOS in the installation source directory, or a subdirectory thereof, or to delete the partition cont

2017-08-25 Thread hbelusca
Author: hbelusca
Date: Fri Aug 25 14:38:12 2017
New Revision: 75669

URL: http://svn.reactos.org/svn/reactos?rev=75669&view=rev
Log:
[USETUP]: Add few checks to forbid the user to attempt installing ReactOS in 
the installation source directory, or a subdirectory thereof, or to delete the 
partition containing the installation source.
This is needed because the ReactOS installer can also be present from within a 
HDD partition!

Modified:
branches/setup_improvements/base/setup/usetup/usetup.c

Modified: branches/setup_improvements/base/setup/usetup/usetup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/usetup.c?rev=75669&r1=75668&r2=75669&view=diff
==
--- branches/setup_improvements/base/setup/usetup/usetup.c  [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/usetup.c  [iso-8859-1] 
Fri Aug 25 14:38:12 2017
@@ -1614,9 +1614,31 @@
 }
 else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'D')  /* D */
 {
+WCHAR PathBuffer[MAX_PATH];
+UNICODE_STRING CurrentPartition;
+
 if (PartitionList->CurrentPartition->IsPartitioned == FALSE)
 {
 MUIDisplayError(ERROR_DELETE_SPACE, Ir, POPUP_WAIT_ANY_KEY);
+return SELECT_PARTITION_PAGE;
+}
+
+StringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
+L"\\Device\\Harddisk%lu\\Partition%lu\\",
+PartitionList->CurrentDisk->DiskNumber,
+PartitionList->CurrentPartition->PartitionNumber);
+RtlInitUnicodeString(&CurrentPartition, PathBuffer);
+
+/*
+ * Check whether the user attempts to delete the partition on which
+ * the installation source is present. If so, fail with an error.
+ */
+// &USetupData.SourceRootPath
+if (RtlPrefixUnicodeString(&CurrentPartition, 
&USetupData.SourcePath, TRUE))
+{
+PopupError("You cannot delete the partition containing the 
installation source!",
+   MUIGetString(STRING_CONTINUE),
+   Ir, POPUP_WAIT_ENTER);
 return SELECT_PARTITION_PAGE;
 }
 
@@ -2591,6 +2613,8 @@
PartTypeString,
ARRAYSIZE(PartTypeString));
 
+MUIDisplayPage(SELECT_FILE_SYSTEM_PAGE);
+
 if (PartEntry->AutoCreate == TRUE)
 {
 CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_NEWPARTITION));
@@ -2674,8 +2698,6 @@
 &DiskEntry->DriverName,
 DiskEntry->NoMbr ? "GPT" : "MBR");
 }
-
-MUIDisplayPage(SELECT_FILE_SYSTEM_PAGE);
 
 if (FileSystemList == NULL)
 {
@@ -3068,6 +3090,20 @@
 
 /* Initialize DestinationDriveLetter */
 DestinationDriveLetter = (WCHAR)PartEntry->DriveLetter;
+
+/*
+ * Check whether the user attempts to install ReactOS within the
+ * installation source directory, or in a subdirectory thereof.
+ * If so, fail with an error.
+ */
+if (RtlPrefixUnicodeString(&USetupData.SourcePath, 
&USetupData.DestinationPath, TRUE))
+{
+INPUT_RECORD Ir;
+PopupError("You cannot install ReactOS within the installation source 
directory!",
+   MUIGetString(STRING_CONTINUE),
+   &Ir, POPUP_WAIT_ENTER);
+return INSTALL_DIRECTORY_PAGE;
+}
 
 return PREPARE_COPY_PAGE;
 }




[ros-diffs] [hbelusca] 75668: [REACTOS]: More interfacing of the 1st-stage GUI installer with the setuplib: - Add a ConvertNtPathToWin32Path() helper function that allows me to convert NT paths like:

2017-08-25 Thread hbelusca
Author: hbelusca
Date: Fri Aug 25 09:29:20 2017
New Revision: 75668

URL: http://svn.reactos.org/svn/reactos?rev=75668&view=rev
Log:
[REACTOS]: More interfacing of the 1st-stage GUI installer with the setuplib:
- Add a ConvertNtPathToWin32Path() helper function that allows me to convert NT 
paths like: \Device\CdRom0\i386\txtsetup.sif file into a Win32 path that the 
Win32 versions of the SetupApi functions (e.g. SetupOpenInfFileW) can accept.
  Note that RtlNtPathNameToDosPathName() cannot be used here because this 
function only works for NT paths within the \DosDevices\ (or \??\) NTObj 
directory, and not in other directories.
- Use this helper function in the implementation of SetupOpenInfFileExW. Now 
the txtsetup.sif function can be loaded by setuplib *when being used* by the 
1st-stage GUI installer!
- Remove deprecated code.

Modified:
branches/setup_improvements/base/setup/reactos/inffile.c
branches/setup_improvements/base/setup/reactos/reactos.c
branches/setup_improvements/base/setup/reactos/reactos.h

Modified: branches/setup_improvements/base/setup/reactos/inffile.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/reactos/inffile.c?rev=75668&r1=75667&r2=75668&view=diff
==
--- branches/setup_improvements/base/setup/reactos/inffile.c[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/reactos/inffile.c[iso-8859-1] 
Fri Aug 25 09:29:20 2017
@@ -28,8 +28,26 @@
 IN LCID LocaleId,
 OUT PUINT ErrorLine)
 {
+WCHAR Win32FileName[MAX_PATH];
+
 UNREFERENCED_PARAMETER(LocaleId);
-return SetupOpenInfFileW(FileName, InfClass, InfStyle, ErrorLine);
+
+/*
+ * SetupOpenInfFileExW is called within setuplib with NT paths, however
+ * the Win32 SetupOpenInfFileW API only takes Win32 paths. We therefore
+ * map the NT path to Win32 path and then call the Win32 API.
+ */
+if (!ConvertNtPathToWin32Path(Win32FileName,
+  _countof(Win32FileName),
+  FileName))
+{
+return INVALID_HANDLE_VALUE;
+}
+
+return SetupOpenInfFileW(Win32FileName,
+ InfClass,
+ InfStyle,
+ ErrorLine);
 }
 
 

Modified: branches/setup_improvements/base/setup/reactos/reactos.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/reactos/reactos.c?rev=75668&r1=75667&r2=75668&view=diff
==
--- branches/setup_improvements/base/setup/reactos/reactos.c[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/reactos/reactos.c[iso-8859-1] 
Fri Aug 25 09:29:20 2017
@@ -701,45 +701,55 @@
 return TotalCount;
 }
 
-BOOL IsUnattendSetup(VOID)
-{
-WCHAR szPath[MAX_PATH];
-WCHAR *ch;
-HINF hUnattendedInf;
-INFCONTEXT InfContext;
-TCHAR szValue[MAX_PATH];
-DWORD LineLength;
-//HKEY hKey;
-BOOL result = 0;
-
-GetModuleFileNameW(NULL, szPath, MAX_PATH);
-ch = wcsrchr(szPath, L'\\');
-if (ch != NULL)
-*ch = L'\0';
-
-wcscat(szPath, L"\\unattend.inf");
-hUnattendedInf = SetupOpenInfFileW(szPath, NULL, INF_STYLE_OLDNT, NULL);
-
-if (hUnattendedInf != INVALID_HANDLE_VALUE)
-{
-if (SetupFindFirstLine(hUnattendedInf, _T("Unattend"), 
_T("UnattendSetupEnabled"),&InfContext))
-{
-if (SetupGetStringField(&InfContext,
-1,
-szValue,
-sizeof(szValue) / sizeof(TCHAR),
-&LineLength) && (_tcsicmp(szValue, 
_T("yes")) == 0))
-{
-result = 1; // unattendSetup enabled
-// read values and store in SetupData
-}
-}
-SetupCloseInfFile(hUnattendedInf);
-}
-
-return result;
-}
-
+/*
+ * Attempts to convert a pure NT file path into a corresponding Win32 path.
+ * Adapted from GetInstallSourceWin32() in dll/win32/syssetup/wizard.c
+ */
+BOOL
+ConvertNtPathToWin32Path(
+OUT PWSTR pwszPath,
+IN DWORD cchPathMax,
+IN PCWSTR pwszNTPath)
+{
+WCHAR wszDrives[512];
+WCHAR wszNTPath[512]; // MAX_PATH ?
+DWORD cchDrives;
+PWCHAR pwszDrive;
+
+*pwszPath = UNICODE_NULL;
+
+cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
+if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
+{
+/* Buffer too small or failure */
+DPRINT1("GetLogicalDriveStringsW failed\n");
+return FALSE;
+}
+
+for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
+{
+/* Retrieve the NT path

[ros-diffs] [hbelusca] 75667: [SETUPLIB]: - Compute the installation source paths based on the full path of the installer program that uses the setup library. - Add INF_STYLE_OLDNT define in infsupp.h

2017-08-25 Thread hbelusca
Author: hbelusca
Date: Fri Aug 25 09:19:44 2017
New Revision: 75667

URL: http://svn.reactos.org/svn/reactos?rev=75667&view=rev
Log:
[SETUPLIB]: - Compute the installation source paths based on the full path of 
the installer program that uses the setup library. - Add INF_STYLE_OLDNT define 
in infsupp.h. - Add some (silenced) diagnostic DPRINTs.

Modified:
branches/setup_improvements/base/setup/lib/infsupp.h
branches/setup_improvements/base/setup/lib/setuplib.c

Modified: branches/setup_improvements/base/setup/lib/infsupp.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/infsupp.h?rev=75667&r1=75666&r2=75667&view=diff
==
--- branches/setup_improvements/base/setup/lib/infsupp.h[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/infsupp.h[iso-8859-1] 
Fri Aug 25 09:19:44 2017
@@ -95,6 +95,10 @@
 #undef MAX_INF_STRING_LENGTH
 #define MAX_INF_STRING_LENGTH   1024 // Still larger than in infcommon.h
 
+#ifndef INF_STYLE_OLDNT
+#define INF_STYLE_OLDNT 0x0001
+#endif
+
 #ifndef INF_STYLE_WIN4
 #define INF_STYLE_WIN4  0x0002
 #endif

Modified: branches/setup_improvements/base/setup/lib/setuplib.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/setuplib.c?rev=75667&r1=75666&r2=75667&view=diff
==
--- branches/setup_improvements/base/setup/lib/setuplib.c   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/setuplib.c   [iso-8859-1] 
Fri Aug 25 09:19:44 2017
@@ -37,6 +37,8 @@
 
 CombinePaths(UnattendInfPath, ARRAYSIZE(UnattendInfPath), 2,
  pSetupData->SourcePath.Buffer, L"unattend.inf");
+
+DPRINT("UnattendInf path: '%S'\n", UnattendInfPath);
 
 if (DoesFileExist(NULL, UnattendInfPath) == FALSE)
 {
@@ -376,8 +378,6 @@
 #endif
 }
 
-
-
 NTSTATUS
 GetSourcePaths(
 OUT PUNICODE_STRING SourcePath,
@@ -385,41 +385,87 @@
 OUT PUNICODE_STRING SourceRootDir)
 {
 NTSTATUS Status;
+HANDLE Handle;
 OBJECT_ATTRIBUTES ObjectAttributes;
-UNICODE_STRING LinkName = RTL_CONSTANT_STRING(L"\\SystemRoot");
-UNICODE_STRING SourceName;
-WCHAR SourceBuffer[MAX_PATH] = L"";
-HANDLE Handle;
-ULONG Length;
+UCHAR ImageFileBuffer[sizeof(UNICODE_STRING) + MAX_PATH * sizeof(WCHAR)];
+PUNICODE_STRING InstallSourcePath = (PUNICODE_STRING)&ImageFileBuffer;
+WCHAR SystemRootBuffer[MAX_PATH] = L"";
+UNICODE_STRING SystemRootPath = RTL_CONSTANT_STRING(L"\\SystemRoot");
+ULONG BufferSize;
 PWCHAR Ptr;
 
+/* Determine the installation source path via the full path of the 
installer */
+RtlInitEmptyUnicodeString(InstallSourcePath,
+  (PWSTR)((ULONG_PTR)ImageFileBuffer + 
sizeof(UNICODE_STRING)),
+  sizeof(ImageFileBuffer) - sizeof(UNICODE_STRING)
+/* Reserve space for a NULL terminator */ - sizeof(UNICODE_NULL));
+BufferSize = sizeof(ImageFileBuffer);
+Status = NtQueryInformationProcess(NtCurrentProcess(),
+   ProcessImageFileName,
+   InstallSourcePath,
+   BufferSize,
+   NULL);
+// STATUS_INFO_LENGTH_MISMATCH or STATUS_BUFFER_TOO_SMALL ?
+if (!NT_SUCCESS(Status))
+return Status;
+
+/* Manually NULL-terminate */
+InstallSourcePath->Buffer[InstallSourcePath->Length / sizeof(WCHAR)] = 
UNICODE_NULL;
+
+/* Strip the trailing file name */
+Ptr = wcsrchr(InstallSourcePath->Buffer, OBJ_NAME_PATH_SEPARATOR);
+if (Ptr)
+*Ptr = UNICODE_NULL;
+InstallSourcePath->Length = wcslen(InstallSourcePath->Buffer) * 
sizeof(WCHAR);
+
+
+/*
+ * Now resolve the full path to \SystemRoot. In case it prefixes
+ * the installation source path determined from the full path of
+ * the installer, we use instead the resolved \SystemRoot as the
+ * installation source path.
+ * Otherwise, we use instead the path from the full installer path.
+ */
+
 InitializeObjectAttributes(&ObjectAttributes,
-   &LinkName,
+   &SystemRootPath,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
 
 Status = NtOpenSymbolicLinkObject(&Handle,
-  SYMBOLIC_LINK_ALL_ACCESS,
+  SYMBOLIC_LINK_QUERY,
   &ObjectAttributes);
 if (!NT_SUCCESS(Status))
 return Status;
 
-RtlInitEmptyUnicodeString(&

[ros-diffs] [hbelusca] 75657: [SETUPLIB]: Fix n00b bug.

2017-08-23 Thread hbelusca
Author: hbelusca
Date: Wed Aug 23 17:48:00 2017
New Revision: 75657

URL: http://svn.reactos.org/svn/reactos?rev=75657&view=rev
Log:
[SETUPLIB]: Fix n00b bug.

Modified:
branches/setup_improvements/base/setup/lib/filesup.h

Modified: branches/setup_improvements/base/setup/lib/filesup.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/filesup.h?rev=75657&r1=75656&r2=75657&view=diff
==
--- branches/setup_improvements/base/setup/lib/filesup.h[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/filesup.h[iso-8859-1] 
Wed Aug 23 17:48:00 2017
@@ -106,6 +106,6 @@
 do {\
 UnMapFile((SectionHandle), (BaseAddress));  \
 NtClose(FileHandle);\
-} while (1)
+} while (0)
 
 /* EOF */




[ros-diffs] [hbelusca] 75656: Code formatting fix.

2017-08-23 Thread hbelusca
Author: hbelusca
Date: Wed Aug 23 17:47:39 2017
New Revision: 75656

URL: http://svn.reactos.org/svn/reactos?rev=75656&view=rev
Log:
Code formatting fix.

Modified:
branches/setup_improvements/base/setup/lib/inicache.c

Modified: branches/setup_improvements/base/setup/lib/inicache.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/inicache.c?rev=75656&r1=75655&r2=75656&view=diff
==
--- branches/setup_improvements/base/setup/lib/inicache.c   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/inicache.c   [iso-8859-1] 
Wed Aug 23 17:47:39 2017
@@ -334,7 +334,7 @@
 *NamePtr = NULL;
 *NameSize = 0;
 
-while(Ptr && *Ptr)
+while (Ptr && *Ptr)
 {
 *NamePtr = NULL;
 *NameSize = 0;




[ros-diffs] [hbelusca] 75655: [SETUPDD]: Add a template Setup Device Driver Helper whose future aim will be to provide user-mode applications access to the kernel-mode PSETUP_LOADER_BLOCK SetupLdrBloc

2017-08-23 Thread hbelusca
Author: hbelusca
Date: Wed Aug 23 14:03:59 2017
New Revision: 75655

URL: http://svn.reactos.org/svn/reactos?rev=75655&view=rev
Log:
[SETUPDD]: Add a template Setup Device Driver Helper whose future aim will be 
to provide user-mode applications access to the kernel-mode PSETUP_LOADER_BLOCK 
SetupLdrBlock pointer in KeLoaderBlock.
Currently the driver just dumps the whole structure on the debug channel.

Added:
branches/setup_improvements/base/setup/setupdd/
branches/setup_improvements/base/setup/setupdd/CMakeLists.txt   (with props)
branches/setup_improvements/base/setup/setupdd/dispatch.c   (with props)
branches/setup_improvements/base/setup/setupdd/setupdd.c   (with props)
branches/setup_improvements/base/setup/setupdd/setupdd.h   (with props)
branches/setup_improvements/base/setup/setupdd/setupdd.rc   (with props)
Modified:
branches/setup_improvements/base/setup/CMakeLists.txt

Modified: branches/setup_improvements/base/setup/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/CMakeLists.txt?rev=75655&r1=75654&r2=75655&view=diff
==
--- branches/setup_improvements/base/setup/CMakeLists.txt   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/CMakeLists.txt   [iso-8859-1] 
Wed Aug 23 14:03:59 2017
@@ -2,5 +2,6 @@
 add_subdirectory(lib)
 add_subdirectory(reactos)
 add_subdirectory(setup)
+add_subdirectory(setupdd)
 add_subdirectory(usetup)
 add_subdirectory(welcome)

Added: branches/setup_improvements/base/setup/setupdd/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/setupdd/CMakeLists.txt?rev=75655
==
--- branches/setup_improvements/base/setup/setupdd/CMakeLists.txt   (added)
+++ branches/setup_improvements/base/setup/setupdd/CMakeLists.txt   
[iso-8859-1] Wed Aug 23 14:03:59 2017
@@ -0,0 +1,16 @@
+
+# include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/drivers)
+
+list(APPEND SOURCE
+dispatch.c
+setupdd.c
+setupdd.h
+)
+
+add_library(setupdd SHARED ${SOURCE} setupdd.rc)
+
+set_module_type(setupdd kernelmodedriver)
+# target_link_libraries(setupdd ${PSEH_LIB})
+add_importlibs(setupdd ntoskrnl hal)
+add_pch(setupdd setupdd.h SOURCE)
+add_cd_file(TARGET setupdd DESTINATION reactos/system32 NO_CAB FOR bootcd 
regtest)

Propchange: branches/setup_improvements/base/setup/setupdd/CMakeLists.txt
--
svn:eol-style = native

Added: branches/setup_improvements/base/setup/setupdd/dispatch.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/setupdd/dispatch.c?rev=75655
==
--- branches/setup_improvements/base/setup/setupdd/dispatch.c   (added)
+++ branches/setup_improvements/base/setup/setupdd/dispatch.c   [iso-8859-1] 
Wed Aug 23 14:03:59 2017
@@ -0,0 +1,106 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT: ReactOS Setup Device Driver Helper
+ * FILE:base/setup/setupdd/dispatch.c
+ * PURPOSE: Dispatching interface
+ * PROGRAMMERS: Hermes Belusca-Maito (hermes.belu...@sfr.fr)
+ */
+
+/* INCLUDES 
***/
+
+#include "setupdd.h"
+
+#define NDEBUG
+#include 
+
+/* FUNCTIONS 
**/
+
+NTSTATUS NTAPI
+CompleteRequest(IN PIRP  Irp,
+IN NTSTATUS  Status,
+IN ULONG_PTR Information)
+{
+Irp->IoStatus.Status  = Status;
+Irp->IoStatus.Information = Information;
+IoCompleteRequest(Irp, IO_NO_INCREMENT);
+return Status;
+}
+
+NTSTATUS NTAPI
+CompleteRequestNoInfo(IN PIRP Irp,
+  IN NTSTATUS Status)
+{
+Irp->IoStatus.Status = Status;
+IoCompleteRequest(Irp, IO_NO_INCREMENT);
+return Status;
+}
+
+NTSTATUS NTAPI
+DispatchHelper(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
+{
+#define HANDLE_CTRL_CODE(Code)  \
+case Code : \
+{   \
+DPRINT1("SpDd: " #Code ", Stack->FileObject = 0x%p\n", 
Stack->FileObject);  \
+if (Stack->FileObject) 
 \
+{  
 \
+DPRINT1("Stack->FileObject->FileName = %wZ\n", 
&Stack->FileObject->FileName);   \
+}  
 \
+break; 
 \
+}
+
+PIO_STACK

[ros-diffs] [hbelusca] 75654: [USETUP]: Group constant strings together. In EventThread(), use RtlReAllocateHeap() to resize the pnp-event buffer.

2017-08-23 Thread hbelusca
Author: hbelusca
Date: Wed Aug 23 13:40:43 2017
New Revision: 75654

URL: http://svn.reactos.org/svn/reactos?rev=75654&view=rev
Log:
[USETUP]: Group constant strings together. In EventThread(), use 
RtlReAllocateHeap() to resize the pnp-event buffer.

Modified:
branches/setup_improvements/base/setup/usetup/devinst.c

Modified: branches/setup_improvements/base/setup/usetup/devinst.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/devinst.c?rev=75654&r1=75653&r2=75654&view=diff
==
--- branches/setup_improvements/base/setup/usetup/devinst.c [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/devinst.c [iso-8859-1] 
Wed Aug 23 13:40:43 2017
@@ -46,6 +46,9 @@
 UNICODE_STRING ImagePathU = RTL_CONSTANT_STRING(L"ImagePath");
 UNICODE_STRING StartU = RTL_CONSTANT_STRING(L"Start");
 UNICODE_STRING TypeU = RTL_CONSTANT_STRING(L"Type");
+UNICODE_STRING UpperFiltersU = RTL_CONSTANT_STRING(L"UpperFilters");
+PWSTR keyboardClass = L"kbdclass\0";
+
 UNICODE_STRING StringU;
 OBJECT_ATTRIBUTES ObjectAttributes;
 HANDLE hService;
@@ -55,8 +58,6 @@
 ULONG Disposition;
 NTSTATUS Status;
 BOOLEAN deviceInstalled = FALSE;
-UNICODE_STRING UpperFiltersU = RTL_CONSTANT_STRING(L"UpperFilters");
-PWSTR keyboardClass = L"kbdclass\0";
 
 /* Check if we know the hardware */
 if (!SetupFindFirstLineW(hInf, L"HardwareIdsDatabase", HardwareId, 
&Context))
@@ -206,6 +207,7 @@
 {
 UNICODE_STRING HardwareIDU = RTL_CONSTANT_STRING(L"HardwareID");
 UNICODE_STRING CompatibleIDsU = RTL_CONSTANT_STRING(L"CompatibleIDs");
+
 UNICODE_STRING DeviceIdU;
 OBJECT_ATTRIBUTES ObjectAttributes;
 LPCWSTR HardwareID;
@@ -339,14 +341,15 @@
 {
 UNICODE_STRING EnumU = 
RTL_CONSTANT_STRING(L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Enum");
 UNICODE_STRING ServicesU = 
RTL_CONSTANT_STRING(L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Services");
-PPLUGPLAY_EVENT_BLOCK PnpEvent;
+
+PPLUGPLAY_EVENT_BLOCK PnpEvent, NewPnpEvent;
 OBJECT_ATTRIBUTES ObjectAttributes;
 ULONG PnpEventSize;
 HINF hInf;
 HANDLE hEnum, hServices;
 NTSTATUS Status;
 
-hInf = *(HINF *)lpParameter;
+hInf = *(HINF*)lpParameter;
 
 InitializeObjectAttributes(&ObjectAttributes, &EnumU, 
OBJ_CASE_INSENSITIVE, NULL, NULL);
 Status = NtOpenKey(&hEnum, KEY_QUERY_VALUE, &ObjectAttributes);
@@ -366,33 +369,31 @@
 }
 
 PnpEventSize = 0x1000;
-PnpEvent = (PPLUGPLAY_EVENT_BLOCK)RtlAllocateHeap(ProcessHeap, 0, 
PnpEventSize);
+PnpEvent = RtlAllocateHeap(ProcessHeap, 0, PnpEventSize);
 if (PnpEvent == NULL)
 {
-NtClose(hEnum);
-NtClose(hServices);
-return STATUS_NO_MEMORY;
+Status = STATUS_NO_MEMORY;
+goto Quit;
 }
 
 for (;;)
 {
 DPRINT("Calling NtGetPlugPlayEvent()\n");
 
-/* Wait for the next pnp event */
+/* Wait for the next PnP event */
 Status = NtGetPlugPlayEvent(0, 0, PnpEvent, PnpEventSize);
 
-/* Resize the buffer for the PnP event if it's too small. */
+/* Resize the buffer for the PnP event if it's too small */
 if (Status == STATUS_BUFFER_TOO_SMALL)
 {
 PnpEventSize += 0x400;
-RtlFreeHeap(ProcessHeap, 0, PnpEvent);
-PnpEvent = (PPLUGPLAY_EVENT_BLOCK)RtlAllocateHeap(ProcessHeap, 0, 
PnpEventSize);
-if (PnpEvent == NULL)
+NewPnpEvent = RtlReAllocateHeap(ProcessHeap, 0, PnpEvent, 
PnpEventSize);
+if (NewPnpEvent == NULL)
 {
-NtClose(hEnum);
-NtClose(hServices);
-return STATUS_NO_MEMORY;
+Status = STATUS_NO_MEMORY;
+goto Quit;
 }
+PnpEvent = NewPnpEvent;
 continue;
 }
 
@@ -402,7 +403,7 @@
 break;
 }
 
-/* Process the pnp event */
+/* Process the PnP event */
 DPRINT("Received PnP Event\n");
 if (IsEqualIID(&PnpEvent->EventGuid, (REFGUID)&GUID_DEVICE_ENUMERATED))
 {
@@ -414,15 +415,20 @@
 DPRINT("Unknown event\n");
 }
 
-/* Dequeue the current pnp event and signal the next one */
+/* Dequeue the current PnP event and signal the next one */
 NtPlugPlayControl(PlugPlayControlUserResponse, NULL, 0);
 }
 
-RtlFreeHeap(ProcessHeap, 0, PnpEvent);
+Status = STATUS_SUCCESS;
+
+Quit:
+if (PnpEvent)
+RtlFreeHeap(ProcessHeap, 0, PnpEvent);
+
+NtClose(hServices);
 NtClose(hEnum);
-NtClose(hServices);
-
-return STATUS_SUCCESS;
+
+return Status;
 }
 
 DWORD WINAPI




[ros-diffs] [hbelusca] 75653: [BOOTDATA]: Sync hivesetup.inf

2017-08-23 Thread hbelusca
Author: hbelusca
Date: Wed Aug 23 12:41:00 2017
New Revision: 75653

URL: http://svn.reactos.org/svn/reactos?rev=75653&view=rev
Log:
[BOOTDATA]: Sync hivesetup.inf

Modified:
branches/setup_improvements/boot/bootdata/hivesetup.inf

Modified: branches/setup_improvements/boot/bootdata/hivesetup.inf
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/boot/bootdata/hivesetup.inf?rev=75653&r1=75652&r2=75653&view=diff
==
--- branches/setup_improvements/boot/bootdata/hivesetup.inf [iso-8859-1] 
(original)
+++ branches/setup_improvements/boot/bootdata/hivesetup.inf [iso-8859-1] 
Wed Aug 23 12:41:00 2017
@@ -1354,6 +1354,8 @@
 HKLM,"SYSTEM\CurrentControlSet\Control\Session 
Manager\Environment","TEMP",0x00020002,"%SystemRoot%\TEMP"
 HKLM,"SYSTEM\CurrentControlSet\Control\Session 
Manager\Environment","TMP",0x00020002,"%SystemRoot%\TEMP"
 HKLM,"SYSTEM\CurrentControlSet\Control\Session 
Manager\Environment","windir",0x00020002,"%SystemRoot%"
+;HKLM,"SYSTEM\CurrentControlSet\Control\Session 
Manager\Environment","SHIMENG_DEBUG_LEVEL",0x,"4"
+;HKLM,"SYSTEM\CurrentControlSet\Control\Session 
Manager\Environment","SHIM_DEBUG_LEVEL",0x,"4"
 
 
 ; Known DLLs
@@ -2202,6 +2204,142 @@
 VIETNAMESE = "Vietnamese"
 
 
+; LANG_ROMANIAN SUBLANG_NEUTRAL
+[Strings.0018]
+
+; Services names and descriptions
+AUDIO_SERVICE="Serviciu audio"
+AUDIO_SERVICE_DESCRIPTION="Oferă aplicațiilor funcționalități audio."
+
+BITS_SERVICE="Serviciu de transfer inteligent în fundal"
+BITS_SERVICE_DESCRIPTION="Transferă fișiere în fundal utilizând lățimea 
de bandă nefolosită a rețelei."
+
+EVENTLOG_SERVICE="Jurnal de evenimente"
+EVENTLOG_SERVICE_DESCRIPTION="Jurnalizează mesajele sau evenimentele 
transmise de sistemul de operare într-o bază de date accesibilă cu 
instrumentul „observator de evenimente”."
+
+MSISERVER_SERVICE="Instalare ReactOS"
+MSISERVER_SERVICE_DESCRIPTION="Controlează instalarea, mentenanța, și 
eliminarea de programe de instalare MSI (Windows Installer)."
+
+NETLOGON_SERVICE="Autentificare în rețea"
+NETLOGON_SERVICE_DESCRIPTION="Stabilește un canal securizat către un 
controlor de domentiu pentru autentificarea domeniului."
+
+PLUGPLAY_SERVICE="Plug and Play"
+PLUGPLAY_SERVICE_DESCRIPTION="Detectează schimbările în configurația 
fizică și instalează programele necesare dacă este posibil."
+
+RPCSS_SERVICE="Apel procedural la distanță"
+RPCSS_SERVICE_DESCRIPTION="Subsistemul responsabil pentru apel procedural la 
distanță în calculatorul local."
+
+SCHEDULE_SERVICE="Serviciu de planificare"
+SCHEDULE_SERVICE_DESCRIPTION="Permite pornirea de programe la o anumită oră."
+
+SERVER_SERVICE="Server"
+SERVER_SERVICE_DESCRIPTION="Permite partajarea în rețea a fișierelor, 
imprimantelor și a altor resurse."
+
+SPOOLER_SERVICE="Coadă de imprimare"
+SPOOLER_SERVICE_DESCRIPTION="Încarcă fișierele în memorie pentru imprimare 
ulterioară."
+
+TCPSVCS_SERVICE="Servicii TCP/IP simple"
+TCPSVCS_SERVICE_DECRIPTION="Permite următoarele servicii (protocoale) TCP/IP: 
Chargen, Daytime, Discard, Echo, QOTD."
+
+TELNETD_SERVICE="Serviciu Telnet"
+TELNETD_SERVICE_DESCRIPTION="Serviciul Telnet al ReactOS."
+
+THEMES_SERVICE="Teme"
+THEMES_SERVICE_DESCRIPTION="Permite teme pentru interfața grafică de 
utilizare."
+
+WINMGMT_SERVICE="Infrastructură de gestiune"
+WINMGMT_SERVICE_DESCRIPTION="Furnizează interfața pentru informațiile de 
gestiune ale sistemului."
+
+WLANSVC_SERVICE="Serviciu WLAN"
+WLANSVC_SERVICE_DESCRIPTION="Serviciu pentru rețele locale fără fir."
+
+WORKSTATION_SERVICE="Stație de lucru"
+WORKSTATION_SERVICE_DESCRIPTION="Serviciu responsabil pentru crearea și 
menținerea conexiunilor la servere în rețea."
+
+; Keyboard layouts
+ALBANIAN = "Albaneză"
+ARABIC_101 = "Arabă (101)"
+ARABIC_102 = "Arabă (102)"
+ARABIC_102_AZERTY = "Arabă (102) AZERTY"
+ARMENIAN_EASTERN = "Armeană Estică"
+ARMENIAN_WESTERN = "Armeană Vestică"
+ASSAMESE = "Assameză - INSCRIPT"
+AZERI_CYRILLIC = "Azeră alfabet chirilic"
+AZERI_LATIN = "Azeră alfabet latin"
+BELARUSIAN = "Belarusă"
+BELGIAN_DUTCH = "Belgiană (Olandeză)"
+BELGIAN_FRENCH = "Belgiană (Franceză)"
+BENGALI = "Bengaleză"
+BULGARIAN_BDS = "Bulgară BDS 5237-1978"
+BULGA

[ros-diffs] [hbelusca] 75652: [SETUPLIB]: Fix build.

2017-08-23 Thread hbelusca
Author: hbelusca
Date: Wed Aug 23 12:29:51 2017
New Revision: 75652

URL: http://svn.reactos.org/svn/reactos?rev=75652&view=rev
Log:
[SETUPLIB]: Fix build.

Modified:
branches/setup_improvements/base/setup/lib/arcname.c
branches/setup_improvements/base/setup/lib/filesup.c

Modified: branches/setup_improvements/base/setup/lib/arcname.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/arcname.c?rev=75652&r1=75651&r2=75652&view=diff
==
--- branches/setup_improvements/base/setup/lib/arcname.c[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/arcname.c[iso-8859-1] 
Wed Aug 23 12:29:51 2017
@@ -250,7 +250,7 @@
 return Index;
 }
 
-static ULONG
+/* static */ ULONG
 ArcMatchTokenU(
 IN PCWSTR CandidateToken,
 IN const PCWSTR* TokenTable)
@@ -773,7 +773,6 @@
 }
 #endif
 
-Quit:
 if (FAILED(hr))
 {
 /*

Modified: branches/setup_improvements/base/setup/lib/filesup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/filesup.c?rev=75652&r1=75651&r2=75652&view=diff
==
--- branches/setup_improvements/base/setup/lib/filesup.c[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/filesup.c[iso-8859-1] 
Wed Aug 23 12:29:51 2017
@@ -10,6 +10,7 @@
 /* INCLUDES */
 
 #include "precomp.h"
+#include "filesup.h"
 
 #define NDEBUG
 #include 




[ros-diffs] [hbelusca] 75651: [SETUPLIB]: Introduce and use a UnMapAndCloseFile() macro that calls UnMapFile() and NtClose() on handles returned by the OpenAndMapFile() function.

2017-08-23 Thread hbelusca
Author: hbelusca
Date: Wed Aug 23 12:20:15 2017
New Revision: 75651

URL: http://svn.reactos.org/svn/reactos?rev=75651&view=rev
Log:
[SETUPLIB]: Introduce and use a UnMapAndCloseFile() macro that calls 
UnMapFile() and NtClose() on handles returned by the OpenAndMapFile() function.

Modified:
branches/setup_improvements/base/setup/lib/bldrsup.c
branches/setup_improvements/base/setup/lib/filesup.h
branches/setup_improvements/base/setup/lib/osdetect.c
branches/setup_improvements/base/setup/lib/partlist.c
branches/setup_improvements/base/setup/lib/setuplib.c

Modified: branches/setup_improvements/base/setup/lib/bldrsup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/bldrsup.c?rev=75651&r1=75650&r2=75651&view=diff
==
--- branches/setup_improvements/base/setup/lib/bldrsup.c[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/bldrsup.c[iso-8859-1] 
Wed Aug 23 12:20:15 2017
@@ -461,8 +461,9 @@
 DPRINT1("IniCacheLoadFromMemory() failed (Status 0x%08lx)\n", 
Status);
 
 /* Finally, unmap and close the file */
-UnMapFile(BootStore->SectionHandle, BootStore->ViewBase);
-NtClose(BootStore->FileHandle);
+UnMapAndCloseFile(BootStore->FileHandle,
+  BootStore->SectionHandle,
+  BootStore->ViewBase);
 
 RtlFreeHeap(ProcessHeap, 0, BootStore);
 return Status;
@@ -715,8 +716,9 @@
 if (BootStore->SectionHandle)
 {
 /* Finally, unmap and close the file */
-UnMapFile(BootStore->SectionHandle, BootStore->ViewBase);
-NtClose(BootStore->FileHandle);
+UnMapAndCloseFile(BootStore->FileHandle,
+  BootStore->SectionHandle,
+  BootStore->ViewBase);
 }
 else // if (BootStore->FileHandle)
 {

Modified: branches/setup_improvements/base/setup/lib/filesup.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/filesup.h?rev=75651&r1=75650&r2=75651&view=diff
==
--- branches/setup_improvements/base/setup/lib/filesup.h[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/filesup.h[iso-8859-1] 
Wed Aug 23 12:20:15 2017
@@ -102,4 +102,10 @@
 IN HANDLE SectionHandle,
 IN PVOID BaseAddress);
 
+#define UnMapAndCloseFile(FileHandle, SectionHandle, BaseAddress)   \
+do {\
+UnMapFile((SectionHandle), (BaseAddress));  \
+NtClose(FileHandle);\
+} while (1)
+
 /* EOF */

Modified: branches/setup_improvements/base/setup/lib/osdetect.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/osdetect.c?rev=75651&r1=75650&r2=75651&view=diff
==
--- branches/setup_improvements/base/setup/lib/osdetect.c   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/osdetect.c   [iso-8859-1] 
Wed Aug 23 12:20:15 2017
@@ -280,7 +280,7 @@
 {
 DPRINT1("File '%S' does not seem to be a valid PE, bail out\n", 
PathNameToFile);
 Status = STATUS_INVALID_IMAGE_FORMAT;
-goto UnmapFile;
+goto UnmapCloseFile;
 }
 
 /*
@@ -291,7 +291,7 @@
 if (!NT_SUCCESS(Status))
 {
 DPRINT1("Failed to get version resource for file '%S', Status 
0x%08lx\n", PathNameToFile, Status);
-goto UnmapFile;
+goto UnmapCloseFile;
 }
 
 Status = NtVerQueryValue(VersionBuffer, L"\\VarFileInfo\\Translation", 
&pvData, &BufLen);
@@ -329,10 +329,9 @@
 if (!NT_SUCCESS(Status))
 DPRINT1("No version vendor found for file '%S'\n", PathNameToFile);
 
-UnmapFile:
+UnmapCloseFile:
 /* Finally, unmap and close the file */
-UnMapFile(SectionHandle, ViewBase);
-NtClose(FileHandle);
+UnMapAndCloseFile(FileHandle, SectionHandle, ViewBase);
 
 return Success;
 }

Modified: branches/setup_improvements/base/setup/lib/partlist.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/partlist.c?rev=75651&r1=75650&r2=75651&view=diff
==
--- branches/setup_improvements/base/setup/lib/partlist.c   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/partlist.c   [iso-8859-1] 
Wed Aug 23 12:20:15 2017
@@ -838,7 +838,7 @@
 continue;
 }
 
-/* check if the signature already exist */
+/* Check if the signature already exist */
 /* FIXME:
  *   Check als

[ros-diffs] [hbelusca] 75649: Sync with trunk r75648.

2017-08-23 Thread hbelusca
Author: hbelusca
Date: Wed Aug 23 11:33:57 2017
New Revision: 75649

URL: http://svn.reactos.org/svn/reactos?rev=75649&view=rev
Log:
Sync with trunk r75648.

Added:
branches/setup_improvements/dll/appcompat/shims/layer/vmhorizon.c
  - copied unchanged from r75648, 
trunk/reactos/dll/appcompat/shims/layer/vmhorizon.c
branches/setup_improvements/dll/shellext/stobject/hotplug.cpp
  - copied unchanged from r75648, 
trunk/reactos/dll/shellext/stobject/hotplug.cpp

branches/setup_improvements/dll/win32/shell32/droptargets/CRecyclerDropTarget.cpp
  - copied unchanged from r75648, 
trunk/reactos/dll/win32/shell32/droptargets/CRecyclerDropTarget.cpp
branches/setup_improvements/dll/win32/ucdfs/
  - copied from r75648, trunk/reactos/dll/win32/ucdfs/
branches/setup_improvements/drivers/filesystems/fs_rec/cdfs.h
  - copied unchanged from r75648, 
trunk/reactos/drivers/filesystems/fs_rec/cdfs.h
branches/setup_improvements/sdk/lib/fslib/cdfslib/
  - copied from r75648, trunk/reactos/sdk/lib/fslib/cdfslib/
Removed:
branches/setup_improvements/media/rapps/utorrent.txt
Modified:
branches/setup_improvements/   (props changed)
branches/setup_improvements/base/applications/calc/lang/ro-RO.rc
branches/setup_improvements/base/applications/fltmc/CMakeLists.txt
branches/setup_improvements/base/applications/fltmc/fltmc.cpp
branches/setup_improvements/base/applications/mscutils/servman/lang/ro-RO.rc
branches/setup_improvements/base/applications/mspaint/CMakeLists.txt
branches/setup_improvements/base/applications/mspaint/dib.cpp
branches/setup_improvements/base/applications/rapps/lang/ro-RO.rc
branches/setup_improvements/base/services/eventlog/eventlog.h
branches/setup_improvements/base/services/eventlog/file.c
branches/setup_improvements/base/services/nfsd/CMakeLists.txt
branches/setup_improvements/base/services/nfsd/readwrite.c
branches/setup_improvements/base/setup/reactos/lang/ro-RO.rc
branches/setup_improvements/base/setup/usetup/partlist.c
branches/setup_improvements/base/setup/welcome/lang/ro-RO.rc
branches/setup_improvements/base/shell/cmd/lang/ro-RO.rc
branches/setup_improvements/base/shell/explorer/explorer.rc
branches/setup_improvements/base/shell/explorer/lang/bg-BG.rc
branches/setup_improvements/base/shell/explorer/lang/cs-CZ.rc
branches/setup_improvements/base/shell/explorer/lang/de-DE.rc
branches/setup_improvements/base/shell/explorer/lang/en-US.rc
branches/setup_improvements/base/shell/explorer/lang/es-ES.rc
branches/setup_improvements/base/shell/explorer/lang/fr-FR.rc
branches/setup_improvements/base/shell/explorer/lang/he-IL.rc
branches/setup_improvements/base/shell/explorer/lang/it-IT.rc
branches/setup_improvements/base/shell/explorer/lang/ja-JP.rc
branches/setup_improvements/base/shell/explorer/lang/ko-KR.rc
branches/setup_improvements/base/shell/explorer/lang/lt-LT.rc
branches/setup_improvements/base/shell/explorer/lang/ms-MY.rc
branches/setup_improvements/base/shell/explorer/lang/nl-NL.rc
branches/setup_improvements/base/shell/explorer/lang/no-NO.rc
branches/setup_improvements/base/shell/explorer/lang/pl-PL.rc
branches/setup_improvements/base/shell/explorer/lang/pt-BR.rc
branches/setup_improvements/base/shell/explorer/lang/ro-RO.rc
branches/setup_improvements/base/shell/explorer/lang/ru-RU.rc
branches/setup_improvements/base/shell/explorer/lang/sk-SK.rc
branches/setup_improvements/base/shell/explorer/lang/sq-AL.rc
branches/setup_improvements/base/shell/explorer/lang/tr-TR.rc
branches/setup_improvements/base/shell/explorer/lang/uk-UA.rc
branches/setup_improvements/base/shell/explorer/lang/zh-CN.rc
branches/setup_improvements/base/shell/explorer/lang/zh-TW.rc
branches/setup_improvements/base/shell/explorer/trayprop.cpp
branches/setup_improvements/base/system/autochk/autochk.c
branches/setup_improvements/base/system/userinit/lang/ro-RO.rc
branches/setup_improvements/boot/CMakeLists.txt
branches/setup_improvements/boot/bootdata/bootcd/unattend.inf
branches/setup_improvements/boot/bootdata/hivesft.inf
branches/setup_improvements/boot/bootdata/hivesys.inf
branches/setup_improvements/boot/bootdata/txtsetup.sif
branches/setup_improvements/boot/freeldr/bootsect/fat32.S
branches/setup_improvements/boot/freeldr/freeldr/include/arch/pc/x86common.h
branches/setup_improvements/dll/appcompat/apphelp/apphelp.h
branches/setup_improvements/dll/appcompat/apphelp/shimeng.c
branches/setup_improvements/dll/appcompat/apphelp/shimeng.h
branches/setup_improvements/dll/appcompat/shims/layer/CMakeLists.txt
branches/setup_improvements/dll/cpl/console/lang/ro-RO.rc
branches/setup_improvements/dll/cpl/desk/lang/ro-RO.rc
branches/setup_improvements/dll/cpl/mmsys/lang/ro-RO.rc
branches/setup_improvements/dll/directx/wine/wined3d/context.c
bran

[ros-diffs] [hbelusca] 75636: [SETUPLIB][USETUP]: Code refactoring: rename the old DoesPathExist() into DoesDirExist(), and rename the new DoesPathExistEx() back into DoesPathExist().

2017-08-21 Thread hbelusca
Author: hbelusca
Date: Mon Aug 21 19:41:40 2017
New Revision: 75636

URL: http://svn.reactos.org/svn/reactos?rev=75636&view=rev
Log:
[SETUPLIB][USETUP]: Code refactoring: rename the old DoesPathExist() into 
DoesDirExist(), and rename the new DoesPathExistEx() back into DoesPathExist().

Modified:
branches/setup_improvements/base/setup/lib/filesup.c
branches/setup_improvements/base/setup/lib/filesup.h
branches/setup_improvements/base/setup/lib/osdetect.c
branches/setup_improvements/base/setup/usetup/filesup.c
branches/setup_improvements/base/setup/usetup/usetup.c

Modified: branches/setup_improvements/base/setup/lib/filesup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/filesup.c?rev=75636&r1=75635&r2=75636&view=diff
==
--- branches/setup_improvements/base/setup/lib/filesup.c[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/filesup.c[iso-8859-1] 
Mon Aug 21 19:41:40 2017
@@ -517,7 +517,7 @@
 }
 
 BOOLEAN
-DoesPathExistEx(
+DoesPathExist(
 IN HANDLE RootDirectory OPTIONAL,
 IN PCWSTR PathName,
 IN BOOLEAN IsDirectory)

Modified: branches/setup_improvements/base/setup/lib/filesup.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/filesup.h?rev=75636&r1=75635&r2=75636&view=diff
==
--- branches/setup_improvements/base/setup/lib/filesup.h[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/filesup.h[iso-8859-1] 
Mon Aug 21 19:41:40 2017
@@ -63,16 +63,16 @@
 IN /* PCWSTR */ ...);
 
 BOOLEAN
-DoesPathExistEx(
+DoesPathExist(
 IN HANDLE RootDirectory OPTIONAL,
 IN PCWSTR PathName,
 IN BOOLEAN IsDirectory);
 
-#define DoesPathExist(RootDirectory, PathName)  \
-DoesPathExistEx((RootDirectory), (PathName), TRUE)
+#define DoesDirExist(RootDirectory, DirName)\
+DoesPathExist((RootDirectory), (DirName), TRUE)
 
 #define DoesFileExist(RootDirectory, FileName)  \
-DoesPathExistEx((RootDirectory), (FileName), FALSE)
+DoesPathExist((RootDirectory), (FileName), FALSE)
 
 // FIXME: DEPRECATED! HACKish function that needs to be deprecated!
 BOOLEAN

Modified: branches/setup_improvements/base/setup/lib/osdetect.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/osdetect.c?rev=75636&r1=75635&r2=75636&view=diff
==
--- branches/setup_improvements/base/setup/lib/osdetect.c   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/osdetect.c   [iso-8859-1] 
Mon Aug 21 19:41:40 2017
@@ -355,7 +355,7 @@
 
 /* Check for the existence of \SystemRoot\System32 */
 PathName = L"System32\\";
-if (!DoesPathExist(SystemRootDirectory, PathName))
+if (!DoesDirExist(SystemRootDirectory, PathName))
 {
 // DPRINT1("Failed to open directory '%S', Status 0x%08lx\n", 
PathName, Status);
 return FALSE;
@@ -363,7 +363,7 @@
 
 /* Check for the existence of \SystemRoot\System32\drivers */
 PathName = L"System32\\drivers\\";
-if (!DoesPathExist(SystemRootDirectory, PathName))
+if (!DoesDirExist(SystemRootDirectory, PathName))
 {
 // DPRINT1("Failed to open directory '%S', Status 0x%08lx\n", 
PathName, Status);
 return FALSE;
@@ -371,7 +371,7 @@
 
 /* Check for the existence of \SystemRoot\System32\config */
 PathName = L"System32\\config\\";
-if (!DoesPathExist(SystemRootDirectory, PathName))
+if (!DoesDirExist(SystemRootDirectory, PathName))
 {
 // DPRINT1("Failed to open directory '%S', Status 0x%08lx\n", 
PathName, Status);
 return FALSE;

Modified: branches/setup_improvements/base/setup/usetup/filesup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/filesup.c?rev=75636&r1=75635&r2=75636&view=diff
==
--- branches/setup_improvements/base/setup/usetup/filesup.c [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/filesup.c [iso-8859-1] 
Mon Aug 21 19:41:40 2017
@@ -113,7 +113,7 @@
 *Ptr = 0;
 
 DPRINT("PathBuffer: %S\n", PathBuffer);
-if (!DoesPathExist(NULL, PathBuffer))
+if (!DoesDirExist(NULL, PathBuffer))
 {
 DPRINT("Create: %S\n", PathBuffer);
 Status = SetupCreateSingleDirectory(PathBuffer);
@@ -127,7 +127,7 @@
 Ptr++;
 }
 
-if (!DoesPathExist(NULL, PathBuffer))
+if (!DoesDirExist(NULL, PathBuffer))
 {
 DPRINT(&

[ros-diffs] [hbelusca] 75635: [SETUPLIB]: Merge DoesPathExist() and DoesFileExist() into (temporarily called) DoesPathExistEx() function, and turn the previous two functions into macros.

2017-08-21 Thread hbelusca
Author: hbelusca
Date: Mon Aug 21 19:14:33 2017
New Revision: 75635

URL: http://svn.reactos.org/svn/reactos?rev=75635&view=rev
Log:
[SETUPLIB]: Merge DoesPathExist() and DoesFileExist() into (temporarily called) 
DoesPathExistEx() function, and turn the previous two functions into macros.

Modified:
branches/setup_improvements/base/setup/lib/filesup.c
branches/setup_improvements/base/setup/lib/filesup.h

Modified: branches/setup_improvements/base/setup/lib/filesup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/filesup.c?rev=75635&r1=75634&r2=75635&view=diff
==
--- branches/setup_improvements/base/setup/lib/filesup.c[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/filesup.c[iso-8859-1] 
Mon Aug 21 19:14:33 2017
@@ -516,19 +516,17 @@
 return hr;
 }
 
-//
-// NOTE: It may be possible to merge both DoesPathExist and DoesFileExist...
-//
 BOOLEAN
-DoesPathExist(
+DoesPathExistEx(
 IN HANDLE RootDirectory OPTIONAL,
-IN PCWSTR PathName)
+IN PCWSTR PathName,
+IN BOOLEAN IsDirectory)
 {
 NTSTATUS Status;
+UNICODE_STRING Name;
 HANDLE FileHandle;
 OBJECT_ATTRIBUTES ObjectAttributes;
 IO_STATUS_BLOCK IoStatusBlock;
-UNICODE_STRING Name;
 
 RtlInitUnicodeString(&Name, PathName);
 
@@ -539,48 +537,20 @@
NULL);
 
 Status = NtOpenFile(&FileHandle,
-FILE_LIST_DIRECTORY | SYNCHRONIZE,
+IsDirectory ? (FILE_LIST_DIRECTORY | SYNCHRONIZE)
+:  FILE_GENERIC_READ, // Contains 
SYNCHRONIZE
 &ObjectAttributes,
 &IoStatusBlock,
 FILE_SHARE_READ | FILE_SHARE_WRITE,
-FILE_SYNCHRONOUS_IO_NONALERT | FILE_DIRECTORY_FILE);
+FILE_SYNCHRONOUS_IO_NONALERT |
+(IsDirectory ? FILE_DIRECTORY_FILE
+ : FILE_NON_DIRECTORY_FILE));
 if (NT_SUCCESS(Status))
 NtClose(FileHandle);
 else
-DPRINT1("Failed to open directory '%wZ', Status 0x%08lx\n", &Name, 
Status);
-
-return NT_SUCCESS(Status);
-}
-
-BOOLEAN
-DoesFileExist(
-IN HANDLE RootDirectory OPTIONAL,
-IN PCWSTR PathNameToFile)
-{
-NTSTATUS Status;
-UNICODE_STRING FileName;
-HANDLE FileHandle;
-OBJECT_ATTRIBUTES ObjectAttributes;
-IO_STATUS_BLOCK IoStatusBlock;
-
-RtlInitUnicodeString(&FileName, PathNameToFile);
-
-InitializeObjectAttributes(&ObjectAttributes,
-   &FileName,
-   OBJ_CASE_INSENSITIVE,
-   RootDirectory,
-   NULL);
-
-Status = NtOpenFile(&FileHandle,
-FILE_GENERIC_READ, // Contains SYNCHRONIZE
-&ObjectAttributes,
-&IoStatusBlock,
-FILE_SHARE_READ | FILE_SHARE_WRITE,
-FILE_SYNCHRONOUS_IO_NONALERT | 
FILE_NON_DIRECTORY_FILE);
-if (NT_SUCCESS(Status))
-NtClose(FileHandle);
-else
-DPRINT1("Failed to open file '%wZ', Status 0x%08lx\n", &FileName, 
Status);
+DPRINT1("Failed to open %s '%wZ', Status 0x%08lx\n",
+IsDirectory ? "directory" : "file",
+&Name, Status);
 
 return NT_SUCCESS(Status);
 }

Modified: branches/setup_improvements/base/setup/lib/filesup.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/filesup.h?rev=75635&r1=75634&r2=75635&view=diff
==
--- branches/setup_improvements/base/setup/lib/filesup.h[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/filesup.h[iso-8859-1] 
Mon Aug 21 19:14:33 2017
@@ -63,14 +63,16 @@
 IN /* PCWSTR */ ...);
 
 BOOLEAN
-DoesPathExist(
+DoesPathExistEx(
 IN HANDLE RootDirectory OPTIONAL,
-IN PCWSTR PathName);
+IN PCWSTR PathName,
+IN BOOLEAN IsDirectory);
 
-BOOLEAN
-DoesFileExist(
-IN HANDLE RootDirectory OPTIONAL,
-IN PCWSTR PathNameToFile);
+#define DoesPathExist(RootDirectory, PathName)  \
+DoesPathExistEx((RootDirectory), (PathName), TRUE)
+
+#define DoesFileExist(RootDirectory, FileName)  \
+DoesPathExistEx((RootDirectory), (FileName), FALSE)
 
 // FIXME: DEPRECATED! HACKish function that needs to be deprecated!
 BOOLEAN




[ros-diffs] [hbelusca] 75632: [SETUPLIB]: Factor out and introduce a ParseArcName() helper function that does its job. Used in exiting code and in later code in this file.

2017-08-20 Thread hbelusca
Author: hbelusca
Date: Sun Aug 20 21:30:13 2017
New Revision: 75632

URL: http://svn.reactos.org/svn/reactos?rev=75632&view=rev
Log:
[SETUPLIB]: Factor out and introduce a ParseArcName() helper function that does 
its job. Used in exiting code and in later code in this file.

Modified:
branches/setup_improvements/base/setup/lib/arcname.c

Modified: branches/setup_improvements/base/setup/lib/arcname.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/arcname.c?rev=75632&r1=75631&r2=75632&view=diff
==
--- branches/setup_improvements/base/setup/lib/arcname.c[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/arcname.c[iso-8859-1] 
Sun Aug 20 21:30:13 2017
@@ -345,6 +345,218 @@
 
 
 /*
+ * ArcNamePath:
+ *  In input, pointer to an ARC path (NULL-terminated) starting by an
+ *  ARC name to be parsed into its different components.
+ *  In output, ArcNamePath points to the beginning of the path after
+ *  the ARC name part.
+ */
+static NTSTATUS
+ParseArcName(
+IN OUT PCWSTR* ArcNamePath,
+OUT PULONG pAdapterKey,
+OUT PULONG pControllerKey,
+OUT PULONG pPeripheralKey,
+OUT PULONG pPartitionNumber,
+OUT PADAPTER_TYPE pAdapterType,
+OUT PCONTROLLER_TYPE pControllerType,
+OUT PPERIPHERAL_TYPE pPeripheralType,
+OUT PBOOLEAN pUseSignature)
+{
+WCHAR TokenBuffer[50];
+UNICODE_STRING Token;
+PCWSTR p, q;
+ULONG AdapterKey;
+ULONG ControllerKey;
+ULONG PeripheralKey;
+ULONG PartitionNumber;
+ADAPTER_TYPE AdapterType;
+CONTROLLER_TYPE ControllerType;
+PERIPHERAL_TYPE PeripheralType;
+BOOLEAN UseSignature = FALSE;
+
+/*
+ * The format of ArcName is:
+ *
adapter(www)[controller(xxx)peripheral(yyy)[partition(zzz)][filepath]] ,
+ * where the [filepath] part is not being parsed.
+ */
+
+RtlInitEmptyUnicodeString(&Token, TokenBuffer, sizeof(TokenBuffer));
+
+p = *ArcNamePath;
+
+/* Retrieve the adapter */
+p = ArcGetNextTokenU(p, &Token, &AdapterKey);
+if (!p)
+{
+DPRINT1("No adapter specified!\n");
+return STATUS_OBJECT_PATH_SYNTAX_BAD;
+}
+
+/* Check for the 'signature()' pseudo-adapter, introduced in Windows 2000 
*/
+if (_wcsicmp(Token.Buffer, L"signature") == 0)
+{
+/*
+ * We've got a signature! Remember this for later, and set the adapter 
type to SCSI.
+ * We however check that the rest of the ARC path is valid by parsing 
the other tokens.
+ * AdapterKey stores the disk signature value (that holds in a ULONG).
+ */
+UseSignature = TRUE;
+AdapterType = ScsiAdapter;
+}
+else
+{
+/* Check for regular adapters */
+AdapterType = 
(ADAPTER_TYPE)/*ArcMatchTokenU*/ArcMatchToken_UStr(/*Token.Buffer*/&Token, 
AdapterTypes_U);
+if (AdapterType >= AdapterTypeMax)
+{
+DPRINT1("Invalid adapter type %wZ\n", &Token);
+return STATUS_OBJECT_NAME_INVALID;
+}
+
+/* Check for adapters that don't take any extra controller or 
peripheral nodes */
+if (AdapterType == NetAdapter || AdapterType == RamdiskAdapter)
+{
+// if (*p)
+// return STATUS_OBJECT_PATH_SYNTAX_BAD;
+
+if (AdapterType == NetAdapter)
+{
+DPRINT1("%S(%lu) path is not supported!\n", 
AdapterTypes_U[AdapterType], AdapterKey);
+return STATUS_NOT_SUPPORTED;
+}
+
+goto Quit;
+}
+}
+
+/* Here, we have either an 'eisa', a 'scsi/signature', or a 'multi' 
adapter */
+
+/* Check for a valid controller */
+p = ArcGetNextTokenU(p, &Token, &ControllerKey);
+if (!p)
+{
+DPRINT1("%S(%lu) adapter doesn't have a controller!\n", 
AdapterTypes_U[AdapterType], AdapterKey);
+return STATUS_OBJECT_PATH_SYNTAX_BAD;
+}
+ControllerType = 
(CONTROLLER_TYPE)/*ArcMatchTokenU*/ArcMatchToken_UStr(/*Token.Buffer*/&Token, 
ControllerTypes_U);
+if (ControllerType >= ControllerTypeMax)
+{
+DPRINT1("Invalid controller type %wZ\n", &Token);
+return STATUS_OBJECT_NAME_INVALID;
+}
+
+/* Here the controller can only be either a disk or a CDROM */
+
+/*
+ * Ignore the controller in case we have a 'multi' adapter.
+ * I guess a similar condition holds for the 'eisa' adapter too...
+ *
+ * For SignatureAdapter, as similar for ScsiAdapter, the controller key 
corresponds
+ * to the disk target ID. Note that actually, the implementation just 
ignores the
+ * target ID, as well as the LUN, and just loops over all the available 
disks and
+

[ros-diffs] [hbelusca] 75631: [SETUPLIB]: Code formatting (cut out the too long lines).

2017-08-20 Thread hbelusca
Author: hbelusca
Date: Sun Aug 20 21:02:24 2017
New Revision: 75631

URL: http://svn.reactos.org/svn/reactos?rev=75631&view=rev
Log:
[SETUPLIB]: Code formatting (cut out the too long lines).

Modified:
branches/setup_improvements/base/setup/lib/arcname.c

Modified: branches/setup_improvements/base/setup/lib/arcname.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/arcname.c?rev=75631&r1=75630&r2=75631&view=diff
==
--- branches/setup_improvements/base/setup/lib/arcname.c[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/arcname.c[iso-8859-1] 
Sun Aug 20 21:02:24 2017
@@ -32,6 +32,8 @@
 #include 
 
 
+/* TYPEDEFS */
+
 /* Supported adapter types */
 typedef enum _ADAPTER_TYPE
 {
@@ -110,7 +112,7 @@
 
 /* FUNCTIONS /
 
-PCSTR
+/* static */ PCSTR
 ArcGetNextTokenA(
 IN  PCSTR ArcPath,
 OUT PANSI_STRING TokenSpecifier,
@@ -170,7 +172,7 @@
 return ++p;
 }
 
-PCWSTR
+static PCWSTR
 ArcGetNextTokenU(
 IN  PCWSTR ArcPath,
 OUT PUNICODE_STRING TokenSpecifier,
@@ -233,7 +235,7 @@
 }
 
 
-ULONG
+/* static */ ULONG
 ArcMatchTokenA(
 IN PCSTR CandidateToken,
 IN const PCSTR* TokenTable)
@@ -248,7 +250,7 @@
 return Index;
 }
 
-ULONG
+static ULONG
 ArcMatchTokenU(
 IN PCWSTR CandidateToken,
 IN const PCWSTR* TokenTable)
@@ -263,7 +265,7 @@
 return Index;
 }
 
-ULONG
+static ULONG
 ArcMatchToken_UStr(
 IN PCUNICODE_STRING CandidateToken,
 IN const PCWSTR* TokenTable)
@@ -527,7 +529,8 @@
 return STATUS_NOT_SUPPORTED;
 }
 
-hr = StringCbPrintfW(NtName->Buffer, NtName->MaximumLength, 
L"\\Device\\Ramdisk%lu", AdapterKey);
+hr = StringCbPrintfW(NtName->Buffer, NtName->MaximumLength,
+ L"\\Device\\Ramdisk%lu", AdapterKey);
 goto Quit;
 }
 }
@@ -646,14 +649,23 @@
 
 
 if (ControllerType == CdRomController) // and so, AdapterType == 
ScsiAdapter and PeripheralType == FDiskPeripheral
-hr = StringCbPrintfW(NtName->Buffer, NtName->MaximumLength, 
L"\\Device\\Scsi\\CdRom%lu", ControllerKey);
+{
+hr = StringCbPrintfW(NtName->Buffer, NtName->MaximumLength,
+ L"\\Device\\Scsi\\CdRom%lu", ControllerKey);
+}
 else
 /* Now, ControllerType == DiskController */
 if (PeripheralType == CdRomPeripheral)
-hr = StringCbPrintfW(NtName->Buffer, NtName->MaximumLength, 
L"\\Device\\CdRom%lu", PeripheralKey);
+{
+hr = StringCbPrintfW(NtName->Buffer, NtName->MaximumLength,
+ L"\\Device\\CdRom%lu", PeripheralKey);
+}
 else
 if (PeripheralType == FDiskPeripheral)
-hr = StringCbPrintfW(NtName->Buffer, NtName->MaximumLength, 
L"\\Device\\Floppy%lu", PeripheralKey);
+{
+hr = StringCbPrintfW(NtName->Buffer, NtName->MaximumLength,
+ L"\\Device\\Floppy%lu", PeripheralKey);
+}
 else
 if (PeripheralType == RDiskPeripheral)
 {
@@ -678,7 +690,8 @@
 ASSERT(PartEntry->DiskEntry == DiskEntry);
 }
 
-hr = StringCbPrintfW(NtName->Buffer, NtName->MaximumLength, 
L"\\Device\\Harddisk%lu\\Partition%lu",
+hr = StringCbPrintfW(NtName->Buffer, NtName->MaximumLength,
+ L"\\Device\\Harddisk%lu\\Partition%lu",
  DiskEntry->DiskNumber, PartitionNumber);
 }
 #if 0
@@ -686,7 +699,8 @@
 if (PeripheralType == VDiskPeripheral)
 {
 // TODO: Check how Win 7+ deals with virtual disks.
-hr = StringCbPrintfW(NtName->Buffer, NtName->MaximumLength, 
L"\\Device\\VirtualHarddisk%lu\\Partition%lu",
+hr = StringCbPrintfW(NtName->Buffer, NtName->MaximumLength,
+ L"\\Device\\VirtualHarddisk%lu\\Partition%lu",
  PeripheralKey, PartitionNumber);
 }
 #endif




[ros-diffs] [hbelusca] 75628: [BROWSEUI]: Improve the rendering of the toolbar pin buttons. By dsp8195. Sorry for the delay! CORE-10838

2017-08-20 Thread hbelusca
Author: hbelusca
Date: Sun Aug 20 12:05:25 2017
New Revision: 75628

URL: http://svn.reactos.org/svn/reactos?rev=75628&view=rev
Log:
[BROWSEUI]: Improve the rendering of the toolbar pin buttons. By dsp8195. Sorry 
for the delay!
CORE-10838

Modified:
trunk/reactos/dll/win32/browseui/res/barbtn.bmp

Modified: trunk/reactos/dll/win32/browseui/res/barbtn.bmp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/res/barbtn.bmp?rev=75628&r1=75627&r2=75628&view=diff
==
Binary files - no diff available.




[ros-diffs] [hbelusca] 75545: [USETUP]: Sync with tfaber's r75536.

2017-08-14 Thread hbelusca
Author: hbelusca
Date: Mon Aug 14 17:11:50 2017
New Revision: 75545

URL: http://svn.reactos.org/svn/reactos?rev=75545&view=rev
Log:
[USETUP]: Sync with tfaber's r75536.

Modified:
branches/setup_improvements/base/setup/usetup/cabinet.c

Modified: branches/setup_improvements/base/setup/usetup/cabinet.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/cabinet.c?rev=75545&r1=75544&r2=75545&view=diff
==
--- branches/setup_improvements/base/setup/usetup/cabinet.c [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/cabinet.c [iso-8859-1] 
Mon Aug 14 17:11:50 2017
@@ -544,7 +544,7 @@
 
 if (!NT_SUCCESS(NtStatus))
 {
-DPRINT1("NtCreateSection failed: %x\n", NtStatus);
+DPRINT1("NtCreateSection failed for %ls: %x\n", CabinetName, 
NtStatus);
 return CAB_STATUS_NOMEMORY;
 }
 
@@ -954,7 +954,7 @@
 
 if (!NT_SUCCESS(NtStatus))
 {
-DPRINT1("NtCreateSection failed: %x\n", NtStatus);
+DPRINT1("NtCreateSection failed for %ls: %x\n", DestName, NtStatus);
 Status = CAB_STATUS_NOMEMORY;
 goto CloseDestFile;
 }




[ros-diffs] [hbelusca] 75544: [REACTOS]: Adapt the 1st-stage GUI setup to compile with the setuplib.

2017-08-14 Thread hbelusca
Author: hbelusca
Date: Mon Aug 14 17:06:19 2017
New Revision: 75544

URL: http://svn.reactos.org/svn/reactos?rev=75544&view=rev
Log:
[REACTOS]: Adapt the 1st-stage GUI setup to compile with the setuplib.

Added:
branches/setup_improvements/base/setup/reactos/inffile.c   (with props)
Modified:
branches/setup_improvements/base/setup/reactos/CMakeLists.txt
branches/setup_improvements/base/setup/reactos/drivepage.c
branches/setup_improvements/base/setup/reactos/reactos.c
branches/setup_improvements/base/setup/reactos/reactos.h

Modified: branches/setup_improvements/base/setup/reactos/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/reactos/CMakeLists.txt?rev=75544&r1=75543&r2=75544&view=diff
==
--- branches/setup_improvements/base/setup/reactos/CMakeLists.txt   
[iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/reactos/CMakeLists.txt   
[iso-8859-1] Mon Aug 14 17:06:19 2017
@@ -1,14 +1,22 @@
+
+include_directories(
+${CMAKE_CURRENT_SOURCE_DIR}
+${CMAKE_CURRENT_SOURCE_DIR}/../lib
+#${REACTOS_SOURCE_DIR}/base/setup/lib
+${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/zlib
+${REACTOS_SOURCE_DIR}/sdk/include/reactos/drivers)
 
 list(APPEND SOURCE
 drivepage.c
+inffile.c
 reactos.c
 reactos.h)
 
 file(GLOB reactos_rc_deps res/*.*)
 add_rc_deps(reactos.rc ${reactos_rc_deps})
 add_executable(reactos ${SOURCE} reactos.rc)
+set_module_type(reactos win32gui UNICODE)
 add_pch(reactos reactos.h SOURCE)
-target_link_libraries(reactos uuid)
-set_module_type(reactos win32gui UNICODE)
+target_link_libraries(reactos uuid setuplib)
 add_importlibs(reactos advapi32 gdi32 user32 comctl32 setupapi msvcrt kernel32 
ntdll)
 add_cd_file(TARGET reactos DESTINATION reactos NO_CAB FOR bootcd)

Modified: branches/setup_improvements/base/setup/reactos/drivepage.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/reactos/drivepage.c?rev=75544&r1=75543&r2=75544&view=diff
==
--- branches/setup_improvements/base/setup/reactos/drivepage.c  [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/reactos/drivepage.c  [iso-8859-1] 
Mon Aug 14 17:06:19 2017
@@ -58,7 +58,7 @@
 SendMessage(GetDlgItem(hwndDlg, IDC_PATH),
 WM_SETTEXT,
 (WPARAM)0,
-(LPARAM)pSetupData->InstallDir);
+(LPARAM)pSetupData->USetupData.InstallationDirectory);
 break;
 
 case WM_COMMAND:
@@ -67,8 +67,8 @@
 case IDOK:
 SendMessage(GetDlgItem(hwndDlg, IDC_PATH),
 WM_GETTEXT,
-(WPARAM)sizeof(pSetupData->InstallDir) / 
sizeof(TCHAR),
-(LPARAM)pSetupData->InstallDir);
+
(WPARAM)sizeof(pSetupData->USetupData.InstallationDirectory) / sizeof(TCHAR),
+
(LPARAM)pSetupData->USetupData.InstallationDirectory);
 
 EndDialog(hwndDlg, IDOK);
 return TRUE;

Added: branches/setup_improvements/base/setup/reactos/inffile.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/reactos/inffile.c?rev=75544
==
--- branches/setup_improvements/base/setup/reactos/inffile.c(added)
+++ branches/setup_improvements/base/setup/reactos/inffile.c[iso-8859-1] 
Mon Aug 14 17:06:19 2017
@@ -0,0 +1,71 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT: ReactOS text-mode setup
+ * FILE:base/setup/usetup/inffile.c
+ * PURPOSE: .inf files support functions
+ * PROGRAMMERS: Hervé Poussineau
+ *  Hermes Belusca-Maito (hermes.belu...@sfr.fr)
+ */
+
+/* INCLUDES **/
+
+#include "reactos.h"
+
+#define NDEBUG
+#include 
+
+/* SETUP* API COMPATIBILITY FUNCTIONS /
+
+/* Functions from the INFLIB library */
+
+/* SetupOpenInfFileW with support for a user-provided LCID */
+HINF
+WINAPI
+SetupOpenInfFileExW(
+IN PCWSTR FileName,
+IN PCWSTR InfClass,
+IN DWORD InfStyle,
+IN LCID LocaleId,
+OUT PUINT ErrorLine)
+{
+UNREFERENCED_PARAMETER(LocaleId);
+return SetupOpenInfFileW(FileName, InfClass, InfStyle, ErrorLine);
+}
+
+
+/* HELPER FUNCTIONS **/
+
+#if 0
+
+HINF WINAPI
+INF_OpenBufferedFileA(
+IN PSTR FileBuffer,
+IN ULONG FileSize,
+IN PCSTR InfClass,
+IN DWORD InfStyle,
+IN LCID LocaleId,
+OUT PUINT

[ros-diffs] [hbelusca] 75540: [USETUP]: Sync with hpoussin's r75532, and add the corresponding INF_FreeData().

2017-08-14 Thread hbelusca
Author: hbelusca
Date: Mon Aug 14 16:33:55 2017
New Revision: 75540

URL: http://svn.reactos.org/svn/reactos?rev=75540&view=rev
Log:
[USETUP]: Sync with hpoussin's r75532, and add the corresponding INF_FreeData().

Modified:
branches/setup_improvements/base/setup/usetup/devinst.c

Modified: branches/setup_improvements/base/setup/usetup/devinst.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/devinst.c?rev=75540&r1=75539&r2=75540&view=diff
==
--- branches/setup_improvements/base/setup/usetup/devinst.c [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/devinst.c [iso-8859-1] 
Mon Aug 14 16:33:55 2017
@@ -50,39 +50,43 @@
 OBJECT_ATTRIBUTES ObjectAttributes;
 HANDLE hService;
 INFCONTEXT Context;
-PWSTR Driver, ImagePath, FullImagePath;
+PWSTR Driver, ClassGuid, ImagePath, FullImagePath;
 ULONG dwValue;
 ULONG Disposition;
 NTSTATUS Status;
 BOOLEAN deviceInstalled = FALSE;
 UNICODE_STRING UpperFiltersU = RTL_CONSTANT_STRING(L"UpperFilters");
 PWSTR keyboardClass = L"kbdclass\0";
-BOOLEAN keyboardDevice = FALSE;
 
 /* Check if we know the hardware */
 if (!SetupFindFirstLineW(hInf, L"HardwareIdsDatabase", HardwareId, 
&Context))
 return FALSE;
 if (!INF_GetDataField(&Context, 1, &Driver))
 return FALSE;
+
+/* Get associated class GUID (if any) */
+if (!INF_GetDataField(&Context, 2, &ClassGuid))
+ClassGuid = NULL;
 
 /* Find associated driver name */
 /* FIXME: check in other sections too! */
 if (!SetupFindFirstLineW(hInf, L"BootBusExtenders.Load", Driver, &Context)
  && !SetupFindFirstLineW(hInf, L"BusExtenders.Load", Driver, &Context)
  && !SetupFindFirstLineW(hInf, L"SCSI.Load", Driver, &Context)
- && !SetupFindFirstLineW(hInf, L"InputDevicesSupport.Load", Driver, 
&Context))
-{
-if (!SetupFindFirstLineW(hInf, L"Keyboard.Load", Driver, &Context))
-{
-INF_FreeData(Driver);
-return FALSE;
-}
-
-keyboardDevice = TRUE;
+ && !SetupFindFirstLineW(hInf, L"InputDevicesSupport.Load", Driver, 
&Context)
+ && !SetupFindFirstLineW(hInf, L"Keyboard.Load", Driver, &Context))
+{
+INF_FreeData(ClassGuid);
+INF_FreeData(Driver);
+return FALSE;
 }
 
 if (!INF_GetDataField(&Context, 1, &ImagePath))
-return FALSE;
+{
+INF_FreeData(ClassGuid);
+INF_FreeData(Driver);
+return FALSE;
+}
 
 /* Prepare full driver path */
 dwValue = PathPrefix.MaximumLength + wcslen(ImagePath) * sizeof(WCHAR);
@@ -91,6 +95,7 @@
 {
 DPRINT1("RtlAllocateHeap() failed\n");
 INF_FreeData(ImagePath);
+INF_FreeData(ClassGuid);
 INF_FreeData(Driver);
 return FALSE;
 }
@@ -108,6 +113,7 @@
 DPRINT1("NtCreateKey('%wZ') failed with status 0x%08x\n", &StringU, 
Status);
 RtlFreeHeap(ProcessHeap, 0, FullImagePath);
 INF_FreeData(ImagePath);
+INF_FreeData(ClassGuid);
 INF_FreeData(Driver);
 return FALSE;
 }
@@ -149,7 +155,7 @@
 
 INF_FreeData(ImagePath);
 
-if (keyboardDevice)
+if (ClassGuid &&_wcsicmp(ClassGuid, 
L"{4D36E96B-E325-11CE-BFC1-08002BE10318}") == 0)
 {
 DPRINT1("Installing keyboard class driver for '%S'\n", DeviceId);
 NtSetValueKey(hDeviceKey,
@@ -159,6 +165,8 @@
   keyboardClass,
   (wcslen(keyboardClass) + 2) * sizeof(WCHAR));
 }
+
+INF_FreeData(ClassGuid);
 
 /* Associate device with the service we just filled */
 Status = NtSetValueKey(hDeviceKey,




[ros-diffs] [hbelusca] 75539: [USETUP]: Close the txtsetup.sif file at the end of the operations.

2017-08-14 Thread hbelusca
Author: hbelusca
Date: Mon Aug 14 16:32:39 2017
New Revision: 75539

URL: http://svn.reactos.org/svn/reactos?rev=75539&view=rev
Log:
[USETUP]: Close the txtsetup.sif file at the end of the operations.

Modified:
branches/setup_improvements/base/setup/usetup/usetup.c

Modified: branches/setup_improvements/base/setup/usetup/usetup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/usetup.c?rev=75539&r1=75538&r2=75539&view=diff
==
--- branches/setup_improvements/base/setup/usetup/usetup.c  [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/usetup.c  [iso-8859-1] 
Mon Aug 14 16:32:39 2017
@@ -4791,6 +4791,8 @@
 }
 }
 
+SetupCloseInfFile(SetupInf);
+
 if (Page == RECOVERY_PAGE)
 RecoveryConsole();
 




[ros-diffs] [hbelusca] 75538: [USETUP]: Addendum to 75537.

2017-08-14 Thread hbelusca
Author: hbelusca
Date: Mon Aug 14 16:31:55 2017
New Revision: 75538

URL: http://svn.reactos.org/svn/reactos?rev=75538&view=rev
Log:
[USETUP]: Addendum to 75537.

Modified:
branches/setup_improvements/base/setup/usetup/inffile.c

Modified: branches/setup_improvements/base/setup/usetup/inffile.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/inffile.c?rev=75538&r1=75537&r2=75538&view=diff
==
--- branches/setup_improvements/base/setup/usetup/inffile.c [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/inffile.c [iso-8859-1] 
Mon Aug 14 16:31:55 2017
@@ -132,13 +132,13 @@
   ULONG FieldIndex,
   INT *IntegerValue);
 // #define SetupGetIntField InfGetIntField
-BOOLEAN
+BOOL
 WINAPI
 SetupGetIntField(PINFCONTEXT Context,
  ULONG FieldIndex,
- INT *IntegerValue)
-{
-return InfGetIntField(Context, FieldIndex, IntegerValue);
+ INT *IntegerValue) // PINT
+{
+return !!InfGetIntField(Context, FieldIndex, IntegerValue);
 }
 
 extern BOOLEAN InfGetMultiSzField(PINFCONTEXT Context,




[ros-diffs] [hbelusca] 75537: [SETUPLIB]: Fix compilation errors when using these headers with usetup (that doesn't use setupapi.dll) and "reactos" (the 1st-stage GUI installer, which uses setupapi.dl

2017-08-14 Thread hbelusca
Author: hbelusca
Date: Mon Aug 14 16:29:01 2017
New Revision: 75537

URL: http://svn.reactos.org/svn/reactos?rev=75537&view=rev
Log:
[SETUPLIB]: Fix compilation errors when using these headers with usetup (that 
doesn't use setupapi.dll) and "reactos" (the 1st-stage GUI installer, which 
uses setupapi.dll).

Modified:
branches/setup_improvements/base/setup/lib/errorcode.h
branches/setup_improvements/base/setup/lib/infsupp.h

Modified: branches/setup_improvements/base/setup/lib/errorcode.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/errorcode.h?rev=75537&r1=75536&r2=75537&view=diff
==
--- branches/setup_improvements/base/setup/lib/errorcode.h  [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/errorcode.h  [iso-8859-1] 
Mon Aug 14 16:29:01 2017
@@ -8,7 +8,12 @@
 
 #pragma once
 
-typedef enum
+/* setupapi.h defines ERROR_NOT_INSTALLED with another meaning */
+#ifdef ERROR_NOT_INSTALLED
+#undef ERROR_NOT_INSTALLED
+#endif
+
+typedef enum _ERROR_NUMBER
 {
 NOT_AN_ERROR = 0,   // ERROR_SUCCESS,
 ERROR_NOT_INSTALLED,

Modified: branches/setup_improvements/base/setup/lib/infsupp.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/infsupp.h?rev=75537&r1=75536&r2=75537&view=diff
==
--- branches/setup_improvements/base/setup/lib/infsupp.h[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/infsupp.h[iso-8859-1] 
Mon Aug 14 16:29:01 2017
@@ -8,13 +8,14 @@
 
 #pragma once
 
+/* Make setupapi.h to not define the API as exports to the DLL */
 #ifdef __REACTOS__
 #define _SETUPAPI_
 #endif
 
 // FIXME: Temporary measure until all the users of this header
 // (usetup...) use or define SetupAPI-conforming APIs.
-#if 0
+#if defined(_SETUPAPI_H_) || defined(_INC_SETUPAPI)
 
 #include 
 
@@ -64,11 +65,11 @@
 PULONG RequiredSize);
 
 // #define SetupGetIntField InfGetIntField
-BOOLEAN
+BOOL
 WINAPI
 SetupGetIntField(PINFCONTEXT Context,
  ULONG FieldIndex,
- INT *IntegerValue);
+ INT *IntegerValue); // PINT
 
 // #define SetupGetMultiSzFieldW InfGetMultiSzField
 BOOL




[ros-diffs] [hbelusca] 75527: [EVTLIB]: Allow specifying a memory allocation tag when freeing the allocated buffers (functionality similar to the Ex**WithTag kernel functions). [EVENTLOG]: Use the pre

2017-08-11 Thread hbelusca
Author: hbelusca
Date: Fri Aug 11 12:37:15 2017
New Revision: 75527

URL: http://svn.reactos.org/svn/reactos?rev=75527&view=rev
Log:
[EVTLIB]: Allow specifying a memory allocation tag when freeing the allocated 
buffers (functionality similar to the Ex**WithTag kernel functions).
[EVENTLOG]: Use the previous functionality; use also the internal LogfpAlloc() 
/ LogfpFree() functions when dealing with buffers related to event log files.

Modified:
trunk/reactos/base/services/eventlog/eventlog.h
trunk/reactos/base/services/eventlog/file.c
trunk/reactos/sdk/lib/evtlib/evtlib.c
trunk/reactos/sdk/lib/evtlib/evtlib.h

Modified: trunk/reactos/base/services/eventlog/eventlog.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/eventlog.h?rev=75527&r1=75526&r2=75527&view=diff
==
--- trunk/reactos/base/services/eventlog/eventlog.h [iso-8859-1] (original)
+++ trunk/reactos/base/services/eventlog/eventlog.h [iso-8859-1] Fri Aug 11 
12:37:15 2017
@@ -142,7 +142,7 @@
 
 static __inline void LogfFreeRecord(PEVENTLOGRECORD Record)
 {
-HeapFree(GetProcessHeap(), 0, Record);
+RtlFreeHeap(GetProcessHeap(), 0, Record);
 }
 
 VOID

Modified: trunk/reactos/base/services/eventlog/file.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/file.c?rev=75527&r1=75526&r2=75527&view=diff
==
--- trunk/reactos/base/services/eventlog/file.c [iso-8859-1] (original)
+++ trunk/reactos/base/services/eventlog/file.c [iso-8859-1] Fri Aug 11 
12:37:15 2017
@@ -167,8 +167,10 @@
 static
 VOID NTAPI
 LogfpFree(IN PVOID Ptr,
-  IN ULONG Flags)
-{
+  IN ULONG Flags,
+  IN ULONG Tag)
+{
+UNREFERENCED_PARAMETER(Tag);
 RtlFreeHeap(GetProcessHeap(), Flags, Ptr);
 }
 
@@ -305,7 +307,7 @@
 SIZE_T LogNameLen;
 BOOLEAN CreateNew;
 
-pLogFile = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, 
sizeof(*pLogFile));
+pLogFile = LogfpAlloc(sizeof(*pLogFile), HEAP_ZERO_MEMORY, TAG_ELF);
 if (!pLogFile)
 {
 DPRINT1("Cannot allocate heap!\n");
@@ -313,9 +315,7 @@
 }
 
 LogNameLen = (LogName ? wcslen(LogName) : 0) + 1;
-pLogFile->LogName = RtlAllocateHeap(GetProcessHeap(),
-HEAP_ZERO_MEMORY,
-LogNameLen * sizeof(WCHAR));
+pLogFile->LogName = LogfpAlloc(LogNameLen * sizeof(WCHAR), 
HEAP_ZERO_MEMORY, 0);
 if (pLogFile->LogName == NULL)
 {
 DPRINT1("Cannot allocate heap\n");
@@ -412,9 +412,9 @@
 NtClose(pLogFile->FileHandle);
 
 if (pLogFile->LogName)
-RtlFreeHeap(GetProcessHeap(), 0, pLogFile->LogName);
-
-RtlFreeHeap(GetProcessHeap(), 0, pLogFile);
+LogfpFree(pLogFile->LogName, 0, 0);
+
+LogfpFree(pLogFile, 0, TAG_ELF);
 }
 else
 {
@@ -440,11 +440,11 @@
 
 ElfCloseFile(&LogFile->LogFile);
 NtClose(LogFile->FileHandle);
-RtlFreeHeap(GetProcessHeap(), 0, LogFile->LogName);
+LogfpFree(LogFile->LogName, 0, 0);
 
 RtlDeleteResource(&LogFile->Lock);
 
-RtlFreeHeap(GetProcessHeap(), 0, LogFile);
+LogfpFree(LogFile, 0, TAG_ELF);
 
 return;
 }
@@ -583,7 +583,7 @@
 if (BytesNeeded)
 *BytesNeeded = 0;
 
-UnicodeBuffer = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, 
BufSize);
+UnicodeBuffer = LogfpAlloc(BufSize, HEAP_ZERO_MEMORY, TAG_ELF_BUF);
 if (UnicodeBuffer == NULL)
 {
 DPRINT1("Alloc failed!\n");
@@ -705,7 +705,7 @@
 Status = STATUS_SUCCESS;
 
 Quit:
-RtlFreeHeap(GetProcessHeap(), 0, UnicodeBuffer);
+LogfpFree(UnicodeBuffer, 0, TAG_ELF_BUF);
 
 return Status;
 }

Modified: trunk/reactos/sdk/lib/evtlib/evtlib.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/evtlib/evtlib.c?rev=75527&r1=75526&r2=75527&view=diff
==
--- trunk/reactos/sdk/lib/evtlib/evtlib.c   [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/evtlib/evtlib.c   [iso-8859-1] Fri Aug 11 
12:37:15 2017
@@ -2,8 +2,8 @@
  * PROJECT: ReactOS EventLog File Library
  * LICENSE: GPL - See COPYING in the top level directory
  * FILE:sdk/lib/evtlib/evtlib.c
- * PURPOSE: Provides a library for reading and writing EventLog files
- *  in the NT <= 5.2 (.evt) format.
+ * PURPOSE: Provides functionality for reading and writing
+ *  EventLog files in the NT <= 5.2 (.evt) format.
  * PROGRAMMERS: Copyright 2005 Saveliy Tretiakov
  *  Michael Martin
  *  Hermes Belusca-Maito
@@ -238,7 +238,7 @@
 RtlCopyMemory(Ne

[ros-diffs] [hbelusca] 75526: [USETUP]: Move the files in ./interface/ back into the main directory, since (almost) all of the usetup source files concerns the user interface of the setup program...

2017-08-11 Thread hbelusca
Author: hbelusca
Date: Fri Aug 11 11:31:46 2017
New Revision: 75526

URL: http://svn.reactos.org/svn/reactos?rev=75526&view=rev
Log:
[USETUP]: Move the files in ./interface/ back into the main directory, since 
(almost) all of the usetup source files concerns the user interface of the 
setup program...

Added:
branches/setup_improvements/base/setup/usetup/consup.c
  - copied, changed from r75525, 
branches/setup_improvements/base/setup/usetup/interface/consup.c
branches/setup_improvements/base/setup/usetup/consup.h
  - copied, changed from r75525, 
branches/setup_improvements/base/setup/usetup/interface/consup.h
branches/setup_improvements/base/setup/usetup/devinst.c
  - copied, changed from r75525, 
branches/setup_improvements/base/setup/usetup/interface/devinst.c
branches/setup_improvements/base/setup/usetup/usetup.c
  - copied, changed from r75525, 
branches/setup_improvements/base/setup/usetup/interface/usetup.c
Removed:
branches/setup_improvements/base/setup/usetup/interface/
Modified:
branches/setup_improvements/base/setup/usetup/CMakeLists.txt
branches/setup_improvements/base/setup/usetup/usetup.h

Modified: branches/setup_improvements/base/setup/usetup/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/CMakeLists.txt?rev=75526&r1=75525&r2=75526&view=diff
==
--- branches/setup_improvements/base/setup/usetup/CMakeLists.txt
[iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/CMakeLists.txt
[iso-8859-1] Fri Aug 11 11:31:46 2017
@@ -10,9 +10,6 @@
 ${REACTOS_SOURCE_DIR}/sdk/include/reactos/drivers)
 
 list(APPEND SOURCE
-interface/usetup.c
-interface/devinst.c
-interface/consup.c
 native/console.c
 native/keytrans.c
 native/host_native.c
@@ -20,6 +17,8 @@
 cabinet.c
 chkdsk.c
 cmdcons.c
+consup.c
+devinst.c
 filesup.c
 filequeue.c
 format.c
@@ -30,6 +29,7 @@
 partlist.c
 progress.c
 settings.c
+usetup.c
 usetup.h)
 
 if(CMAKE_C_COMPILER_ID STREQUAL "Clang")

Copied: branches/setup_improvements/base/setup/usetup/consup.c (from r75525, 
branches/setup_improvements/base/setup/usetup/interface/consup.c)
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/consup.c?p2=branches/setup_improvements/base/setup/usetup/consup.c&p1=branches/setup_improvements/base/setup/usetup/interface/consup.c&r1=75525&r2=75526&rev=75526&view=diff
==
--- branches/setup_improvements/base/setup/usetup/interface/consup.c
[iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/consup.c  [iso-8859-1] 
Fri Aug 11 11:31:46 2017
@@ -19,7 +19,7 @@
 /*
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT: ReactOS text-mode setup
- * FILE:base/setup/usetup/interface/consup.c
+ * FILE:base/setup/usetup/consup.c
  * PURPOSE: Console support functions
  * PROGRAMMER:  Eric Kohl
  */

Copied: branches/setup_improvements/base/setup/usetup/consup.h (from r75525, 
branches/setup_improvements/base/setup/usetup/interface/consup.h)
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/consup.h?p2=branches/setup_improvements/base/setup/usetup/consup.h&p1=branches/setup_improvements/base/setup/usetup/interface/consup.h&r1=75525&r2=75526&rev=75526&view=diff
==
--- branches/setup_improvements/base/setup/usetup/interface/consup.h
[iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/consup.h  [iso-8859-1] 
Fri Aug 11 11:31:46 2017
@@ -19,7 +19,7 @@
 /*
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT: ReactOS text-mode setup
- * FILE:base/setup/usetup/interface/consup.h
+ * FILE:base/setup/usetup/consup.h
  * PURPOSE: Console support functions
  * PROGRAMMER:  Eric Kohl
  */

Copied: branches/setup_improvements/base/setup/usetup/devinst.c (from r75525, 
branches/setup_improvements/base/setup/usetup/interface/devinst.c)
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/devinst.c?p2=branches/setup_improvements/base/setup/usetup/devinst.c&p1=branches/setup_improvements/base/setup/usetup/interface/devinst.c&r1=75525&r2=75526&rev=75526&view=diff
==
--- branches/setup_improvements/base/setup/usetup/interface/devinst.c   
[iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/devinst.c [iso-8859-1] 
Fri Aug 11 11:31:46 2017
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:

[ros-diffs] [hbelusca] 75525: [USETUP]: Fix the keyboard selection in the list of OS installations that can be updated.

2017-08-11 Thread hbelusca
Author: hbelusca
Date: Fri Aug 11 11:07:33 2017
New Revision: 75525

URL: http://svn.reactos.org/svn/reactos?rev=75525&view=rev
Log:
[USETUP]: Fix the keyboard selection in the list of OS installations that can 
be updated.

Modified:
branches/setup_improvements/base/setup/usetup/interface/usetup.c

Modified: branches/setup_improvements/base/setup/usetup/interface/usetup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/interface/usetup.c?rev=75525&r1=75524&r2=75525&view=diff
==
--- branches/setup_improvements/base/setup/usetup/interface/usetup.c
[iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/interface/usetup.c
[iso-8859-1] Fri Aug 11 11:07:33 2017
@@ -827,57 +827,62 @@
 {
 CONSOLE_ConInKey(Ir);
 
-if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
-(Ir->Event.KeyEvent.wVirtualKeyCode == VK_DOWN))  /* DOWN */
-{
-ScrollDownGenericList(&ListUi);
-}
-else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
- (Ir->Event.KeyEvent.wVirtualKeyCode == VK_UP))  /* UP */
-{
-ScrollUpGenericList(&ListUi);
-}
-else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
- (Ir->Event.KeyEvent.wVirtualKeyCode == VK_NEXT))  /* PAGE 
DOWN */
-{
-ScrollPageDownGenericList(&ListUi);
-}
-else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
- (Ir->Event.KeyEvent.wVirtualKeyCode == VK_PRIOR))  /* PAGE UP 
*/
-{
-ScrollPageUpGenericList(&ListUi);
-}
-else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
- (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3))  /* F3 */
-{
-if (ConfirmQuit(Ir) == TRUE)
-return QUIT_PAGE;
-else
-RedrawGenericList(&ListUi);
-}
-else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
- (Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE))  /* ESC */
-{
-RestoreGenericListState(NtOsInstallsList);
-// return nextPage;// prevPage;
-}
-// else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
-else if (toupper(Ir->Event.KeyEvent.uChar.AsciiChar) == 'U')  /* U */
-{
-/* Retrieve the current installation */
-CurrentInstallation = 
(PNTOS_INSTALLATION)GetListEntryUserData(GetCurrentListEntry(NtOsInstallsList));
-DPRINT1("Selected installation for repair: \"%S\" ; DiskNumber = 
%d , PartitionNumber = %d\n",
-CurrentInstallation->InstallationName, 
CurrentInstallation->DiskNumber, CurrentInstallation->PartitionNumber);
-
-RepairUpdateFlag = TRUE;
-
-// return nextPage;
-/***/return INSTALL_INTRO_PAGE;/***/
-}
-else if ((Ir->Event.KeyEvent.uChar.AsciiChar > 0x60) && 
(Ir->Event.KeyEvent.uChar.AsciiChar < 0x7b))
-{
-/* a-z */
-GenericListKeyPress(&ListUi, Ir->Event.KeyEvent.uChar.AsciiChar);
+if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x00)
+{
+switch (Ir->Event.KeyEvent.wVirtualKeyCode)
+{
+case VK_DOWN:   /* DOWN */
+ScrollDownGenericList(&ListUi);
+break;
+case VK_UP: /* UP */
+ScrollUpGenericList(&ListUi);
+break;
+case VK_NEXT:   /* PAGE DOWN */
+ScrollPageDownGenericList(&ListUi);
+break;
+case VK_PRIOR:  /* PAGE UP */
+ScrollPageUpGenericList(&ListUi);
+break;
+case VK_F3: /* F3 */
+{
+if (ConfirmQuit(Ir) == TRUE)
+return QUIT_PAGE;
+else
+RedrawGenericList(&ListUi);
+break;
+}
+case VK_ESCAPE: /* ESC */
+{
+RestoreGenericListState(NtOsInstallsList);
+// return nextPage;// prevPage;
+
+// return INSTALL_INTRO_PAGE;
+return DEVICE_SETTINGS_PAGE;
+// return SCSI_CONTROLLER_PAGE;
+}
+}
+}
+else
+{
+// switch (toupper(Ir->Event.KeyEvent.uChar.AsciiChar))
+// if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
+if (toupper(Ir->Event.KeyEvent.uChar.AsciiChar) == 'U')  /* U */
+{
+/* Retrieve the current installati

[ros-diffs] [hbelusca] 75524: [SYSSETUP]: Following r75518, we use the $winnt$.inf file (created in System32 by the 1st-stage installer) as the setup information file for the 2nd-stage setup for: - re

2017-08-10 Thread hbelusca
Author: hbelusca
Date: Thu Aug 10 19:21:08 2017
New Revision: 75524

URL: http://svn.reactos.org/svn/reactos?rev=75524&view=rev
Log:
[SYSSETUP]: Following r75518, we use the $winnt$.inf file (created in System32 
by the 1st-stage installer) as the setup information file for the 2nd-stage 
setup for:
- retrieving the installation source media path;
- retrieving the unattended information that was copied from the unattend.inf 
file from the installation source media.
The installation source media path is converted from NT format to Win32 format 
for usage with Win32 functions and storage in the registry: this is done by 
GetInstallSourceWin32(),
which replaces the hackish GetRosInstallCD() function.
The $winnt$.inf file is also updated, and the values "SourcePath" and 
"ServicePackSourcePath" in HKLM\Software\Microsoft\Windows\CurrentVersion\Setup 
are created / updated.

In addition, delete the created fonts where needed.

Modified:
branches/setup_improvements/dll/win32/syssetup/wizard.c
branches/setup_improvements/sdk/include/reactos/libs/syssetup/syssetup.h

Modified: branches/setup_improvements/dll/win32/syssetup/wizard.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/dll/win32/syssetup/wizard.c?rev=75524&r1=75523&r2=75524&view=diff
==
--- branches/setup_improvements/dll/win32/syssetup/wizard.c [iso-8859-1] 
(original)
+++ branches/setup_improvements/dll/win32/syssetup/wizard.c [iso-8859-1] 
Thu Aug 10 19:21:08 2017
@@ -49,9 +49,6 @@
 /* FUNCTIONS /
 
 extern void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, 
DWORD nCmdShow);
-
-BOOL
-GetRosInstallCD(WCHAR *pwszPath, DWORD cchPathMax);
 
 
 static VOID
@@ -982,16 +979,9 @@
 PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_BACK | 
PSWIZB_NEXT);
 if (SetupData->UnattendSetup)
 {
-WCHAR wszPath[MAX_PATH];
-if (GetRosInstallCD(wszPath, _countof(wszPath)))
+// if (!*SetupData->SourcePath)
 {
-WCHAR wszParams[1024];
-swprintf(wszParams, 
L"intl.cpl,,/f:\"%sreactos\\unattend.inf\"", wszPath);
-RunControlPanelApplet(hwndDlg, wszParams);
-}
-else
-{
-RunControlPanelApplet(hwndDlg, 
L"intl.cpl,,/f:\"unattend.inf\"");
+RunControlPanelApplet(hwndDlg, 
L"intl.cpl,,/f:\"$winnt$.inf\""); // Should be in System32
 }
 
 SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, 
IDD_OWNERPAGE);
@@ -2175,9 +2165,70 @@
 }
 
 
+/*
+ * GetInstallSourceWin32 retrieves the path to the ReactOS installation medium
+ * in Win32 format, for later use by syssetup and storage in the registry.
+ */
+static BOOL
+GetInstallSourceWin32(
+OUT PWSTR pwszPath,
+IN DWORD cchPathMax,
+IN PCWSTR pwszNTPath)
+{
+WCHAR wszDrives[512];
+WCHAR wszNTPath[512]; // MAX_PATH ?
+DWORD cchDrives;
+PWCHAR pwszDrive;
+
+*pwszPath = UNICODE_NULL;
+
+cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
+if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
+{
+/* Buffer too small or failure */
+LogItem(NULL, L"GetLogicalDriveStringsW failed");
+return FALSE;
+}
+
+for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
+{
+WCHAR wszBuf[MAX_PATH];
+
+/* Retrieve the NT path corresponding to the current Win32 DOS path */
+pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
+QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
+pwszDrive[2] = L'\\';// Restore the backslash
+
+wcscat(wszNTPath, L"\\");// Concat a backslash
+
+/* Logging */
+wsprintf(wszBuf, L"Testing '%s' --> '%s' %s a CD",
+ pwszDrive, wszNTPath,
+ (GetDriveTypeW(pwszDrive) == DRIVE_CDROM) ? L"is" : L"is 
not");
+LogItem(NULL, wszBuf);
+
+/* Check whether the NT path corresponds to the NT installation source 
path */
+if (!_wcsicmp(wszNTPath, pwszNTPath))
+{
+/* Found it! */
+wcscpy(pwszPath, pwszDrive); // cchPathMax
+
+/* Logging */
+wsprintf(wszBuf, L"GetInstallSourceWin32: %s", pwszPath);
+LogItem(NULL, wszBuf);
+wcscat(wszBuf, L"\n");
+OutputDebugStringW(wszBuf);
+
+retur

[ros-diffs] [hbelusca] 75523: [SYSSETUP]: Use ARRAYSIZE / _countof instead of sizeof ratios.

2017-08-10 Thread hbelusca
Author: hbelusca
Date: Thu Aug 10 18:59:26 2017
New Revision: 75523

URL: http://svn.reactos.org/svn/reactos?rev=75523&view=rev
Log:
[SYSSETUP]: Use ARRAYSIZE / _countof instead of sizeof ratios.

Modified:
branches/setup_improvements/dll/win32/syssetup/wizard.c

Modified: branches/setup_improvements/dll/win32/syssetup/wizard.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/dll/win32/syssetup/wizard.c?rev=75523&r1=75522&r2=75523&view=diff
==
--- branches/setup_improvements/dll/win32/syssetup/wizard.c [iso-8859-1] 
(original)
+++ branches/setup_improvements/dll/win32/syssetup/wizard.c [iso-8859-1] 
Thu Aug 10 18:59:26 2017
@@ -488,11 +488,11 @@
 OwnerName[0] = 0;
 if (GetDlgItemTextW(hwndDlg, IDC_OWNERNAME, OwnerName, 50) 
== 0)
 {
-if (0 == LoadStringW(hDllInstance, IDS_REACTOS_SETUP, 
Title, sizeof(Title) / sizeof(Title[0])))
+if (0 == LoadStringW(hDllInstance, IDS_REACTOS_SETUP, 
Title, ARRAYSIZE(Title)))
 {
 wcscpy(Title, L"ReactOS Setup");
 }
-if (0 == LoadStringW(hDllInstance, IDS_WZD_NAME, 
ErrorName, sizeof(ErrorName) / sizeof(ErrorName[0])))
+if (0 == LoadStringW(hDllInstance, IDS_WZD_NAME, 
ErrorName, ARRAYSIZE(ErrorName)))
 {
 wcscpy(ErrorName, L"Setup cannot continue until 
you enter your name.");
 }
@@ -542,12 +542,12 @@
 {
 if (hwndDlg != NULL)
 {
-if (0 == LoadStringW(hDllInstance, IDS_REACTOS_SETUP, Title, 
sizeof(Title) / sizeof(Title[0])))
+if (0 == LoadStringW(hDllInstance, IDS_REACTOS_SETUP, Title, 
ARRAYSIZE(Title)))
 {
 wcscpy(Title, L"ReactOS Setup");
 }
 if (0 == LoadStringW(hDllInstance, IDS_WZD_SETCOMPUTERNAME, 
ErrorComputerName,
- sizeof(ErrorComputerName) / 
sizeof(ErrorComputerName[0])))
+ ARRAYSIZE(ErrorComputerName)))
 {
 wcscpy(ErrorComputerName, L"Setup failed to set the computer 
name.");
 }
@@ -578,7 +578,7 @@
 if (LoadStringW(hDllInstance,
 IDS_ADMINISTRATOR_NAME,
 szAdministratorName,
-sizeof(szAdministratorName) / sizeof(WCHAR)) == 0)
+ARRAYSIZE(szAdministratorName)) == 0)
 {
 wcscpy(szAdministratorName, L"Administrator");
 }
@@ -655,7 +655,7 @@
 
 pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
 
-if (0 == LoadStringW(hDllInstance, IDS_REACTOS_SETUP, Title, sizeof(Title) 
/ sizeof(Title[0])))
+if (0 == LoadStringW(hDllInstance, IDS_REACTOS_SETUP, Title, 
ARRAYSIZE(Title)))
 {
 wcscpy(Title, L"ReactOS Setup");
 }
@@ -713,7 +713,7 @@
 if (0 == GetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, 
ComputerName, MAX_COMPUTERNAME_LENGTH + 1))
 {
 if (0 == LoadStringW(hDllInstance, 
IDS_WZD_COMPUTERNAME, EmptyComputerName,
- sizeof(EmptyComputerName) / 
sizeof(EmptyComputerName[0])))
+ ARRAYSIZE(EmptyComputerName)))
 {
 wcscpy(EmptyComputerName, L"Setup cannot continue 
until you enter the name of your computer.");
 }
@@ -739,7 +739,7 @@
 (GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD2, 
Password2, 128) == 0))
 {
 if (0 == LoadStringW(hDllInstance, 
IDS_WZD_PASSWORDEMPTY, EmptyPassword,
- sizeof(EmptyPassword) / 
sizeof(EmptyPassword[0])))
+ ARRAYSIZE(EmptyPassword)))
 {
 wcscpy(EmptyPassword, L"You must enter a password 
!");
 }
@@ -755,7 +755,7 @@
 if (wcscmp(Password1, Password2))
 {
 if (0 == LoadStringW(hDllInstance, 
IDS_WZD_PASSWORDMATCH, NotMatchPassword,
- sizeof(NotMatchPassword) / 
sizeof(NotMatchPassword[0])))
+ ARRAYSIZE(NotMatchPassword)))
 {
 wcscpy(NotMatchPassword, L"The passwords you 
entered do not match. Please enter the desired password again.");
 }
@@ -771,7 +771,7 @@
 if (!isprint(*Password))
 

[ros-diffs] [hbelusca] 75522: [SYSSETUP]: Code formatting.

2017-08-10 Thread hbelusca
Author: hbelusca
Date: Thu Aug 10 18:56:15 2017
New Revision: 75522

URL: http://svn.reactos.org/svn/reactos?rev=75522&view=rev
Log:
[SYSSETUP]: Code formatting.

Modified:
branches/setup_improvements/dll/win32/syssetup/wizard.c

Modified: branches/setup_improvements/dll/win32/syssetup/wizard.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/dll/win32/syssetup/wizard.c?rev=75522&r1=75521&r2=75522&view=diff
==
--- branches/setup_improvements/dll/win32/syssetup/wizard.c [iso-8859-1] 
(original)
+++ branches/setup_improvements/dll/win32/syssetup/wizard.c [iso-8859-1] 
Thu Aug 10 18:56:15 2017
@@ -296,7 +296,7 @@
 
 Projects = NULL;
 ProjectsSize = 256;
-do
+while (TRUE)
 {
 Projects = HeapAlloc(GetProcessHeap(), 0, ProjectsSize * 
sizeof(WCHAR));
 if (NULL == Projects)
@@ -316,9 +316,9 @@
 HeapFree(GetProcessHeap(), 0, Projects);
 ProjectsSize *= 2;
 }
-while (1);
+
 CurrentProject = Projects;
-while (L'\0' != *CurrentProject)
+while (*CurrentProject != L'\0')
 {
 End = wcschr(CurrentProject, L'\n');
 if (NULL != End)
@@ -387,8 +387,6 @@
 {
 HKEY hKey;
 LONG res;
-
-
 
 res = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
 L"Software\\Microsoft\\Windows NT\\CurrentVersion",
@@ -867,50 +865,48 @@
 RunControlPanelApplet(HWND hwnd, PCWSTR pwszCPLParameters)
 {
 MSG msg;
-if (pwszCPLParameters)
-{
-STARTUPINFOW StartupInfo;
-PROCESS_INFORMATION ProcessInformation;
-WCHAR CmdLine[MAX_PATH] = L"rundll32.exe shell32.dll,Control_RunDLL ";
-
-ZeroMemory(&StartupInfo, sizeof(StartupInfo));
-StartupInfo.cb = sizeof(StartupInfo);
-
-ASSERT(_countof(CmdLine) > wcslen(CmdLine) + 
wcslen(pwszCPLParameters));
-wcscat(CmdLine, pwszCPLParameters);
-
-if (!CreateProcessW(NULL,
-CmdLine,
-NULL,
-NULL,
-FALSE,
-0,
-NULL,
-NULL,
-&StartupInfo,
-&ProcessInformation))
-{
-MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel 
Applet.", NULL, MB_ICONERROR);
-return FALSE;
-}
-
-while((MsgWaitForMultipleObjects(1, &ProcessInformation.hProcess, 
FALSE, INFINITE, QS_ALLINPUT|QS_ALLPOSTMESSAGE )) != WAIT_OBJECT_0)
-{ 
-   while(PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
-   {
-   TranslateMessage(&msg);
-   DispatchMessageW(&msg);
-   }
-}
-CloseHandle(ProcessInformation.hThread);
-CloseHandle(ProcessInformation.hProcess);
-return TRUE;
-}
-else
+STARTUPINFOW StartupInfo;
+PROCESS_INFORMATION ProcessInformation;
+WCHAR CmdLine[MAX_PATH] = L"rundll32.exe shell32.dll,Control_RunDLL ";
+
+if (!pwszCPLParameters)
 {
 MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel 
Applet.", NULL, MB_ICONERROR);
 return FALSE;
 }
+
+ZeroMemory(&StartupInfo, sizeof(StartupInfo));
+StartupInfo.cb = sizeof(StartupInfo);
+
+ASSERT(_countof(CmdLine) > wcslen(CmdLine) + wcslen(pwszCPLParameters));
+wcscat(CmdLine, pwszCPLParameters);
+
+if (!CreateProcessW(NULL,
+CmdLine,
+NULL,
+NULL,
+FALSE,
+0,
+NULL,
+NULL,
+&StartupInfo,
+&ProcessInformation))
+{
+MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel 
Applet.", NULL, MB_ICONERROR);
+return FALSE;
+}
+
+while ((MsgWaitForMultipleObjects(1, &ProcessInformation.hProcess, FALSE, 
INFINITE, QS_ALLINPUT|QS_ALLPOSTMESSAGE )) != WAIT_OBJECT_0)
+{ 
+   while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
+   {
+   TranslateMessage(&msg);
+   DispatchMessageW(&msg);
+   }
+}
+CloseHandle(ProcessInformation.hThread);
+CloseHandle(ProcessInformation.hProcess);
+return TRUE;
 }
 
 static VOID
@@ -1501,7 +1497,7 @@
  SetupData);
 
 SetAutoDaylightInfo(GetDlgItem(hwndDlg, IDC_AUTODAYLIGHT));
-if(!SetSystemLocalTime(hwndDlg, SetupData))
+if (!SetSystemLocalTime(hwndDlg, SetupData))
 {
 if (0 == LoadStringW(hDllInstance,

[ros-diffs] [hbelusca] 75519: [USETUP]: NT RTL thread functions use 'NULL' (instead of 'INVALID_HANDLE_VALUE' which is a Win32 thing) for thread handles that are "invalid" / uninitialized.

2017-08-09 Thread hbelusca
Author: hbelusca
Date: Wed Aug  9 20:43:02 2017
New Revision: 75519

URL: http://svn.reactos.org/svn/reactos?rev=75519&view=rev
Log:
[USETUP]: NT RTL thread functions use 'NULL' (instead of 'INVALID_HANDLE_VALUE' 
which is a Win32 thing) for thread handles that are "invalid" / uninitialized.

Modified:
branches/setup_improvements/base/setup/usetup/interface/usetup.c

Modified: branches/setup_improvements/base/setup/usetup/interface/usetup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/interface/usetup.c?rev=75519&r1=75518&r2=75519&view=diff
==
--- branches/setup_improvements/base/setup/usetup/interface/usetup.c
[iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/interface/usetup.c
[iso-8859-1] Wed Aug  9 20:43:02 2017
@@ -629,10 +629,10 @@
 }
 
 /* Start the PnP thread */
-if (hPnpThread != INVALID_HANDLE_VALUE)
+if (hPnpThread != NULL)
 {
 NtResumeThread(hPnpThread, NULL);
-hPnpThread = INVALID_HANDLE_VALUE;
+hPnpThread = NULL;
 }
 
 CheckUnattendedSetup(&USetupData);
@@ -4605,7 +4605,7 @@
  &hPnpThread,
  NULL);
 if (!NT_SUCCESS(Status))
-hPnpThread = INVALID_HANDLE_VALUE;
+hPnpThread = NULL;
 
 if (!CONSOLE_Init())
 {




[ros-diffs] [hbelusca] 75518: [USETUP][SETUPLIB]: Code refactoring: - Move several global setup variables into a structure "USETUP_DATA", similar to the syssetup structure "SETUPDATA" (or the WIP 1st-

2017-08-09 Thread hbelusca
Author: hbelusca
Date: Wed Aug  9 20:39:45 2017
New Revision: 75518

URL: http://svn.reactos.org/svn/reactos?rev=75518&view=rev
Log:
[USETUP][SETUPLIB]: Code refactoring:
- Move several global setup variables into a structure "USETUP_DATA", similar 
to the syssetup structure "SETUPDATA"
  (or the WIP 1st-stage installer structure of the same name), so that these 
variables can be set easily by different helper setup functions;
- Move CheckUnattendedSetup() and GetSourcePaths() to setuplib and make 
CheckUnattendedSetup() use the USETUP_DATA structure;
- Add a LoadSetupInf() function that loads the txtsetup.sif file (factoring out 
the corresponding code in usetup);
- Add a InstallSetupInfFile() function (that I'll certainly rename later on) 
whose purpose is to create a valid "$winnt$.inf" setup installation file
  in the ReactOS\system32 directory, which should help the 2nd-stage installer 
to correctly retrieve the source installation media we used during 1st-stage,
  and contain the unattended setup lines copied from unattend.inf. This is done 
in a Windows-compatible way.
- Add the lib/infsupp.c and lib/setuplib.c to compilation.

Added:
branches/setup_improvements/base/setup/lib/setuplib.c   (with props)
Modified:
branches/setup_improvements/base/setup/lib/CMakeLists.txt
branches/setup_improvements/base/setup/lib/setuplib.h
branches/setup_improvements/base/setup/usetup/interface/usetup.c

Modified: branches/setup_improvements/base/setup/lib/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/CMakeLists.txt?rev=75518&r1=75517&r2=75518&view=diff
==
--- branches/setup_improvements/base/setup/lib/CMakeLists.txt   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/CMakeLists.txt   [iso-8859-1] 
Wed Aug  9 20:39:45 2017
@@ -5,12 +5,14 @@
 filesup.c
 fsutil.c
 genlist.c
+infsupp.c
 inicache.c
 ntverrsrc.c
 osdetect.c
 partlist.c
 registry.c
 regutil.c
+setuplib.c
 precomp.h)
 
 add_library(setuplib ${SOURCE})

Added: branches/setup_improvements/base/setup/lib/setuplib.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/setuplib.c?rev=75518
==
--- branches/setup_improvements/base/setup/lib/setuplib.c   (added)
+++ branches/setup_improvements/base/setup/lib/setuplib.c   [iso-8859-1] 
Wed Aug  9 20:39:45 2017
@@ -0,0 +1,512 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT: ReactOS Setup Library
+ * FILE:base/setup/lib/setuplib.c
+ * PURPOSE: Setup Library - Main initialization helpers
+ * PROGRAMMERS: Casper S. Hornstrup (cho...@users.sourceforge.net)
+ *  Hermes Belusca-Maito (hermes.belu...@sfr.fr)
+ */
+
+/* INCLUDES */
+
+#include "precomp.h"
+#include "filesup.h"
+#include "infsupp.h"
+#include "inicache.h"
+
+#include "setuplib.h"
+
+#define NDEBUG
+#include 
+
+
+/* GLOBALS **/
+
+/* FUNCTIONS /
+
+VOID
+CheckUnattendedSetup(
+IN OUT PUSETUP_DATA pSetupData)
+{
+INFCONTEXT Context;
+HINF UnattendInf;
+UINT ErrorLine;
+INT IntValue;
+PWCHAR Value;
+WCHAR UnattendInfPath[MAX_PATH];
+
+CombinePaths(UnattendInfPath, ARRAYSIZE(UnattendInfPath), 2,
+ pSetupData->SourcePath.Buffer, L"unattend.inf");
+
+if (DoesFileExist(NULL, UnattendInfPath) == FALSE)
+{
+DPRINT("Does not exist: %S\n", UnattendInfPath);
+return;
+}
+
+/* Load 'unattend.inf' from installation media */
+UnattendInf = SetupOpenInfFileExW(UnattendInfPath,
+  NULL,
+  INF_STYLE_WIN4,
+  pSetupData->LanguageId,
+  &ErrorLine);
+
+if (UnattendInf == INVALID_HANDLE_VALUE)
+{
+DPRINT("SetupOpenInfFileExW() failed\n");
+return;
+}
+
+/* Open 'Unattend' section */
+if (!SetupFindFirstLineW(UnattendInf, L"Unattend", L"Signature", &Context))
+{
+DPRINT("SetupFindFirstLineW() failed for section 'Unattend'\n");
+goto Quit;
+}
+
+/* Get pointer 'Signature' key */
+if (!INF_GetData(&Context, NULL, &Value))
+{
+DPRINT("INF_GetData() failed for key 'Signature'\n");
+goto Quit;
+}
+
+/* Check 'Signature&#

[ros-diffs] [hbelusca] 75517: [USETUP]: Minor code formatting only.

2017-08-09 Thread hbelusca
Author: hbelusca
Date: Wed Aug  9 20:29:07 2017
New Revision: 75517

URL: http://svn.reactos.org/svn/reactos?rev=75517&view=rev
Log:
[USETUP]: Minor code formatting only.

Modified:
branches/setup_improvements/base/setup/usetup/interface/usetup.c

Modified: branches/setup_improvements/base/setup/usetup/interface/usetup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/interface/usetup.c?rev=75517&r1=75516&r2=75517&view=diff
==
--- branches/setup_improvements/base/setup/usetup/interface/usetup.c
[iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/interface/usetup.c
[iso-8859-1] Wed Aug  9 20:29:07 2017
@@ -106,9 +106,9 @@
 static PGENERIC_LIST NtOsInstallsList = NULL;
 
 static PGENERIC_LIST ComputerList = NULL;
-static PGENERIC_LIST DisplayList = NULL;
+static PGENERIC_LIST DisplayList  = NULL;
 static PGENERIC_LIST KeyboardList = NULL;
-static PGENERIC_LIST LayoutList = NULL;
+static PGENERIC_LIST LayoutList   = NULL;
 static PGENERIC_LIST LanguageList = NULL;
 
 static LANGID LanguageId = 0;
@@ -145,7 +145,7 @@
 COORD coPos;
 DWORD Written;
 
-/* draw upper left corner */
+/* Draw upper left corner */
 coPos.X = xLeft;
 coPos.Y = yTop;
 FillConsoleOutputCharacterA(StdOutput,
@@ -154,7 +154,7 @@
 coPos,
 &Written);
 
-/* draw upper edge */
+/* Draw upper edge */
 coPos.X = xLeft + 1;
 coPos.Y = yTop;
 FillConsoleOutputCharacterA(StdOutput,
@@ -163,7 +163,7 @@
 coPos,
 &Written);
 
-/* draw upper right corner */
+/* Draw upper right corner */
 coPos.X = xLeft + Width - 1;
 coPos.Y = yTop;
 FillConsoleOutputCharacterA(StdOutput,
@@ -197,7 +197,7 @@
 &Written);
 }
 
-/* draw lower left corner */
+/* Draw lower left corner */
 coPos.X = xLeft;
 coPos.Y = yTop + Height - 1;
 FillConsoleOutputCharacterA(StdOutput,
@@ -206,7 +206,7 @@
 coPos,
 &Written);
 
-/* draw lower edge */
+/* Draw lower edge */
 coPos.X = xLeft + 1;
 coPos.Y = yTop + Height - 1;
 FillConsoleOutputCharacterA(StdOutput,
@@ -215,7 +215,7 @@
 coPos,
 &Written);
 
-/* draw lower right corner */
+/* Draw lower right corner */
 coPos.X = xLeft + Width - 1;
 coPos.Y = yTop + Height - 1;
 FillConsoleOutputCharacterA(StdOutput,
@@ -4442,9 +4442,9 @@
 }
 else if ((PartitionType == PARTITION_FAT_12) ||
  (PartitionType == PARTITION_FAT_16) ||
- (PartitionType == PARTITION_HUGE) ||
+ (PartitionType == PARTITION_HUGE)   ||
  (PartitionType == PARTITION_XINT13) ||
- (PartitionType == PARTITION_FAT32) ||
+ (PartitionType == PARTITION_FAT32)  ||
  (PartitionType == PARTITION_FAT32_XINT13))
 {
 DPRINT("Found FAT partition\n");
@@ -4481,11 +4481,11 @@
 CONSOLE_NormalTextXY(8, Line, 60, 1);
 
 Line++;
-if (Line<12)
-Line=15;
-
-if (Line>15)
-Line=12;
+if (Line < 12)
+Line = 15;
+
+if (Line > 15)
+Line = 12;
 
 CONSOLE_InvertTextXY(8, Line, 60, 1);
 }
@@ -4495,11 +4495,11 @@
 CONSOLE_NormalTextXY(8, Line, 60, 1);
 
 Line--;
-if (Line<12)
-Line=15;
-
-if (Line>15)
-Line=12;
+if (Line < 12)
+Line = 15;
+
+if (Line > 15)
+Line = 12;
 
 CONSOLE_InvertTextXY(8, Line, 60, 1);
 }




[ros-diffs] [hbelusca] 75516: [USETUP]: Sprinkle some INF_FreeData() calls to balance the INF_GetData() / INF_GetDataField() calls. They currently do nothing, since the getter functions don't actually

2017-08-09 Thread hbelusca
Author: hbelusca
Date: Wed Aug  9 20:24:24 2017
New Revision: 75516

URL: http://svn.reactos.org/svn/reactos?rev=75516&view=rev
Log:
[USETUP]: Sprinkle some INF_FreeData() calls to balance the INF_GetData() / 
INF_GetDataField() calls. They currently do nothing, since the getter functions 
don't actually capture (copy) the strings but merely return pointers to 
read-only strings. But the calls are placed here for consistency, because if 
one day the getters implementation is changed to capture the strings, then it 
would now be needed to free the allocated buffers.
In addition, fix a buggy call to INF_GetData() -- should be instead 
INF_GetDataField() -- in AddSectionToCopyQueue().

Modified:
branches/setup_improvements/base/setup/usetup/interface/devinst.c
branches/setup_improvements/base/setup/usetup/interface/usetup.c
branches/setup_improvements/base/setup/usetup/settings.c

Modified: branches/setup_improvements/base/setup/usetup/interface/devinst.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/interface/devinst.c?rev=75516&r1=75515&r2=75516&view=diff
==
--- branches/setup_improvements/base/setup/usetup/interface/devinst.c   
[iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/interface/devinst.c   
[iso-8859-1] Wed Aug  9 20:24:24 2017
@@ -73,7 +73,10 @@
  && !SetupFindFirstLineW(hInf, L"InputDevicesSupport.Load", Driver, 
&Context))
 {
 if (!SetupFindFirstLineW(hInf, L"Keyboard.Load", Driver, &Context))
+{
+INF_FreeData(Driver);
 return FALSE;
+}
 
 keyboardDevice = TRUE;
 }
@@ -87,6 +90,8 @@
 if (!FullImagePath)
 {
 DPRINT1("RtlAllocateHeap() failed\n");
+INF_FreeData(ImagePath);
+INF_FreeData(Driver);
 return FALSE;
 }
 RtlCopyMemory(FullImagePath, PathPrefix.Buffer, PathPrefix.MaximumLength);
@@ -102,6 +107,8 @@
 {
 DPRINT1("NtCreateKey('%wZ') failed with status 0x%08x\n", &StringU, 
Status);
 RtlFreeHeap(ProcessHeap, 0, FullImagePath);
+INF_FreeData(ImagePath);
+INF_FreeData(Driver);
 return FALSE;
 }
 
@@ -109,38 +116,38 @@
 if (Disposition == REG_CREATED_NEW_KEY)
 {
 dwValue = 0;
-NtSetValueKey(
-hService,
-&ErrorControlU,
-0,
-REG_DWORD,
-&dwValue,
-sizeof(dwValue));
+NtSetValueKey(hService,
+  &ErrorControlU,
+  0,
+  REG_DWORD,
+  &dwValue,
+  sizeof(dwValue));
+
 dwValue = 0;
-NtSetValueKey(
-hService,
-&StartU,
-0,
-REG_DWORD,
-&dwValue,
-sizeof(dwValue));
+NtSetValueKey(hService,
+  &StartU,
+  0,
+  REG_DWORD,
+  &dwValue,
+  sizeof(dwValue));
+
 dwValue = SERVICE_KERNEL_DRIVER;
-NtSetValueKey(
-hService,
-&TypeU,
-0,
-REG_DWORD,
-&dwValue,
-sizeof(dwValue));
+NtSetValueKey(hService,
+  &TypeU,
+  0,
+  REG_DWORD,
+  &dwValue,
+  sizeof(dwValue));
 }
 /* HACK: don't put any path in registry */
-NtSetValueKey(
-hService,
-&ImagePathU,
-0,
-REG_SZ,
-ImagePath,
-(wcslen(ImagePath) + 1) * sizeof(WCHAR));
+NtSetValueKey(hService,
+  &ImagePathU,
+  0,
+  REG_SZ,
+  ImagePath,
+  (wcslen(ImagePath) + 1) * sizeof(WCHAR));
+
+INF_FreeData(ImagePath);
 
 if (keyboardDevice)
 {
@@ -154,28 +161,29 @@
 }
 
 /* Associate device with the service we just filled */
-Status = NtSetValueKey(
-hDeviceKey,
-&ServiceU,
-0,
-REG_SZ,
-Driver,
-(wcslen(Driver) + 1) * sizeof(WCHAR));
+Status = NtSetValueKey(hDeviceKey,
+   &ServiceU,
+   0,
+   REG_SZ,
+   Driver,
+   (wcslen(Driver) + 1) * sizeof(WCHAR));
 if (NT_SUCCESS(Status))
 {
 /* Restart the device, so it will use the driver we registered */
 deviceInstalled = ResetDevice(DeviceId);
 }
 
+INF_FreeData(Driver);
+
 /* HACK: Update driver path */
-NtSetValueKey(
-hService,
-&ImagePathU,
-0,
-REG_

[ros-diffs] [hbelusca] 75515: [USETUP][SETUPLIB]: Move some INF-related code from usetup to the setuplib. - Move the generic INF_GetDataField() and INF_GetData() helpers to setuplib, and rework them a

2017-08-09 Thread hbelusca
Author: hbelusca
Date: Wed Aug  9 20:12:00 2017
New Revision: 75515

URL: http://svn.reactos.org/svn/reactos?rev=75515&view=rev
Log:
[USETUP][SETUPLIB]: Move some INF-related code from usetup to the setuplib.
- Move the generic INF_GetDataField() and INF_GetData() helpers to setuplib, 
and rework them a bit so that they explicitly call setupapi functions (or 
implementations thereof when being used in usetup);
- Rework the headers in accordance;
- and Fix compilation in lib/registry.c .

Added:
branches/setup_improvements/base/setup/lib/infsupp.c   (with props)
Modified:
branches/setup_improvements/base/setup/lib/infsupp.h
branches/setup_improvements/base/setup/lib/registry.c
branches/setup_improvements/base/setup/usetup/inffile.c
branches/setup_improvements/base/setup/usetup/inffile.h
branches/setup_improvements/base/setup/usetup/usetup.h

Added: branches/setup_improvements/base/setup/lib/infsupp.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/infsupp.c?rev=75515
==
--- branches/setup_improvements/base/setup/lib/infsupp.c(added)
+++ branches/setup_improvements/base/setup/lib/infsupp.c[iso-8859-1] 
Wed Aug  9 20:12:00 2017
@@ -0,0 +1,119 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT: ReactOS Setup Library
+ * FILE:base/setup/lib/infsupp.c
+ * PURPOSE: Interfacing with Setup* API .inf files support functions
+ * PROGRAMMERS: Hervé Poussineau
+ *  Hermes Belusca-Maito (hermes.belu...@sfr.fr)
+ */
+
+/* INCLUDES */
+
+#include "precomp.h"
+#include "infsupp.h"
+
+#define NDEBUG
+#include 
+
+/* HELPER FUNCTIONS **/
+
+BOOLEAN
+INF_GetDataField(
+IN PINFCONTEXT Context,
+IN ULONG FieldIndex,
+OUT PWCHAR *Data)
+{
+#if 0
+
+BOOL Success;
+PWCHAR InfData;
+DWORD dwSize;
+
+*Data = NULL;
+
+Success = SetupGetStringFieldW(Context,
+   FieldIndex,
+   NULL,
+   0,
+   &dwSize);
+if (!Success)
+return FALSE;
+
+InfData = RtlAllocateHeap(ProcessHeap, 0, dwSize * sizeof(WCHAR));
+if (!InfData)
+return FALSE;
+
+Success = SetupGetStringFieldW(Context,
+   FieldIndex,
+   InfData,
+   dwSize,
+   NULL);
+if (!Success)
+{
+RtlFreeHeap(ProcessHeap, 0, InfData);
+return FALSE;
+}
+
+*Data = InfData;
+return TRUE;
+
+#else
+
+*Data = (PWCHAR)pSetupGetField(Context, FieldIndex);
+return !!*Data;
+
+#endif
+}
+
+BOOLEAN
+INF_GetData(
+IN PINFCONTEXT Context,
+OUT PWCHAR *Key,
+OUT PWCHAR *Data)
+{
+BOOL Success;
+PWCHAR InfData[2] = {NULL, NULL};
+
+if (Key)
+*Key = NULL;
+
+if (Data)
+*Data = NULL;
+
+/*
+ * Verify that the INF file has only one value field, in addition to its 
key name.
+ * Note that SetupGetFieldCount() does not count the key name as a field.
+ */
+if (SetupGetFieldCount(Context) != 1)
+{
+DPRINT1("SetupGetFieldCount != 1\n");
+return FALSE;
+}
+
+if (Key)
+{
+Success = INF_GetDataField(Context, 0, &InfData[0]);
+if (!Success)
+return FALSE;
+}
+
+if (Data)
+{
+Success = INF_GetDataField(Context, 1, &InfData[1]);
+if (!Success)
+{
+INF_FreeData(InfData[0]);
+return FALSE;
+}
+}
+
+if (Key)
+*Key = InfData[0];
+
+if (Data)
+*Data = InfData[1];
+
+return TRUE;
+}
+
+/* EOF */

Propchange: branches/setup_improvements/base/setup/lib/infsupp.c
--
svn:eol-style = native

Modified: branches/setup_improvements/base/setup/lib/infsupp.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/infsupp.h?rev=75515&r1=75514&r2=75515&view=diff
==
--- branches/setup_improvements/base/setup/lib/infsupp.h[iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/infsupp.h[iso-8859-1] 
Wed Aug  9 20:12:00 2017
@@ -8,39 +8,123 @@
 
 #pragma once
 
-// #ifndef __REACTOS__
+#ifdef __REACTOS__
+#define _SETUPAPI_
+#endif
 
-#define _SETUPAPI_
+// FIXME: Temporary measure until all the users of this header
+// (usetup...) use or define SetupAPI-conforming APIs.
+#if 0
+
 #include 
+
+#else
+
+typedef PVOID HINF;
+typedef struct _IN

[ros-diffs] [hbelusca] 75509: [USETUP]: Comment out SetupQueueCopyWNew() declaration which is not used at all. Remove unnecessary casts in the INF_OpenBufferedFileA() call.

2017-08-08 Thread hbelusca
Author: hbelusca
Date: Tue Aug  8 14:07:17 2017
New Revision: 75509

URL: http://svn.reactos.org/svn/reactos?rev=75509&view=rev
Log:
[USETUP]: Comment out SetupQueueCopyWNew() declaration which is not used at 
all. Remove unnecessary casts in the INF_OpenBufferedFileA() call.

Modified:
branches/setup_improvements/base/setup/usetup/filequeue.h
branches/setup_improvements/base/setup/usetup/interface/usetup.c

Modified: branches/setup_improvements/base/setup/usetup/filequeue.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/filequeue.h?rev=75509&r1=75508&r2=75509&view=diff
==
--- branches/setup_improvements/base/setup/usetup/filequeue.h   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/usetup/filequeue.h   [iso-8859-1] 
Tue Aug  8 14:07:17 2017
@@ -60,7 +60,7 @@
 typedef struct _COPYCONTEXT
 {
 LPCWSTR DestinationRootPath; /* Not owned by this structure */
-LPCWSTR InstallPath; /* Not owned by this structure */
+LPCWSTR InstallPath; /* Not owned by this structure */
 ULONG TotalOperations;
 ULONG CompletedOperations;
 PPROGRESSBAR ProgressBar;
@@ -78,6 +78,7 @@
 SetupCloseFileQueue(
 IN HSPFILEQ QueueHandle);
 
+#if 0 // This is the API that is declared in setupapi.h and exported by 
setupapi.dll
 BOOL
 WINAPI
 SetupQueueCopyWNew(
@@ -90,6 +91,7 @@
 IN PCWSTR TargetDirectory,
 IN PCWSTR TargetFileName,
 IN DWORD CopyStyle);
+#endif
 
 BOOL
 SetupQueueCopy(

Modified: branches/setup_improvements/base/setup/usetup/interface/usetup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/interface/usetup.c?rev=75509&r1=75508&r2=75509&view=diff
==
--- branches/setup_improvements/base/setup/usetup/interface/usetup.c
[iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/interface/usetup.c
[iso-8859-1] Tue Aug  8 14:07:17 2017
@@ -3906,9 +3906,9 @@
 return QUIT_PAGE;
 }
 
-InfHandle = INF_OpenBufferedFileA((CHAR*) InfFileData,
+InfHandle = INF_OpenBufferedFileA((PSTR)InfFileData,
   InfFileSize,
-  (const CHAR*) NULL,
+  NULL,
   INF_STYLE_WIN4,
   LanguageId,
   &ErrorLine);




[ros-diffs] [hbelusca] 75508: [SETUPLIB]: Introduce defines for size units. [USETUP]: Use them in the code.

2017-08-08 Thread hbelusca
Author: hbelusca
Date: Tue Aug  8 14:05:20 2017
New Revision: 75508

URL: http://svn.reactos.org/svn/reactos?rev=75508&view=rev
Log:
[SETUPLIB]: Introduce defines for size units.
[USETUP]: Use them in the code.

Modified:
branches/setup_improvements/base/setup/lib/setuplib.h
branches/setup_improvements/base/setup/usetup/interface/usetup.c
branches/setup_improvements/base/setup/usetup/partlist.c

Modified: branches/setup_improvements/base/setup/lib/setuplib.h
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/setuplib.h?rev=75508&r1=75507&r2=75508&view=diff
==
--- branches/setup_improvements/base/setup/lib/setuplib.h   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/setuplib.h   [iso-8859-1] 
Tue Aug  8 14:05:20 2017
@@ -7,6 +7,8 @@
  */
 
 #pragma once
+
+/* INCLUDES */
 
 /* Needed PSDK headers when using this library */
 #if 0
@@ -38,4 +40,14 @@
 #include "regutil.h"
 #include "registry.h"
 
+
+/* DEFINES **/
+
+#define KB ((ULONGLONG)1024)
+#define MB (KB*KB)
+#define GB (KB*KB*KB)
+// #define TB (KB*KB*KB*KB)
+// #define PB (KB*KB*KB*KB*KB)
+
+
 /* EOF */

Modified: branches/setup_improvements/base/setup/usetup/interface/usetup.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/usetup/interface/usetup.c?rev=75508&r1=75507&r2=75508&view=diff
==
--- branches/setup_improvements/base/setup/usetup/interface/usetup.c
[iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/interface/usetup.c
[iso-8859-1] Tue Aug  8 14:05:20 2017
@@ -1649,7 +1649,7 @@
 ULONGLONG size;
 
 size = PartEntry->SectorCount.QuadPart * 
PartEntry->DiskEntry->BytesPerSector;
-size = (size + 524288) / 1048576;  /* in MBytes */
+size = (size + (512 * KB)) / MB;  /* in MBytes */
 
 if (size < RequiredPartitionDiskSpace)
 {
@@ -2096,15 +2096,15 @@
 
 DiskSize = DiskEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector;
 #if 0
-if (DiskSize >= 10737418240) /* 10 GB */
-{
-DiskSize = DiskSize / 1073741824;
+if (DiskSize >= 10 * GB) /* 10 GB */
+{
+DiskSize = DiskSize / GB;
 Unit = MUIGetString(STRING_GB);
 }
 else
 #endif
 {
-DiskSize = DiskSize / 1048576;
+DiskSize = DiskSize / MB;
 if (DiskSize == 0)
 DiskSize = 1;
 
@@ -2141,7 +2141,7 @@
 
 #if 0
 CONSOLE_PrintTextXY(8, 10, "Maximum size of the new partition is %I64u MB",
-PartitionList->CurrentPartition->SectorCount * 
DiskEntry->BytesPerSector / 1048576);
+PartitionList->CurrentPartition->SectorCount * 
DiskEntry->BytesPerSector / MB);
 #endif
 
 CONSOLE_SetStatusText(MUIGetString(STRING_CREATEPARTITION));
@@ -2149,7 +2149,7 @@
 PartEntry = PartitionList->CurrentPartition;
 while (TRUE)
 {
-MaxSize = (PartEntry->SectorCount.QuadPart * 
DiskEntry->BytesPerSector) / 1048576;  /* in MBytes (rounded) */
+MaxSize = (PartEntry->SectorCount.QuadPart * 
DiskEntry->BytesPerSector) / MB;  /* in MBytes (rounded) */
 
 if (MaxSize > PARTITION_MAXSIZE)
 MaxSize = PARTITION_MAXSIZE;
@@ -2193,7 +2193,7 @@
 else
 {
 /* Calculate the sector count from the size in MB */
-SectorCount = PartSize * 1048576 / DiskEntry->BytesPerSector;
+SectorCount = PartSize * MB / DiskEntry->BytesPerSector;
 
 /* But never get larger than the unpartitioned disk space */
 if (SectorCount > PartEntry->SectorCount.QuadPart)
@@ -2255,15 +2255,15 @@
 
 DiskSize = DiskEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector;
 #if 0
-if (DiskSize >= 10737418240) /* 10 GB */
-{
-DiskSize = DiskSize / 1073741824;
+if (DiskSize >= 10 * GB) /* 10 GB */
+{
+DiskSize = DiskSize / GB;
 Unit = MUIGetString(STRING_GB);
 }
 else
 #endif
 {
-DiskSize = DiskSize / 1048576;
+DiskSize = DiskSize / MB;
 if (DiskSize == 0)
 DiskSize = 1;
 
@@ -2300,7 +2300,7 @@
 
 #if 0
 CONSOLE_PrintTextXY(8, 10, "Maximum size of the new partition is %I64u MB",
-PartitionList->CurrentPartition->SectorCount * 
DiskEntry->BytesPerSector / 1048576);
+PartitionList->CurrentPartition->SectorCount * 
DiskEntry->BytesPerSector / MB);
 #endif
 
 CONSOLE_SetStatusText(MUIGetString(STRING_CREATEPARTITION));
@@ -2308,7 +2308,7 @@

[ros-diffs] [hbelusca] 75507: [SETUPLIB]: IniCacheSave(): use the OBJ_CASE_INSENSITIVE flag.

2017-08-08 Thread hbelusca
Author: hbelusca
Date: Tue Aug  8 13:54:23 2017
New Revision: 75507

URL: http://svn.reactos.org/svn/reactos?rev=75507&view=rev
Log:
[SETUPLIB]: IniCacheSave(): use the OBJ_CASE_INSENSITIVE flag.

Modified:
branches/setup_improvements/base/setup/lib/inicache.c

Modified: branches/setup_improvements/base/setup/lib/inicache.c
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/lib/inicache.c?rev=75507&r1=75506&r2=75507&view=diff
==
--- branches/setup_improvements/base/setup/lib/inicache.c   [iso-8859-1] 
(original)
+++ branches/setup_improvements/base/setup/lib/inicache.c   [iso-8859-1] 
Tue Aug  8 13:54:23 2017
@@ -1057,7 +1057,7 @@
 
 InitializeObjectAttributes(&ObjectAttributes,
&Name,
-   0,
+   OBJ_CASE_INSENSITIVE,
NULL,
NULL);
 




[ros-diffs] [hbelusca] 75506: [BOOTDATA]: Update hivesetup.inf

2017-08-08 Thread hbelusca
Author: hbelusca
Date: Tue Aug  8 12:19:51 2017
New Revision: 75506

URL: http://svn.reactos.org/svn/reactos?rev=75506&view=rev
Log:
[BOOTDATA]: Update hivesetup.inf

Modified:
branches/setup_improvements/boot/bootdata/hivesetup.inf

Modified: branches/setup_improvements/boot/bootdata/hivesetup.inf
URL: 
http://svn.reactos.org/svn/reactos/branches/setup_improvements/boot/bootdata/hivesetup.inf?rev=75506&r1=75505&r2=75506&view=diff
==
--- branches/setup_improvements/boot/bootdata/hivesetup.inf [iso-8859-1] 
(original)
+++ branches/setup_improvements/boot/bootdata/hivesetup.inf [iso-8859-1] 
Tue Aug  8 12:19:51 2017
@@ -1391,9 +1391,6 @@
 HKLM,"SYSTEM\CurrentControlSet\Control\Session 
Manager\SubSystems","Required",0x0001,"Debug","Windows"
 HKLM,"SYSTEM\CurrentControlSet\Control\Session 
Manager\SubSystems","Windows",0x0002,"%SystemRoot%\system32\csrss.exe 
ObjectDirectory=\Windows SharedSection=1024,12288,512 Windows=On 
SubSystemType=Windows ServerDll=basesrv,1 
ServerDll=winsrv:UserServerDllInitialization,3 
ServerDll=winsrv:ConServerDllInitialization,2 ProfileControl=Off 
MaxRequestThreads=16"
 
-; App Compat -- Disable on ReactOS
-HKLM,"SYSTEM\CurrentControlSet\Control\Session 
Manager\AppCompatibility","DisableAppCompat",0x00010003, 0x0001
-
 ; This is an empty App Compat cache
 HKLM,"SYSTEM\CurrentControlSet\Control\Session 
Manager\AppCompatCache","AppCompatCache", 0x0001, \
   fe,0f,dc,ba,00,00,00,00
@@ -1519,7 +1516,7 @@
 ; Multiple UNC provider driver
 
HKLM,"SYSTEM\CurrentControlSet\Services\Mup","Description",0x,"Multiple 
UNC Provider (MUP)"
 
HKLM,"SYSTEM\CurrentControlSet\Services\Mup","ErrorControl",0x00010001,0x0001
-HKLM,"SYSTEM\CurrentControlSet\Services\Mup","Group",0x,"Network"
+HKLM,"SYSTEM\CurrentControlSet\Services\Mup","Group",0x,"File System"
 
HKLM,"SYSTEM\CurrentControlSet\Services\Mup","ImagePath",0x0002,"system32\drivers\mup.sys"
 HKLM,"SYSTEM\CurrentControlSet\Services\Mup","Start",0x00010001,0x
 HKLM,"SYSTEM\CurrentControlSet\Services\Mup","Type",0x00010001,0x0002
@@ -2204,4 +2201,58 @@
 UZBEK_CYRILLIC = "Uzbek (Cyrillic)"
 VIETNAMESE = "Vietnamese"
 
+
+; LANG_RUSSIAN SUBLANG_NEUTRAL
+[Strings.0019]
+
+; Services names and descriptions
+AUDIO_SERVICE="Звук и аудио"
+AUDIO_SERVICE_DESCRIPTION="Обеспечивает звуковыми 
устройствами программы."
+
+BITS_SERVICE="Фоновая интеллектуальная служба 
передачи (BITS)"
+BITS_SERVICE_DESCRIPTION="Обеспечивает передачу 
данных между клиентами и серверами в 
фоновом режиме с использованием 
пропускной способности простаивающей 
сети."
+
+EVENTLOG_SERVICE="Журнал событий"
+EVENTLOG_SERVICE_DESCRIPTION="Регистрирует события или 
сообщения, отправленные операционной 
системой в базе данных, доступной через 
средство просмотра журнала событий."
+
+MSISERVER_SERVICE="Установщик ReactOS"
+MSISERVER_SERVICE_DESCRIPTION="Управляет установкой, 
изменением и удалением программ, 
упакованных в MSI (установщик Windows)."
+
+NETLOGON_SERVICE="Сетевой вход в систему"
+NETLOGON_SERVICE_DESCRIPTION="Устанавливает безопасный 
канал связи с контроллером домена для 
проверки его подлинности."
+
+PLUGPLAY_SERVICE="Plug and Play"
+PLUGPLAY_SERVICE_DESCRIPTION="Обнаруживает изменения 
оборудования и по возможности 
устанавливает необходимое программное 
обеспечение."
+
+RPCSS_SERVICE="Удаленный вызов процедур (RPC)"
+RPCSS_SERVICE_DESCRIPTION="Подсистема для вызова 
удаленных процедур на локальной машине."
+
+SCHEDULE_SERVICE="Планировщик заданий"
+SCHEDULE_SERVICE_DESCRIPTION="Позволяет запускать 
программы в определенное время."
+
+SERVER_SERVICE="Сервер"
+SERVER_SERVICE_DESCRIPTION="Ð

[ros-diffs] [hbelusca] 75505: Sync with trunk r75504.

2017-08-08 Thread hbelusca
Author: hbelusca
Date: Tue Aug  8 12:13:31 2017
New Revision: 75505

URL: http://svn.reactos.org/svn/reactos?rev=75505&view=rev
Log:
Sync with trunk r75504.

Added:
branches/setup_improvements/dll/appcompat/apphelp/dbgheap.c
  - copied unchanged from r75504, 
trunk/reactos/dll/appcompat/apphelp/dbgheap.c
branches/setup_improvements/dll/win32/syssetup/resources/thmclassic.bmp
  - copied unchanged from r75504, 
trunk/reactos/dll/win32/syssetup/resources/thmclassic.bmp
branches/setup_improvements/dll/win32/syssetup/resources/thmlautus.bmp
  - copied unchanged from r75504, 
trunk/reactos/dll/win32/syssetup/resources/thmlautus.bmp
branches/setup_improvements/drivers/bus/acpi/acpica/dispatcher/dspkginit.c
  - copied unchanged from r75504, 
trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dspkginit.c
Removed:
branches/setup_improvements/media/rapps/burnawarefree.txt
Modified:
branches/setup_improvements/   (props changed)
branches/setup_improvements/base/applications/mspaint/imgarea.cpp
branches/setup_improvements/base/applications/mspaint/imgarea.h
branches/setup_improvements/base/applications/mspaint/selection.cpp
branches/setup_improvements/base/applications/mspaint/selection.h
branches/setup_improvements/base/applications/mspaint/sizebox.cpp
branches/setup_improvements/base/applications/mspaint/sizebox.h
branches/setup_improvements/base/applications/mspaint/winproc.cpp
branches/setup_improvements/base/applications/regedit/CMakeLists.txt
branches/setup_improvements/base/applications/regedit/framewnd.c
branches/setup_improvements/base/applications/regedit/settings.c
branches/setup_improvements/base/services/nfsd/readwrite.c
branches/setup_improvements/base/shell/explorer/trayntfy.cpp
branches/setup_improvements/base/shell/explorer/traywnd.cpp
branches/setup_improvements/boot/bootdata/hivecls.inf
branches/setup_improvements/boot/environ/CMakeLists.txt
branches/setup_improvements/boot/environ/app/bootmgr/bootmgr.c
branches/setup_improvements/boot/environ/lib/arch/stub/arch.c
branches/setup_improvements/boot/environ/lib/misc/image.c
branches/setup_improvements/boot/environ/lib/misc/util.c
branches/setup_improvements/boot/environ/lib/mm/stub/mm.c
branches/setup_improvements/boot/environ/lib/platform/time.c
branches/setup_improvements/boot/freeldr/freeldr/custom.c
branches/setup_improvements/boot/freeldr/freeldr/freeldr.c
branches/setup_improvements/boot/freeldr/freeldr/lib/inffile/inffile.c
branches/setup_improvements/dll/appcompat/apphelp/CMakeLists.txt
branches/setup_improvements/dll/appcompat/apphelp/apphelp.c
branches/setup_improvements/dll/appcompat/apphelp/apphelp.h
branches/setup_improvements/dll/appcompat/apphelp/hsdb.c
branches/setup_improvements/dll/appcompat/apphelp/layer.c
branches/setup_improvements/dll/appcompat/apphelp/sdbapi.c
branches/setup_improvements/dll/appcompat/apphelp/sdbfileattr.c
branches/setup_improvements/dll/appcompat/apphelp/sdbpapi.h
branches/setup_improvements/dll/appcompat/apphelp/sdbread.c
branches/setup_improvements/dll/appcompat/apphelp/sdbtypes.h
branches/setup_improvements/dll/appcompat/apphelp/sdbwrite.c
branches/setup_improvements/dll/appcompat/apphelp/shimeng.c
branches/setup_improvements/dll/appcompat/apphelp/shimeng.h
branches/setup_improvements/dll/appcompat/shims/genral/themes.c
branches/setup_improvements/dll/cpl/appwiz/lang/de-DE.rc
branches/setup_improvements/dll/cpl/desk/appearance.h
branches/setup_improvements/dll/cpl/desk/desk.c
branches/setup_improvements/dll/cpl/desk/theme.c
branches/setup_improvements/dll/cpl/inetcpl/lang/de-DE.rc
branches/setup_improvements/dll/cpl/joy/lang/de-DE.rc
branches/setup_improvements/dll/cpl/powercfg/CMakeLists.txt
branches/setup_improvements/dll/cpl/powercfg/lang/de-DE.rc
branches/setup_improvements/dll/cpl/telephon/lang/de-DE.rc
branches/setup_improvements/dll/cpl/usrmgr/lang/de-DE.rc
branches/setup_improvements/dll/np/nfs/nfs41_np.c
branches/setup_improvements/dll/ntdll/rtl/libsupp.c
branches/setup_improvements/dll/shellext/acppage/CLayerUIPropPage.cpp
branches/setup_improvements/dll/shellext/acppage/lang/de-DE.rc
branches/setup_improvements/dll/win32/comctl32/button.c
branches/setup_improvements/dll/win32/comctl32/theme_button.c
branches/setup_improvements/dll/win32/comctl32/toolbar.c
branches/setup_improvements/dll/win32/dbghelp/cpu_arm.c
branches/setup_improvements/dll/win32/kernel32/client/file/copy.c
branches/setup_improvements/dll/win32/kernel32/client/file/move.c
branches/setup_improvements/dll/win32/kernel32_vista/CMakeLists.txt
branches/setup_improvements/dll/win32/msvcrt/msvcrt.spec
branches/setup_improvements/dll/win32/security/CMakeLists.txt
branches/setup_improvements/dll/win32/shell32/folders/CDesktopFolder.cpp
bran

[ros-diffs] [hbelusca] 75501: [SYSSETUP]: Fix a typo.

2017-08-07 Thread hbelusca
Author: hbelusca
Date: Mon Aug  7 11:03:02 2017
New Revision: 75501

URL: http://svn.reactos.org/svn/reactos?rev=75501&view=rev
Log:
[SYSSETUP]: Fix a typo.

Modified:
trunk/reactos/dll/win32/syssetup/lang/fr-FR.rc

Modified: trunk/reactos/dll/win32/syssetup/lang/fr-FR.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/lang/fr-FR.rc?rev=75501&r1=75500&r2=75501&view=diff
==
--- trunk/reactos/dll/win32/syssetup/lang/fr-FR.rc  [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/syssetup/lang/fr-FR.rc  [iso-8859-1] Mon Aug  7 
11:03:02 2017
@@ -145,7 +145,7 @@
 IDS_PROCESSTITLE "Enregistrement des composants"
 IDS_PROCESSSUBTITLE "Veuillez patienter..."
 IDS_THEMESELECTIONTITLE "Apparence"
-IDS_THEMESELECTIONSUBTITLE "Sélectionnez le thème que vous préfèrez"
+IDS_THEMESELECTIONSUBTITLE "Sélectionnez le thème que vous préférez"
 END
 
 STRINGTABLE




[ros-diffs] [hbelusca] 75472: [FREELDR][INFLIB]: It is perfectly correct to retrieve the field of index == 0 of an INF line, by using the InfGetStringField() helper (corresponding to the SetupGetStrin

2017-08-03 Thread hbelusca
Author: hbelusca
Date: Thu Aug  3 14:56:07 2017
New Revision: 75472

URL: http://svn.reactos.org/svn/reactos?rev=75472&view=rev
Log:
[FREELDR][INFLIB]: It is perfectly correct to retrieve the field of index == 0 
of an INF line, by using the InfGetStringField() helper (corresponding to the 
SetupGetStringField() API).

Modified:
trunk/reactos/boot/freeldr/freeldr/lib/inffile/inffile.c
trunk/reactos/sdk/lib/inflib/infget.c

Modified: trunk/reactos/boot/freeldr/freeldr/lib/inffile/inffile.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/lib/inffile/inffile.c?rev=75472&r1=75471&r2=75472&view=diff
==
--- trunk/reactos/boot/freeldr/freeldr/lib/inffile/inffile.c[iso-8859-1] 
(original)
+++ trunk/reactos/boot/freeldr/freeldr/lib/inffile/inffile.c[iso-8859-1] 
Thu Aug  3 14:56:07 2017
@@ -1459,7 +1459,7 @@
 PCHAR Ptr;
 SIZE_T Size;
 
-if ((Context == NULL) || (Context->Line == NULL) || (FieldIndex == 0))
+if ((Context == NULL) || (Context->Line == NULL))
 {
 //  DPRINT("Invalid parameter\n");
 return FALSE;

Modified: trunk/reactos/sdk/lib/inflib/infget.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/inflib/infget.c?rev=75472&r1=75471&r2=75472&view=diff
==
--- trunk/reactos/sdk/lib/inflib/infget.c   [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/inflib/infget.c   [iso-8859-1] Thu Aug  3 
14:56:07 2017
@@ -548,7 +548,7 @@
   PWCHAR Ptr;
   ULONG Size;
 
-  if (Context == NULL || Context->Line == NULL || FieldIndex == 0)
+  if (Context == NULL || Context->Line == NULL)
 {
   DPRINT("Invalid parameter\n");
   return INF_STATUS_INVALID_PARAMETER;




[ros-diffs] [hbelusca] 75427: [ATL]: - Both the CAtlList class and its helper class CNode do not support copy construction. - Remove a redundant call to GetFreeNode(). CORE-13597

2017-07-27 Thread hbelusca
Author: hbelusca
Date: Thu Jul 27 19:08:55 2017
New Revision: 75427

URL: http://svn.reactos.org/svn/reactos?rev=75427&view=rev
Log:
[ATL]: - Both the CAtlList class and its helper class CNode do not support copy 
construction. - Remove a redundant call to GetFreeNode().
CORE-13597

Modified:
trunk/reactos/sdk/lib/atl/atlcoll.h

Modified: trunk/reactos/sdk/lib/atl/atlcoll.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/atl/atlcoll.h?rev=75427&r1=75426&r2=75427&view=diff
==
--- trunk/reactos/sdk/lib/atl/atlcoll.h [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/atl/atlcoll.h [iso-8859-1] Thu Jul 27 19:08:55 2017
@@ -155,6 +155,11 @@
 m_Element(Element)
 {
 }
+
+/* The CNode class does not support construction by copy */
+private:
+CNode(_In_ const CNode&);
+CNode& operator=(_In_ const CNode&);
 };
 
 private:
@@ -165,6 +170,11 @@
 CNode* m_FreeNode;
 size_t m_NumElements;
 
+/* The CAtlList class does not support construction by copy */
+private:
+CAtlList(_In_ const CAtlList&);
+CAtlList& operator=(_In_ const CAtlList&);
+
 public:
 CAtlList(_In_ UINT nBlockSize = 10);
 ~CAtlList();
@@ -481,7 +491,7 @@
 {
 GetFreeNode();
 
-CNode* NewNode = GetFreeNode();
+CNode* NewNode = m_FreeNode;
 CNode* NextFree = m_FreeNode->m_Next;
 
 NewNode = new CNode(element);




[ros-diffs] [hbelusca] 75395: Sync branch with trunk r75394.

2017-07-24 Thread hbelusca
Author: hbelusca
Date: Mon Jul 24 11:36:00 2017
New Revision: 75395

URL: http://svn.reactos.org/svn/reactos?rev=75395&view=rev
Log:
Sync branch with trunk r75394.

Added:
branches/setup_improvements/dll/keyboard/kbdeo/
  - copied from r75394, trunk/reactos/dll/keyboard/kbdeo/
branches/setup_improvements/dll/win32/kernel32/winnls/nls/eoa.nls
  - copied unchanged from r75394, 
trunk/reactos/dll/win32/kernel32/winnls/nls/eoa.nls
branches/setup_improvements/drivers/multimedia/CMakeLists.txt
  - copied unchanged from r75394, 
trunk/reactos/drivers/multimedia/CMakeLists.txt
branches/setup_improvements/drivers/multimedia/bdasup/CMakeLists.txt
  - copied unchanged from r75394, 
trunk/reactos/drivers/multimedia/bdasup/CMakeLists.txt
branches/setup_improvements/sdk/lib/crt/include/internal/popen.h
  - copied unchanged from r75394, 
trunk/reactos/sdk/lib/crt/include/internal/popen.h
Modified:
branches/setup_improvements/   (props changed)
branches/setup_improvements/base/applications/cmdutils/mode/lang/ru-RU.rc
branches/setup_improvements/base/applications/dxdiag/lang/ru-RU.rc
branches/setup_improvements/base/applications/mspaint/main.cpp
branches/setup_improvements/base/setup/usetup/inffile.h
branches/setup_improvements/base/shell/cmd/lang/cs-CZ.rc
branches/setup_improvements/base/shell/cmd/lang/de-DE.rc
branches/setup_improvements/base/shell/cmd/lang/el-GR.rc
branches/setup_improvements/base/shell/cmd/lang/en-US.rc
branches/setup_improvements/base/shell/cmd/lang/es-ES.rc
branches/setup_improvements/base/shell/cmd/lang/fr-FR.rc
branches/setup_improvements/base/shell/cmd/lang/hu-HU.rc
branches/setup_improvements/base/shell/cmd/lang/id-ID.rc
branches/setup_improvements/base/shell/cmd/lang/it-IT.rc
branches/setup_improvements/base/shell/cmd/lang/ja-JP.rc
branches/setup_improvements/base/shell/cmd/lang/no-NO.rc
branches/setup_improvements/base/shell/cmd/lang/pl-PL.rc
branches/setup_improvements/base/shell/cmd/lang/ro-RO.rc
branches/setup_improvements/base/shell/cmd/lang/ru-RU.rc
branches/setup_improvements/base/shell/cmd/lang/sk-SK.rc
branches/setup_improvements/base/shell/cmd/lang/sq-AL.rc
branches/setup_improvements/base/shell/cmd/lang/sv-SE.rc
branches/setup_improvements/base/shell/cmd/lang/tr-TR.rc
branches/setup_improvements/base/shell/cmd/lang/uk-UA.rc
branches/setup_improvements/base/shell/cmd/lang/zh-CN.rc
branches/setup_improvements/base/shell/cmd/lang/zh-TW.rc
branches/setup_improvements/base/shell/explorer/explorer.cpp
branches/setup_improvements/base/shell/explorer/taskband.cpp
branches/setup_improvements/base/shell/explorer/taskswnd.cpp
branches/setup_improvements/base/shell/explorer/traywnd.cpp
branches/setup_improvements/base/shell/rshell/misc.cpp
branches/setup_improvements/base/system/userinit/lang/ru-RU.rc
branches/setup_improvements/boot/bootdata/bootcd/unattend.inf
branches/setup_improvements/boot/bootdata/bootcdregtest/unattend.inf
branches/setup_improvements/boot/bootdata/caroots.inf
branches/setup_improvements/boot/bootdata/hivesft.inf
branches/setup_improvements/boot/bootdata/hivesys.inf
branches/setup_improvements/dll/appcompat/apphelp/shimeng.c
branches/setup_improvements/dll/appcompat/shims/shimlib/shimlib.c
branches/setup_improvements/dll/appcompat/shims/shimlib/shimlib.h
branches/setup_improvements/dll/cpl/console/lang/ru-RU.rc
branches/setup_improvements/dll/cpl/desk/lang/ru-RU.rc
branches/setup_improvements/dll/cpl/input/lang/bg-BG.rc
branches/setup_improvements/dll/cpl/input/lang/cs-CZ.rc
branches/setup_improvements/dll/cpl/input/lang/de-DE.rc
branches/setup_improvements/dll/cpl/input/lang/el-GR.rc
branches/setup_improvements/dll/cpl/input/lang/en-US.rc
branches/setup_improvements/dll/cpl/input/lang/es-ES.rc
branches/setup_improvements/dll/cpl/input/lang/fr-FR.rc
branches/setup_improvements/dll/cpl/input/lang/he-IL.rc
branches/setup_improvements/dll/cpl/input/lang/it-IT.rc
branches/setup_improvements/dll/cpl/input/lang/no-NO.rc
branches/setup_improvements/dll/cpl/input/lang/pl-PL.rc
branches/setup_improvements/dll/cpl/input/lang/pt-BR.rc
branches/setup_improvements/dll/cpl/input/lang/ro-RO.rc
branches/setup_improvements/dll/cpl/input/lang/ru-RU.rc
branches/setup_improvements/dll/cpl/input/lang/sk-SK.rc
branches/setup_improvements/dll/cpl/input/lang/sq-AL.rc
branches/setup_improvements/dll/cpl/input/lang/tr-TR.rc
branches/setup_improvements/dll/cpl/input/lang/uk-UA.rc
branches/setup_improvements/dll/cpl/input/lang/zh-CN.rc
branches/setup_improvements/dll/cpl/input/lang/zh-TW.rc
branches/setup_improvements/dll/cpl/input/resource.h
branches/setup_improvements/dll/cpl/mmsys/lang/ru-RU.rc
branches/setup_improvements/dll/keyboard/CMakeLists.txt
branches/setup_improvements/dll/opengl/mesa/

  1   2   3   4   5   6   7   8   9   10   >