[ros-diffs] [mjansen] 71529: [WIN32SS] Remember the last process that changed the displaymode with CDS_FULLSCREEN, restore mode after it quits. CORE-11358 #resolve

2016-06-05 Thread mjansen
Author: mjansen
Date: Sun Jun  5 11:16:02 2016
New Revision: 71529

URL: http://svn.reactos.org/svn/reactos?rev=71529=rev
Log:
[WIN32SS] Remember the last process that changed the displaymode with 
CDS_FULLSCREEN, restore mode after it quits. CORE-11358 #resolve

Modified:
trunk/reactos/win32ss/user/ntuser/display.c
trunk/reactos/win32ss/user/ntuser/main.c

Modified: trunk/reactos/win32ss/user/ntuser/display.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/display.c?rev=71529=71528=71529=diff
==
--- trunk/reactos/win32ss/user/ntuser/display.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/display.c [iso-8859-1] Sun Jun  5 
11:16:02 2016
@@ -10,6 +10,7 @@
 DBG_DEFAULT_CHANNEL(UserDisplay);
 
 BOOL gbBaseVideo = 0;
+static PPROCESSINFO gpFullscreen = NULL;
 
 static const PWCHAR KEY_VIDEO = 
L"\\Registry\\Machine\\HARDWARE\\DEVICEMAP\\VIDEO";
 
@@ -650,6 +651,16 @@
 return Status;
 }
 
+VOID
+UserUpdateFullscreen(
+DWORD flags)
+{
+if (flags & CDS_FULLSCREEN)
+gpFullscreen = gptiCurrent->ppi;
+else
+gpFullscreen = NULL;
+}
+
 LONG
 APIENTRY
 UserChangeDisplaySettings(
@@ -773,6 +784,8 @@
 
 goto leave;
 }
+
+UserUpdateFullscreen(flags);
 
 /* Update the system metrics */
 InitMetrics();
@@ -809,6 +822,18 @@
 return lResult;
 }
 
+VOID
+UserDisplayNotifyShutdown(
+PPROCESSINFO ppiCurrent)
+{
+if (ppiCurrent == gpFullscreen)
+{
+UserChangeDisplaySettings(NULL, NULL, 0, NULL);
+if (gpFullscreen)
+ERR("Failed to restore display mode!\n");
+}
+}
+
 LONG
 APIENTRY
 NtUserChangeDisplaySettings(

Modified: trunk/reactos/win32ss/user/ntuser/main.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/main.c?rev=71529=71528=71529=diff
==
--- trunk/reactos/win32ss/user/ntuser/main.c[iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/main.c[iso-8859-1] Sun Jun  5 
11:16:02 2016
@@ -677,6 +677,9 @@
 return Status;
 }
 
+VOID
+UserDisplayNotifyShutdown(PPROCESSINFO ppiCurrent);
+
 NTSTATUS
 NTAPI
 ExitThreadCallback(PETHREAD Thread)
@@ -805,6 +808,11 @@
 
gptiForeground = NULL;
 }
+
+/* Restore display mode when we are the last thread, and we changed the 
display mode */
+if (ppiCurrent->cThreads == 0)
+UserDisplayNotifyShutdown(ppiCurrent);
+
 
 // Fixes CORE-6384 & CORE-7030.
 /*if (ptiLastInput == ptiCurrent)




[ros-diffs] [mjansen] 71609: [WIN32SS] Try to load the module before fetching an icon, instead of failing on a module that is not available in the current process. CORE-10292 #resolve

2016-06-10 Thread mjansen
Author: mjansen
Date: Fri Jun 10 20:57:26 2016
New Revision: 71609

URL: http://svn.reactos.org/svn/reactos?rev=71609=rev
Log:
[WIN32SS] Try to load the module before fetching an icon, instead of failing on 
a module that is not available in the current process. CORE-10292 #resolve

Modified:
trunk/reactos/win32ss/user/user32/windows/cursoricon.c

Modified: trunk/reactos/win32ss/user/user32/windows/cursoricon.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/windows/cursoricon.c?rev=71609=71608=71609=diff
==
--- trunk/reactos/win32ss/user/user32/windows/cursoricon.c  [iso-8859-1] 
(original)
+++ trunk/reactos/win32ss/user/user32/windows/cursoricon.c  [iso-8859-1] 
Fri Jun 10 20:57:26 2016
@@ -1867,11 +1867,12 @@
 TRACE("Got module %wZ, resource %p (%S).\n", ,
 ustrRsrc.Buffer, IS_INTRESOURCE(ustrRsrc.Buffer) ? L"" : 
ustrRsrc.Buffer);
 
-/* Get the module handle */
-if (!GetModuleHandleExW(0, ustrModule.Buffer, ))
-{
-/* This should never happen */
-ERR("Invalid handle? Module='%wZ', error %lu.\n", , 
GetLastError());
+/* Get the module handle or load the module */
+hModule = LoadLibraryExW(ustrModule.Buffer, NULL, 
LOAD_LIBRARY_AS_IMAGE_RESOURCE | LOAD_LIBRARY_AS_DATAFILE);
+if (!hModule)
+{
+DWORD err = GetLastError();
+ERR("Unable to load/use module '%wZ' in process %lu, error 
%lu.\n", , GetCurrentProcessId(), err);
 SetLastError(ERROR_INVALID_PARAMETER);
 goto leave;
 }




[ros-diffs] [mjansen] 71513: [APPSHIM_APITEST] Show a few shims that do not use hooks to function.

2016-06-04 Thread mjansen
Author: mjansen
Date: Sat Jun  4 14:51:38 2016
New Revision: 71513

URL: http://svn.reactos.org/svn/reactos?rev=71513=rev
Log:
[APPSHIM_APITEST] Show a few shims that do not use hooks to function.

Modified:
trunk/rostests/apitests/appshim/versionlie.c

Modified: trunk/rostests/apitests/appshim/versionlie.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/appshim/versionlie.c?rev=71513=71512=71513=diff
==
--- trunk/rostests/apitests/appshim/versionlie.c[iso-8859-1] (original)
+++ trunk/rostests/apitests/appshim/versionlie.c[iso-8859-1] Sat Jun  4 
14:51:38 2016
@@ -279,6 +279,21 @@
 }
 }
 
+static void hookless_shim(LPCSTR shim)
+{
+DWORD num_shims = 0;
+WCHAR wide_shim[50] = { 0 };
+PHOOKAPI hook;
+MultiByteToWideChar(CP_ACP, 0, shim, -1, wide_shim, 50);
+hook = pGetHookAPIs("", wide_shim, _shims);
+if (hook == NULL)
+{
+skip("Skipping tests for layers (%s) not present in this os (0x%x)\n", 
shim, g_WinVersion);
+return;
+}
+ok(hook != NULL, "Expected hook to be a valid pointer for %s\n", shim);
+ok(num_shims == 0, "Expected not to find any apihooks, got: %u for %s\n", 
num_shims, shim);
+}
 
 VersionLieInfo g_Win95 = { 0xC3B60004, 4, 0, 950, VER_PLATFORM_WIN32_WINDOWS, 
0, 0 };
 VersionLieInfo g_WinNT4SP5 = { 0x05650004, 4, 0, 1381, VER_PLATFORM_WIN32_NT, 
5, 0 };
@@ -355,4 +370,8 @@
 run_test("VistaSP1VersionLie", _WinVistaSP1);
 run_test("VistaSP2VersionLie", _WinVistaSP2);
 run_test("Win7RTMVersionLie", _Win7RTM);
-}
+
+hookless_shim("Force8BitColor");
+hookless_shim("Force640x480");
+hookless_shim("DisableThemes");
+}




[ros-diffs] [mjansen] 71400: [APPHELP_APITEST] Remove some code duplication.

2016-05-25 Thread mjansen
Author: mjansen
Date: Wed May 25 17:22:47 2016
New Revision: 71400

URL: http://svn.reactos.org/svn/reactos?rev=71400=rev
Log:
[APPHELP_APITEST] Remove some code duplication.

Modified:
trunk/rostests/apitests/apphelp/apphelp.c
trunk/rostests/apitests/apphelp/data.c
trunk/rostests/apitests/apphelp/layerapi.c

Modified: trunk/rostests/apitests/apphelp/apphelp.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/apphelp/apphelp.c?rev=71400=71399=71400=diff
==
--- trunk/rostests/apitests/apphelp/apphelp.c   [iso-8859-1] (original)
+++ trunk/rostests/apitests/apphelp/apphelp.c   [iso-8859-1] Wed May 25 
17:22:47 2016
@@ -40,21 +40,22 @@
 void test_create_exe_imp(const char* name, int skip_rsrc_exports);
 void test_create_file_imp(const char* name, const char* contents, size_t len);
 void test_create_ne_imp(const char* name, int skip_names);
+DWORD get_host_winver();
 
 #define test_create_exe (winetest_set_location(__FILE__, __LINE__), 0) ? 
(void)0 : test_create_exe_imp
 #define test_create_file(winetest_set_location(__FILE__, __LINE__), 0) ? 
(void)0 : test_create_file_imp
 #define test_create_ne  (winetest_set_location(__FILE__, __LINE__), 0) ? 
(void)0 : test_create_ne_imp
 
 
-static DWORD g_Version;
-
-#define VERSION_ANY 0
-#define VERSION_WINXP   0x0501
-#define VERSION_20030x0502
-#define VERSION_VISTA   0x0600
-#define VERSION_WIN70x0601
-#define VERSION_WIN80x0602
-#define VERSION_WIN10   0x1000
+static DWORD g_WinVersion;
+
+#define WINVER_ANY 0
+#define WINVER_WINXP   0x0501
+#define WINVER_20030x0502
+#define WINVER_VISTA   0x0600
+#define WINVER_WIN70x0601
+#define WINVER_WIN80x0602
+#define WINVER_WIN10   0x1000
 
 
 typedef WORD TAG;
@@ -187,20 +188,20 @@
 const char* tags[7*8];
 } data[] = {
 {
-TAG_TYPE_NULL, 0x1000, __LINE__, VERSION_ANY, VERSION_2003,
+TAG_TYPE_NULL, 0x1000, __LINE__, WINVER_ANY, WINVER_2003,
 {
 "InvalidTag", "INCLUDE", "GENERAL", "MATCH_LOGIC_NOT", 
"APPLY_ALL_SHIMS", "USE_SERVICE_PACK_FILES", NULL
 }
 },
 {
-TAG_TYPE_NULL, 0x1000, __LINE__, VERSION_VISTA, VERSION_VISTA,
+TAG_TYPE_NULL, 0x1000, __LINE__, WINVER_VISTA, WINVER_VISTA,
 {
 "InvalidTag", "INCLUDE", "GENERAL", "MATCH_LOGIC_NOT", 
"APPLY_ALL_SHIMS", "USE_SERVICE_PACK_FILES", "MITIGATION_OS", "BLOCK_UPGRADE",
 "INCLUDEEXCLUDEDLL", NULL
 }
 },
 {
-TAG_TYPE_NULL, 0x1000, __LINE__, VERSION_WIN7, VERSION_ANY,
+TAG_TYPE_NULL, 0x1000, __LINE__, WINVER_WIN7, WINVER_ANY,
 {
 "InvalidTag", "INCLUDE", "GENERAL", "MATCH_LOGIC_NOT", 
"APPLY_ALL_SHIMS", "USE_SERVICE_PACK_FILES", "MITIGATION_OS", "BLOCK_UPGRADE",
 "INCLUDEEXCLUDEDLL", "RAC_EVENT_OFF", "TELEMETRY_OFF", 
"SHIM_ENGINE_OFF", "LAYER_PROPAGATION_OFF", "REINSTALL_UPGRADE", NULL
@@ -208,33 +209,33 @@
 },
 
 {
-TAG_TYPE_BYTE, 0x1000, __LINE__, VERSION_ANY, VERSION_ANY,
+TAG_TYPE_BYTE, 0x1000, __LINE__, WINVER_ANY, WINVER_ANY,
 {
 "InvalidTag", NULL
 }
 },
 
 {
-TAG_TYPE_WORD, 0x800, __LINE__, VERSION_ANY, VERSION_WIN7,
+TAG_TYPE_WORD, 0x800, __LINE__, WINVER_ANY, WINVER_WIN7,
 {
 "InvalidTag", "MATCH_MODE", NULL
 }
 },
 {
-TAG_TYPE_WORD, 0x800, __LINE__, VERSION_WIN8, VERSION_ANY,
+TAG_TYPE_WORD, 0x800, __LINE__, WINVER_WIN8, WINVER_ANY,
 {
 "InvalidTag", "MATCH_MODE", "QUIRK_COMPONENT_CODE_ID", 
"QUIRK_CODE_ID", NULL
 }
 },
 {
-TAG_TYPE_WORD | 0x800, 0x800, __LINE__, VERSION_ANY, VERSION_ANY,
+TAG_TYPE_WORD | 0x800, 0x800, __LINE__, WINVER_ANY, WINVER_ANY,
 {
 "InvalidTag", "TAG", "INDEX_TAG", "INDEX_KEY", NULL
 }
 },
 
 {
-TAG_TYPE_DWORD, 0x800, __LINE__, VERSION_ANY, VERSION_WINXP,
+TAG_TYPE_DWORD, 0x800, __LINE__, WINVER_ANY, WINVER_WINXP,
 {
 "InvalidTag", "SIZE", "OFFSET", "CHECKSUM", "SHIM_TAGID", 
"PATCH_TAGID", "MODULE_TYPE", "VERFILEDATEHI",
 "VERFILEDATELO", "VERFILEOS", "VERFILETYPE", "PE_CHECKSUM", 
"PREVOSMAJORVERSION", "PREVOSMINORVERSION", "PREVOSPLATFORMID", "PREVOSBUILDNO",
@@ -244,7 +245,7 @@
 }
 },
 {
-   

[ros-diffs] [mjansen] 71614: [APPHELP] Implement automatic stringtable generation when writing an Sdb database. CORE-10367

2016-06-11 Thread mjansen
Author: mjansen
Date: Sat Jun 11 21:12:43 2016
New Revision: 71614

URL: http://svn.reactos.org/svn/reactos?rev=71614=rev
Log:
[APPHELP] Implement automatic stringtable generation when writing an Sdb 
database. CORE-10367

Added:
trunk/reactos/dll/appcompat/apphelp/sdbstringtable.c   (with props)
trunk/reactos/dll/appcompat/apphelp/sdbstringtable.h   (with props)
trunk/reactos/dll/appcompat/hacking.txt   (with props)
Modified:
trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt
trunk/reactos/dll/appcompat/apphelp/apphelp.h
trunk/reactos/dll/appcompat/apphelp/sdbapi.c
trunk/reactos/dll/appcompat/apphelp/sdbpapi.h
trunk/reactos/dll/appcompat/apphelp/sdbtypes.h
trunk/reactos/dll/appcompat/apphelp/sdbwrite.c

Modified: trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt?rev=71614=71613=71614=diff
==
--- trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt  [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt  [iso-8859-1] Sat Jun 11 
21:12:43 2016
@@ -5,9 +5,10 @@
 apphelp.c
 layer.c
 sdbapi.c
+sdbfileattr.c
 sdbread.c
+sdbstringtable.c
 sdbwrite.c
-sdbfileattr.c
 apphelp.spec
 apphelp.h
 ${CMAKE_CURRENT_BINARY_DIR}/apphelp_stubs.c)

Modified: trunk/reactos/dll/appcompat/apphelp/apphelp.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/apphelp.h?rev=71614=71613=71614=diff
==
--- trunk/reactos/dll/appcompat/apphelp/apphelp.h   [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/apphelp.h   [iso-8859-1] Sat Jun 11 
21:12:43 2016
@@ -50,26 +50,11 @@
 };
 } ATTRINFO, *PATTRINFO;
 
-typedef enum _SHIM_LOG_LEVEL {
-SHIM_ERR = 1,
-SHIM_WARN = 2,
-SHIM_INFO = 3,
-}SHIM_LOG_LEVEL;
-
 /* apphelp.c */
-BOOL WINAPIV ShimDbgPrint(SHIM_LOG_LEVEL Level, PCSTR FunctionName, PCSTR 
Format, ...);
-extern ULONG g_ShimDebugLevel;
-
-#define SHIM_ERR(fmt, ...)  do { if (g_ShimDebugLevel) ShimDbgPrint(SHIM_ERR, 
__FUNCTION__, fmt, ##__VA_ARGS__ ); } while (0)
-#define SHIM_WARN(fmt, ...)  do { if (g_ShimDebugLevel) 
ShimDbgPrint(SHIM_WARN, __FUNCTION__, fmt, ##__VA_ARGS__ ); } while (0)
-#define SHIM_INFO(fmt, ...)  do { if (g_ShimDebugLevel) 
ShimDbgPrint(SHIM_INFO, __FUNCTION__, fmt, ##__VA_ARGS__ ); } while (0)
-
 
 #include "sdbpapi.h"
 
 PWSTR SdbpStrDup(LPCWSTR string);
-BOOL WINAPI SdbpCheckTagType(TAG tag, WORD type);
-BOOL WINAPI SdbpCheckTagIDType(PDB db, TAGID tagid, WORD type);
 
 PDB WINAPI SdbOpenDatabase(LPCWSTR path, PATH_TYPE type);
 void WINAPI SdbCloseDatabase(PDB);

Modified: trunk/reactos/dll/appcompat/apphelp/sdbapi.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdbapi.c?rev=71614=71613=71614=diff
==
--- trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] Sat Jun 11 
21:12:43 2016
@@ -23,6 +23,7 @@
 #include "ntndk.h"
 #include "strsafe.h"
 #include "apphelp.h"
+#include "sdbstringtable.h"
 
 #include "wine/unicode.h"
 
@@ -228,9 +229,6 @@
 
 InitializeObjectAttributes(, , OBJ_CASE_INSENSITIVE, NULL, NULL);
 
-//Status = NtCreateFile(>file, FILE_GENERIC_READ | SYNCHRONIZE,
-//  , , NULL, FILE_ATTRIBUTE_NORMAL, 
FILE_SHARE_READ,
-//  FILE_OPEN, FILE_NON_DIRECTORY_FILE | 
FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0);
 Status = NtCreateFile(>file, (write ? FILE_GENERIC_WRITE : 
FILE_GENERIC_READ )| SYNCHRONIZE,
   , , NULL, FILE_ATTRIBUTE_NORMAL, 
FILE_SHARE_READ,
   write ? FILE_SUPERSEDE : FILE_OPEN, 
FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0);
@@ -454,6 +452,10 @@
 
 if (db->file)
 NtClose(db->file);
+if (db->string_buffer)
+SdbCloseDatabase(db->string_buffer);
+if (db->string_lookup)
+SdbpTableDestroy(>string_lookup);
 SdbFree(db->data);
 SdbFree(db);
 }

Modified: trunk/reactos/dll/appcompat/apphelp/sdbpapi.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdbpapi.h?rev=71614=71613=71614=diff
==
--- trunk/reactos/dll/appcompat/apphelp/sdbpapi.h   [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/sdbpapi.h   [iso-8859-1] Sat Jun 11 
21:12:43 2016
@@ -68,6 +68,22 @@
 DWORD SdbpStrlen(PCWSTR string);
 DWORD SdbpStrsize(PCWSTR string);
 
+BOOL WINAPI SdbpCheckTagType(TAG tag, WORD type);
+BOOL WINAPI SdbpCheckTagIDType(PDB db, TAGID t

[ros-diffs] [mjansen] 71643: [SHELL32] Use the logoff dialog instead of the generic ConfirmDialog. Patch by Jared Smudde. CORE-11413 #resolve #comment Thanks!

2016-06-15 Thread mjansen
Author: mjansen
Date: Wed Jun 15 17:46:26 2016
New Revision: 71643

URL: http://svn.reactos.org/svn/reactos?rev=71643=rev
Log:
[SHELL32] Use the logoff dialog instead of the generic ConfirmDialog. Patch by 
Jared Smudde. CORE-11413 #resolve #comment Thanks!

Modified:
trunk/reactos/dll/win32/shell32/dialogs/dialogs.cpp
trunk/reactos/dll/win32/shell32/lang/bg-BG.rc
trunk/reactos/dll/win32/shell32/lang/ca-ES.rc
trunk/reactos/dll/win32/shell32/lang/cs-CZ.rc
trunk/reactos/dll/win32/shell32/lang/da-DK.rc
trunk/reactos/dll/win32/shell32/lang/de-DE.rc
trunk/reactos/dll/win32/shell32/lang/el-GR.rc
trunk/reactos/dll/win32/shell32/lang/en-GB.rc
trunk/reactos/dll/win32/shell32/lang/en-US.rc
trunk/reactos/dll/win32/shell32/lang/es-ES.rc
trunk/reactos/dll/win32/shell32/lang/fi-FI.rc
trunk/reactos/dll/win32/shell32/lang/fr-FR.rc
trunk/reactos/dll/win32/shell32/lang/he-IL.rc
trunk/reactos/dll/win32/shell32/lang/hu-HU.rc
trunk/reactos/dll/win32/shell32/lang/it-IT.rc
trunk/reactos/dll/win32/shell32/lang/ja-JP.rc
trunk/reactos/dll/win32/shell32/lang/ko-KR.rc
trunk/reactos/dll/win32/shell32/lang/nl-NL.rc
trunk/reactos/dll/win32/shell32/lang/no-NO.rc
trunk/reactos/dll/win32/shell32/lang/pl-PL.rc
trunk/reactos/dll/win32/shell32/lang/pt-BR.rc
trunk/reactos/dll/win32/shell32/lang/pt-PT.rc
trunk/reactos/dll/win32/shell32/lang/ro-RO.rc
trunk/reactos/dll/win32/shell32/lang/ru-RU.rc
trunk/reactos/dll/win32/shell32/lang/sk-SK.rc
trunk/reactos/dll/win32/shell32/lang/sl-SI.rc
trunk/reactos/dll/win32/shell32/lang/sq-AL.rc
trunk/reactos/dll/win32/shell32/lang/sv-SE.rc
trunk/reactos/dll/win32/shell32/lang/tr-TR.rc
trunk/reactos/dll/win32/shell32/lang/uk-UA.rc
trunk/reactos/dll/win32/shell32/lang/zh-CN.rc
trunk/reactos/dll/win32/shell32/lang/zh-TW.rc
trunk/reactos/dll/win32/shell32/shresdef.h

Modified: trunk/reactos/dll/win32/shell32/dialogs/dialogs.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/dialogs/dialogs.cpp?rev=71643=71642=71643=diff
==
--- trunk/reactos/dll/win32/shell32/dialogs/dialogs.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/dialogs/dialogs.cpp [iso-8859-1] Wed Jun 15 
17:46:26 2016
@@ -758,6 +758,40 @@
 return 0;
 }
 
+/*
+ * LogOffDialogProc
+ *
+ * NOTES: Used to make the Log Off dialog work
+ * 
+ */
+INT_PTR CALLBACK LogOffDialogProc(HWND hwnd, UINT Message, WPARAM wParam, 
LPARAM lParam)
+{
+switch(Message)
+{
+case WM_INITDIALOG:
+{
+return TRUE;
+}
+case WM_CLOSE:
+EndDialog(hwnd, IDCANCEL);
+break;
+case WM_COMMAND:
+switch(LOWORD(wParam))
+{
+case IDOK:
+ExitWindowsEx(EWX_LOGOFF, 0);
+break;
+case IDCANCEL:
+EndDialog(hwnd, IDCANCEL);
+break;
+}
+break;
+default:
+break;
+}
+return FALSE;
+}
+
 
 /*
  * LogoffWindowsDialog  [SHELL32.54]
@@ -765,9 +799,7 @@
 
 EXTERN_C int WINAPI LogoffWindowsDialog(HWND hWndOwner)
 {
-if (ConfirmDialog(hWndOwner, IDS_LOGOFF_PROMPT, IDS_LOGOFF_TITLE))
-ExitWindowsEx(EWX_LOGOFF, 0);
-
+DialogBox(shell32_hInstance, MAKEINTRESOURCE(IDD_LOG_OFF), hWndOwner, 
LogOffDialogProc);
 return 0;
 }
 

Modified: trunk/reactos/dll/win32/shell32/lang/bg-BG.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/bg-BG.rc?rev=71643=71642=71643=diff
==
--- trunk/reactos/dll/win32/shell32/lang/bg-BG.rc   [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/lang/bg-BG.rc   [iso-8859-1] Wed Jun 15 
17:46:26 2016
@@ -475,15 +475,15 @@
 ICON "", 12301, 50, 89, 21, 20, SS_REALSIZECONTROL
 END
 
-IDD_LOG_OFF DIALOGEX 0, 0, 190, 60
+IDD_LOG_OFF DIALOGEX 0, 0, 188, 60
 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION
 CAPTION "Излизане от РеактОС"
 FONT 8, "MS Shell Dlg"
 BEGIN
-ICON 45, 14344, 10, 10, 21, 20, SS_REALSIZECONTROL
+ICON IDI_SHELL_LOGOFF, IDC_STATIC, 8, 6, 21, 20
 LTEXT "Сигурни ли сте, че искате да 
излезете?", -1, 43, 11, 140, 22
-DEFPUSHBUTTON "&Излизане", IDOK, 57, 40, 60, 14
-PUSHBUTTON "Отказ", IDCANCEL, 122, 40, 60, 14
+DEFPUSHBUTTON "&Излизане", IDOK, 49, 38, 43, 14
+PUSHBUTTON "Отказ", IDCANCEL, 99, 38, 43, 14
 END
 
 IDD_DISCONNECT DIALOGEX 0, 0, 190, 60
@@ -709,8 +709,6 @@

[ros-diffs] [mjansen] 71572: [APPHELP_APITEST] Extend stringtable related tests. CORE-10367

2016-06-05 Thread mjansen
Author: mjansen
Date: Sun Jun  5 21:26:07 2016
New Revision: 71572

URL: http://svn.reactos.org/svn/reactos?rev=71572=rev
Log:
[APPHELP_APITEST] Extend stringtable related tests. CORE-10367

Modified:
trunk/rostests/apitests/apphelp/db.c

Modified: trunk/rostests/apitests/apphelp/db.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/apphelp/db.c?rev=71572=71571=71572=diff
==
--- trunk/rostests/apitests/apphelp/db.c[iso-8859-1] (original)
+++ trunk/rostests/apitests/apphelp/db.c[iso-8859-1] Sun Jun  5 
21:26:07 2016
@@ -315,6 +315,7 @@
 
 /*
  - Show that a stringtable is automatically generated,
+ - Show that entries in the stringtable are re-used,
  - validate multiple lists (for the length)
 */
 static void test_write_ex(void)
@@ -327,6 +328,7 @@
 TAG tag;
 DWORD size;
 BOOL ret;
+LPWSTR ptr;
 
 /* Write a small database */
 pdb = pSdbCreateDatabase(path1, DOS_PATH);
@@ -336,12 +338,14 @@
 tagdb = pSdbBeginWriteListTag(pdb, TAG_DATABASE);
 ok(tagdb == 12, "Expected tag to be 12, was %u\n", tagdb);
 ret = pSdbWriteStringTag(pdb, TAG_NAME, test1);
+ret = pSdbWriteStringTag(pdb, TAG_NAME, test2);
 ok(ret, "Expected SdbWriteStringTag to succeed\n");
 ret = pSdbEndWriteListTag(pdb, tagdb);
 ok(ret, "Expected SdbEndWriteListTag to succeed\n");
 
 tagdb = pSdbBeginWriteListTag(pdb, TAG_DATABASE);
-ok(tagdb == 24, "Expected tag to be 24, was %u\n", tagdb);
+ok(tagdb == 30, "Expected tag to be 24, was %u\n", tagdb);
+ret = pSdbWriteStringTag(pdb, TAG_NAME, test1);
 ret = pSdbWriteStringTag(pdb, TAG_NAME, test2);
 ok(ret, "Expected SdbWriteStringTag to succeed\n");
 ret = pSdbEndWriteListTag(pdb, tagdb);
@@ -354,10 +358,12 @@
 ok(pdb != NULL, "Expected a valid database\n");
 if (!pdb)
 return;
+
 tagdb = pSdbFindFirstTag(pdb, TAGID_ROOT, TAG_DATABASE);
 ok(tagdb == 12, "Expected tag to be 12, was %u\n", tagdb);
 size = pSdbGetTagDataSize(pdb, tagdb);
-ok(size == 6, "Expected size to be 6, was %u\n", size);
+ok(size == 12, "Expected size to be 12, was %u\n", size);
+
 tagstr = pSdbFindFirstTag(pdb, tagdb, TAG_NAME);
 ok(tagstr == 18, "Expected string tag to be 18, was %u\n", tagstr);
 tag = pSdbGetTagFromTagID(pdb, tagstr);
@@ -365,38 +371,160 @@
 size = pSdbGetTagDataSize(pdb, tagstr);
 ok(size == 4, "Expected size to be 4, was 0x%x\n", size);
 
+tagstr = pSdbFindNextTag(pdb, tagdb, tagstr);
+ok(tagstr == 24, "Expected string tag to be 24, was %u\n", tagstr);
+tag = pSdbGetTagFromTagID(pdb, tagstr);
+ok(tag == TAG_NAME, "Expected tag to be TAG_NAME, was 0x%x\n", (DWORD)tag);
+size = pSdbGetTagDataSize(pdb, tagstr);
+ok(size == 4, "Expected size to be 4, was 0x%x\n", size);
+
 tagdb = pSdbFindNextTag(pdb, TAGID_ROOT, tagdb);
-ok(tagdb == 24, "Expected tag to be 24, was %u\n", tagdb);
+ok(tagdb == 30, "Expected tag to be 30, was %u\n", tagdb);
 size = pSdbGetTagDataSize(pdb, tagdb);
-ok(size == 6, "Expected size to be 6, was %u\n", size);
+ok(size == 12, "Expected size to be 12, was %u\n", size);
+
 tagstr = pSdbFindFirstTag(pdb, tagdb, TAG_NAME);
-ok(tagstr == 30, "Expected string tag to be 30, was %u\n", tagstr);
+ok(tagstr == 36, "Expected string tag to be 36, was %u\n", tagstr);
 tag = pSdbGetTagFromTagID(pdb, tagstr);
 ok(tag == TAG_NAME, "Expected tag to be TAG_NAME, was 0x%x\n", (DWORD)tag);
 size = pSdbGetTagDataSize(pdb, tagstr);
 ok(size == 4, "Expected size to be 4, was %u\n", size);
 
+tagstr = pSdbFindNextTag(pdb, tagdb, tagstr);
+ok(tagstr == 42, "Expected string tag to be 42, was %u\n", tagstr);
+tag = pSdbGetTagFromTagID(pdb, tagstr);
+ok(tag == TAG_NAME, "Expected tag to be TAG_NAME, was 0x%x\n", (DWORD)tag);
+size = pSdbGetTagDataSize(pdb, tagstr);
+ok(size == 4, "Expected size to be 4, was 0x%x\n", size);
+
 tagdb = pSdbFindFirstTag(pdb, TAGID_ROOT, TAG_STRINGTABLE);
-ok(tagdb == 36, "Expected tag to be 36, was %u\n", tagdb);
+ok(tagdb == 48, "Expected tag to be 48, was %u\n", tagdb);
 size = pSdbGetTagDataSize(pdb, tagdb);
 ok(size == 32, "Expected size to be 32, was %u\n", size);
+
 tagstr = pSdbGetFirstChild(pdb, tagdb);
-ok(tagstr == 42, "Expected string tag to be 42, was %u\n", tagstr);
+ok(tagstr == 54, "Expected string tag to be 54, was %u\n", tagstr);
 tag = pSdbGetTagFromTagID(pdb, tagstr);
 ok(tag == TAG_STRINGTABLE_ITEM, "Expected tag to be TAG_STRINGTABLE_ITEM, 
was 0x%x\n", 

[ros-diffs] [mjansen] 71447: [APPSHIM_APITEST] Move versionlie tests to a dedicate shim-test binary.

2016-05-28 Thread mjansen
Author: mjansen
Date: Sat May 28 21:33:56 2016
New Revision: 71447

URL: http://svn.reactos.org/svn/reactos?rev=71447=rev
Log:
[APPSHIM_APITEST] Move versionlie tests to a dedicate shim-test binary.

Added:
trunk/rostests/apitests/appshim/
trunk/rostests/apitests/appshim/CMakeLists.txt   (with props)
trunk/rostests/apitests/appshim/testlist.c   (with props)
trunk/rostests/apitests/appshim/versionlie.c   (with props)
Removed:
trunk/rostests/apitests/apphelp/versionlie.c
Modified:
trunk/rostests/apitests/CMakeLists.txt
trunk/rostests/apitests/apphelp/CMakeLists.txt
trunk/rostests/apitests/apphelp/testlist.c

Modified: trunk/rostests/apitests/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/CMakeLists.txt?rev=71447=71446=71447=diff
==
--- trunk/rostests/apitests/CMakeLists.txt  [iso-8859-1] (original)
+++ trunk/rostests/apitests/CMakeLists.txt  [iso-8859-1] Sat May 28 
21:33:56 2016
@@ -2,6 +2,7 @@
 
 add_subdirectory(advapi32)
 add_subdirectory(apphelp)
+add_subdirectory(appshim)
 add_subdirectory(atl)
 add_subdirectory(browseui)
 add_subdirectory(com)

Modified: trunk/rostests/apitests/apphelp/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/apphelp/CMakeLists.txt?rev=71447=71446=71447=diff
==
--- trunk/rostests/apitests/apphelp/CMakeLists.txt  [iso-8859-1] (original)
+++ trunk/rostests/apitests/apphelp/CMakeLists.txt  [iso-8859-1] Sat May 28 
21:33:56 2016
@@ -6,7 +6,6 @@
 data.c
 db.c
 layerapi.c
-versionlie.c
 testlist.c)
 
 add_executable(apphelp_apitest ${SOURCE})

Modified: trunk/rostests/apitests/apphelp/testlist.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/apphelp/testlist.c?rev=71447=71446=71447=diff
==
--- trunk/rostests/apitests/apphelp/testlist.c  [iso-8859-1] (original)
+++ trunk/rostests/apitests/apphelp/testlist.c  [iso-8859-1] Sat May 28 
21:33:56 2016
@@ -6,13 +6,11 @@
 extern void func_apphelp(void);
 extern void func_db(void);
 extern void func_layerapi(void);
-extern void func_versionlie(void);
 
 const struct test winetest_testlist[] =
 {
 { "apphelp", func_apphelp },
 { "db", func_db },
 { "layerapi", func_layerapi },
-{ "versionlie", func_versionlie },
 { 0, 0 }
 };

Removed: trunk/rostests/apitests/apphelp/versionlie.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/apphelp/versionlie.c?rev=71446
==
--- trunk/rostests/apitests/apphelp/versionlie.c[iso-8859-1] (original)
+++ trunk/rostests/apitests/apphelp/versionlie.c(removed)
@@ -1,350 +0,0 @@
-/*
- * Copyright 2015 Mark Jansen
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include 
-#define WIN32_NO_STATUS
-#include 
-#ifdef __REACTOS__
-#include 
-#else
-#include 
-#endif
-#include 
-#include "wine/test.h"
-
-/* data.c */
-DWORD get_host_winver(void);
-
-typedef struct tagHOOKAPI {
-PCSTR LibraryName;
-PCSTR FunctionName;
-PVOID ReplacementFunction;
-PVOID OriginalFunction;
-PVOID Unk1;
-PVOID Unk2;
-} HOOKAPI, *PHOOKAPI;
-
-static BOOL (WINAPI* pSdbGetAppPatchDir)(PVOID,LPWSTR,DWORD);
-static PHOOKAPI (WINAPI* pGetHookAPIs)(LPCSTR,LPCWSTR,PDWORD);
-
-
-static DWORD g_WinVersion;
-#define WINVER_WINXP   0x0501
-
-
-typedef struct VersionLieInfo
-{
-DWORD FullVersion;
-DWORD dwMajorVersion;
-DWORD dwMinorVersion;
-DWORD dwBuildNumber;
-DWORD dwPlatformId;
-WORD wServicePackMajor;
-WORD wServicePackMinor;
-} VersionLieInfo;
-
-typedef BOOL(WINAPI* GETVERSIONEXAPROC)(LPOSVERSIONINFOEXA);
-typedef BOOL(WINAPI* GETVERSIONEXWPROC)(LPOSVERSIONINFOEXW);
-typedef DWORD(WINAPI* GETVERSIONPROC)(void);
-
-static void expect_shim_imp(PHOOKAPI hook, PCSTR library, PCSTR function, 
PCSTR shim, int* same)
-{
-int lib = lstrcmpA(library, hook->LibraryName);
-int fn = lstrcmpA(function, hook->FunctionName);
-winetest_ok(lib

[ros-diffs] [mjansen] 71448: [APPHELP_APITEST] Update embedded database to actually match the embedded exe again.

2016-05-28 Thread mjansen
Author: mjansen
Date: Sat May 28 21:46:24 2016
New Revision: 71448

URL: http://svn.reactos.org/svn/reactos?rev=71448=rev
Log:
[APPHELP_APITEST] Update embedded database to actually match the embedded exe 
again.

Modified:
trunk/rostests/apitests/apphelp/apphelp.c
trunk/rostests/apitests/apphelp/data.c
trunk/rostests/apitests/apphelp/db.c

Modified: trunk/rostests/apitests/apphelp/apphelp.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/apphelp/apphelp.c?rev=71448=71447=71448=diff
==
--- trunk/rostests/apitests/apphelp/apphelp.c   [iso-8859-1] (original)
+++ trunk/rostests/apitests/apphelp/apphelp.c   [iso-8859-1] Sat May 28 
21:46:24 2016
@@ -1,7 +1,7 @@
 /*
  * Copyright 2012 Detlef Riekenberg
  * Copyright 2013 Mislav Blažević
- * Copyright 2016 Mark Jansen
+ * Copyright 2015,2016 Mark Jansen
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -131,7 +131,6 @@
 
DEFINE_GUID(GUID_DATABASE_MSI,0xd8ff6d16,0x6a3a,0x468a,0x8b,0x44,0x01,0x71,0x4d,0xdc,0x49,0xea);
 
DEFINE_GUID(GUID_DATABASE_SHIM,0x,0x,0x,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11);
 
DEFINE_GUID(GUID_DATABASE_DRIVERS,0xf9ab2228,0x3312,0x4a73,0xb6,0xf9,0x93,0x6d,0x70,0xe1,0x12,0xef);
-DEFINE_GUID(GUID_DATABASE_TEST,0x6E989AB7,0x864D,0x4575,0x87,0x34,0x90,0x36,0x4A,0xC6,0x4F,0xBD);
 
 DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
 DEFINE_GUID(test_UserAssist, 0xdd313e04, 0xfeff, 0x11d1, 0x8e, 0xcd, 0x00, 
0x00, 0xf8, 0x7a, 0x47, 0x0c);

Modified: trunk/rostests/apitests/apphelp/data.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/apphelp/data.c?rev=71448=71447=71448=diff
==
--- trunk/rostests/apitests/apphelp/data.c  [iso-8859-1] (original)
+++ trunk/rostests/apitests/apphelp/data.c  [iso-8859-1] Sat May 28 
21:46:24 2016
@@ -586,8 +586,8 @@
 0x03, 0x78, 0x0E, 0x00, 0x00, 0x00, 0x02, 0x38, 0x04, 0x70, 0x03, 0x38,
 0x01, 0x60, 0x01, 0x98, 0x00, 0x00, 0x00, 0x00, 0x03, 0x78, 0x26, 0x00,
 0x00, 0x00, 0x02, 0x38, 0x0D, 0x70, 0x03, 0x38, 0x15, 0x40, 0x01, 0x98,
-0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x74, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x18, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x74, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x50, 0x04, 0x00, 0x00, 0x03, 0x78, 0x14, 0x00, 0x00, 0x00, 0x02, 0x38,
 0x10, 0x70, 0x03, 0x38, 0x01, 0x60, 0x16, 0x40, 0x01, 0x00, 0x00, 0x00,
 0x01, 0x98, 0x00, 0x00, 0x00, 0x00, 0x03, 0x78, 0x0E, 0x00, 0x00, 0x00,
@@ -596,27 +596,27 @@
 0x03, 0x38, 0x04, 0x90, 0x16, 0x40, 0x01, 0x00, 0x00, 0x00, 0x01, 0x98,
 0x00, 0x00, 0x00, 0x00, 0x03, 0x78, 0x3E, 0x00, 0x00, 0x00, 0x02, 0x38,
 0x07, 0x70, 0x03, 0x38, 0x04, 0x90, 0x01, 0x98, 0x30, 0x00, 0x00, 0x00,
-0xB5, 0x16, 0xDD, 0x96, 0xC9, 0x6B, 0xC5, 0x04, 0x7C, 0x03, 0x00, 0x00,
-0xCA, 0xA0, 0x3C, 0x5A, 0xDD, 0xFC, 0x99, 0x19, 0xC6, 0x01, 0x00, 0x00,
-0x72, 0xC6, 0xBB, 0xB9, 0x20, 0x71, 0xE3, 0x27, 0xEC, 0x02, 0x00, 0x00,
-0xBF, 0x27, 0xFB, 0xFF, 0x09, 0xB0, 0x4D, 0x8E, 0x56, 0x02, 0x00, 0x00,
-0x01, 0x70, 0x42, 0x03, 0x00, 0x00, 0x01, 0x50, 0x3E, 0x96, 0x3F, 0x00,
-0xE6, 0xF3, 0xD0, 0x01, 0x22, 0x60, 0x06, 0x00, 0x00, 0x00, 0x01, 0x60,
+0xED, 0xB4, 0x89, 0x50, 0xB1, 0xA4, 0x82, 0xA7, 0xEC, 0x02, 0x00, 0x00,
+0x85, 0x2B, 0x88, 0x40, 0x97, 0x76, 0xA6, 0xC4, 0xC6, 0x01, 0x00, 0x00,
+0x77, 0x7A, 0xBF, 0x48, 0x78, 0xB1, 0x69, 0xD2, 0x56, 0x02, 0x00, 0x00,
+0xD0, 0x15, 0xE6, 0xCB, 0xE8, 0x90, 0x68, 0xFE, 0x7C, 0x03, 0x00, 0x00,
+0x01, 0x70, 0x42, 0x03, 0x00, 0x00, 0x01, 0x50, 0x3E, 0xD6, 0xC0, 0x02,
+0x1A, 0xB9, 0xD1, 0x01, 0x22, 0x60, 0x06, 0x00, 0x00, 0x00, 0x01, 0x60,
 0x1C, 0x00, 0x00, 0x00, 0x23, 0x40, 0x01, 0x00, 0x00, 0x00, 0x07, 0x90,
-0x10, 0x00, 0x00, 0x00, 0xB7, 0x9A, 0x98, 0x6E, 0x4D, 0x86, 0x75, 0x45,
-0x87, 0x34, 0x90, 0x36, 0x4A, 0xC6, 0x4F, 0xBD, 0x02, 0x70, 0x00, 0x00,
+0x10, 0x00, 0x00, 0x00, 0xB0, 0x0E, 0x9B, 0xE3, 0xDB, 0x55, 0x0B, 0x45,
+0x9B, 0xD4, 0xD2, 0x0C, 0x94, 0x84, 0x26, 0x0F, 0x02, 0x70, 0x00, 0x00,
 0x00, 0x00, 0x0B, 0x70, 0x32, 0x00, 0x00, 0x00, 0x01, 0x60, 0x3E, 0x00,
 0x00, 0x00, 0x09, 0x70, 0x26, 0x00, 0x00, 0x00, 0x01, 0x60, 0x5C, 0x00,
-0x00, 0x00, 0x08, 0x60, 0x82, 0x00, 0x00, 0x00, 0x03, 0x70, 0x08, 0x00,
-0x00, 0x00, 0x01, 0x10, 0x03, 0x60, 0xA0, 0x00, 0x00, 0x00, 0x03, 0x70,
-0x06, 0x00, 0x00, 0x00, 0x03, 0x60, 0xBE, 0x00, 0x00, 0x00, 0x07, 0x70,
+0x00, 0x00, 0x08, 0x60, 0x82, 0x00, 0x00, 0x00, 0x03, 0x70, 0x06, 0x00,
+0x00, 0x00, 0x03, 0x60, 0xA0, 0x00, 0x00, 0x00, 0x03, 0x70, 0x08, 0x00,
+0x00, 0x00, 0x01, 0x10, 0x03, 0x60, 0xBE, 0x00, 0x00, 0x00, 0x07, 0x70

[ros-diffs] [mjansen] 71442: [APPHELP][APPHELP_APITEST] Implement various VersionLie shims. CORE-11299 #resolve - Implement VersionLie shims - Add tests for the VersionLie shims - update get_host_winv

2016-05-28 Thread mjansen
Author: mjansen
Date: Sat May 28 17:55:56 2016
New Revision: 71442

URL: http://svn.reactos.org/svn/reactos?rev=71442=rev
Log:
[APPHELP][APPHELP_APITEST] Implement various VersionLie shims. CORE-11299 
#resolve
- Implement VersionLie shims
- Add tests for the VersionLie shims
- update get_host_winver prototype (thanks to Thomas for pointing out my err)

We cannot apply this shim yet, since a required part of the infrastructure is 
missing.

Added:
trunk/reactos/dll/appcompat/shims/layer/
trunk/reactos/dll/appcompat/shims/layer/CMakeLists.txt   (with props)
trunk/reactos/dll/appcompat/shims/layer/layer.spec   (with props)
trunk/reactos/dll/appcompat/shims/layer/main.c   (with props)
trunk/reactos/dll/appcompat/shims/layer/versionlie.c   (with props)
trunk/reactos/dll/appcompat/shims/layer/versionlie.inl   (with props)
trunk/rostests/apitests/apphelp/versionlie.c   (with props)
Modified:
trunk/reactos/dll/appcompat/shims/CMakeLists.txt
trunk/rostests/apitests/apphelp/CMakeLists.txt
trunk/rostests/apitests/apphelp/apphelp.c
trunk/rostests/apitests/apphelp/data.c
trunk/rostests/apitests/apphelp/layerapi.c
trunk/rostests/apitests/apphelp/testlist.c

Modified: trunk/reactos/dll/appcompat/shims/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/shims/CMakeLists.txt?rev=71442=71441=71442=diff
==
--- trunk/reactos/dll/appcompat/shims/CMakeLists.txt[iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/shims/CMakeLists.txt[iso-8859-1] Sat May 28 
17:55:56 2016
@@ -1,3 +1,4 @@
 
 add_subdirectory(shimlib)
+add_subdirectory(layer)
 

Added: trunk/reactos/dll/appcompat/shims/layer/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/shims/layer/CMakeLists.txt?rev=71442
==
--- trunk/reactos/dll/appcompat/shims/layer/CMakeLists.txt  (added)
+++ trunk/reactos/dll/appcompat/shims/layer/CMakeLists.txt  [iso-8859-1] 
Sat May 28 17:55:56 2016
@@ -0,0 +1,18 @@
+
+include_directories(${SHIMLIB_DIR})
+
+spec2def(aclayers.dll layer.spec)
+
+list(APPEND SOURCE
+versionlie.c
+main.c
+layer.spec)
+
+add_library(aclayers SHARED
+${SOURCE}
+${CMAKE_CURRENT_BINARY_DIR}/aclayers.def)
+
+set_module_type(aclayers win32dll)
+target_link_libraries(aclayers shimlib)
+add_importlibs(aclayers msvcrt kernel32 ntdll)
+add_cd_file(TARGET aclayers DESTINATION reactos/AppPatch FOR all)

Propchange: trunk/reactos/dll/appcompat/shims/layer/CMakeLists.txt
--
svn:eol-style = native

Added: trunk/reactos/dll/appcompat/shims/layer/layer.spec
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/shims/layer/layer.spec?rev=71442
==
--- trunk/reactos/dll/appcompat/shims/layer/layer.spec  (added)
+++ trunk/reactos/dll/appcompat/shims/layer/layer.spec  [iso-8859-1] Sat May 28 
17:55:56 2016
@@ -0,0 +1,3 @@
+
+@ stdcall GetHookAPIs(str wstr ptr)
+@ stdcall NotifyShims(long ptr)

Propchange: trunk/reactos/dll/appcompat/shims/layer/layer.spec
--
svn:eol-style = native

Added: trunk/reactos/dll/appcompat/shims/layer/main.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/shims/layer/main.c?rev=71442
==
--- trunk/reactos/dll/appcompat/shims/layer/main.c  (added)
+++ trunk/reactos/dll/appcompat/shims/layer/main.c  [iso-8859-1] Sat May 28 
17:55:56 2016
@@ -0,0 +1,37 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT: ReactOS Shim library
+ * FILE:dll/appcompat/shims/layer/main.c
+ * PURPOSE: Shim entrypoint
+ * PROGRAMMER:  Mark Jansen
+ */
+
+#include 
+#include 
+#include 
+
+/* Forward to the generic implementation */
+PHOOKAPI WINAPI GetHookAPIs(IN LPCSTR szCommandLine, IN LPCWSTR wszShimName, 
OUT PDWORD pdwHookCount)
+{
+return ShimLib_GetHookAPIs(szCommandLine, wszShimName, pdwHookCount);
+}
+
+/* PLDR_DATA_TABLE_ENTRY */
+BOOL WINAPI NotifyShims(DWORD fdwReason, PVOID P)
+{
+return TRUE;
+}
+
+BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
+{
+switch(dwReason)
+{
+case DLL_PROCESS_ATTACH:
+ShimLib_Init(hInstance);
+break;
+case DLL_PROCESS_DETACH:
+ShimLib_Deinit();
+break;
+}
+return TRUE;
+}

Propchange: trunk/reactos/dll/appcompat/shims/layer/main.c
--
svn:eol-style = native

Added: trunk/reactos/dll/appcompat/shims/layer/versionlie.c
URL: 
http://svn.reactos.org/svn/reactos

[ros-diffs] [mjansen] 71439: [APPHELP] Begin shimlib implementation. CORE-11329 Implement some macro's and functions that help when registering shims. These are all written in C, so that wine can use

2016-05-28 Thread mjansen
Author: mjansen
Date: Sat May 28 16:42:57 2016
New Revision: 71439

URL: http://svn.reactos.org/svn/reactos?rev=71439=rev
Log:
[APPHELP] Begin shimlib implementation. CORE-11329
Implement some macro's and functions that help when registering shims.
These are all written in C, so that wine can use the shim libraries as well.

Added:
trunk/reactos/dll/appcompat/shims/
trunk/reactos/dll/appcompat/shims/CMakeLists.txt   (with props)
trunk/reactos/dll/appcompat/shims/shimlib/
trunk/reactos/dll/appcompat/shims/shimlib/CMakeLists.txt   (with props)
trunk/reactos/dll/appcompat/shims/shimlib/implement_shim.inl   (with props)
trunk/reactos/dll/appcompat/shims/shimlib/setup_shim.inl   (with props)
trunk/reactos/dll/appcompat/shims/shimlib/shimlib.c   (with props)
trunk/reactos/dll/appcompat/shims/shimlib/shimlib.h   (with props)
Modified:
trunk/reactos/dll/appcompat/CMakeLists.txt

Modified: trunk/reactos/dll/appcompat/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/CMakeLists.txt?rev=71439=71438=71439=diff
==
--- trunk/reactos/dll/appcompat/CMakeLists.txt  [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/CMakeLists.txt  [iso-8859-1] Sat May 28 
16:42:57 2016
@@ -1,2 +1,5 @@
+project(appcompat)
 
+set(SHIMLIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/shims/shimlib)
 add_subdirectory(apphelp)
+add_subdirectory(shims)

Added: trunk/reactos/dll/appcompat/shims/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/shims/CMakeLists.txt?rev=71439
==
--- trunk/reactos/dll/appcompat/shims/CMakeLists.txt(added)
+++ trunk/reactos/dll/appcompat/shims/CMakeLists.txt[iso-8859-1] Sat May 28 
16:42:57 2016
@@ -0,0 +1,3 @@
+
+add_subdirectory(shimlib)
+

Propchange: trunk/reactos/dll/appcompat/shims/CMakeLists.txt
--
svn:eol-style = native

Added: trunk/reactos/dll/appcompat/shims/shimlib/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/shims/shimlib/CMakeLists.txt?rev=71439
==
--- trunk/reactos/dll/appcompat/shims/shimlib/CMakeLists.txt(added)
+++ trunk/reactos/dll/appcompat/shims/shimlib/CMakeLists.txt[iso-8859-1] 
Sat May 28 16:42:57 2016
@@ -0,0 +1,7 @@
+
+list(APPEND SOURCE
+shimlib.c
+shimlib.h)
+
+add_library(shimlib ${SOURCE})
+add_dependencies(shimlib xdk)

Propchange: trunk/reactos/dll/appcompat/shims/shimlib/CMakeLists.txt
--
svn:eol-style = native

Added: trunk/reactos/dll/appcompat/shims/shimlib/implement_shim.inl
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/shims/shimlib/implement_shim.inl?rev=71439
==
--- trunk/reactos/dll/appcompat/shims/shimlib/implement_shim.inl(added)
+++ trunk/reactos/dll/appcompat/shims/shimlib/implement_shim.inl
[iso-8859-1] Sat May 28 16:42:57 2016
@@ -0,0 +1,76 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT: ReactOS Shim library
+ * FILE:dll/appcompat/shims/shimlib/implement_shim.inl
+ * PURPOSE: Shimlib helper file, used to register shims using the 
earlier prepared macro's
+ * PROGRAMMER:  Mark Jansen
+ */
+
+#ifndef SHIM_NS
+#error "A namespace should be provided in SHIM_NS before including this file!"
+#endif
+
+#ifndef SHIM_NUM_HOOKS
+#error "The number of hooks should be provided in SHIM_NUM_HOOKS before 
including this file!"
+#endif
+
+#ifndef SHIM_OBJ_NAME
+#error "setup_shim.inl should be included before this file!"
+#endif
+
+#ifndef SHIM_SETUP_HOOKS
+#error "Please define a hook: #define SHIM_SETUP_HOOKS SHIM_HOOK(num, 
dll_name, function_name, your_function)"
+#endif
+
+PHOOKAPI WINAPI SHIM_OBJ_NAME(InitializeHooksMulti)(DWORD fdwReason, PCSTR 
pszCmdLine, PDWORD pdwHookCount)
+{
+if (fdwReason == SHIM_REASON_ATTACH)
+{
+if (pszCmdLine)
+{
+SHIM_OBJ_NAME(g_szCommandLine) = 
ShimLib_StringDuplicateA(pszCmdLine);
+}
+else
+{
+SHIM_OBJ_NAME(g_szCommandLine) = "";
+}
+SHIM_OBJ_NAME(g_pAPIHooks) = ShimLib_ShimMalloc(sizeof(HOOKAPI) * 
SHIM_NUM_HOOKS);
+ZeroMemory(SHIM_OBJ_NAME(g_pAPIHooks), sizeof(HOOKAPI) * 
SHIM_NUM_HOOKS);
+*pdwHookCount = SHIM_NUM_HOOKS;
+}
+
+#ifdef SHIM_NOTIFY_FN
+if (!SHIM_NOTIFY_FN(fdwReason) && fdwReason == SHIM_REASON_ATTACH)
+return NULL;
+#endif
+
+if (fdwReason == SHIM_REASON_ATTACH)
+{
+SHIM_SETUP_HOOKS
+}
+return SHIM_OBJ_NAME(g_pAPIHook

[ros-diffs] [mjansen] 71440: [APPHELP] Register AppPatch directory with cmake, import SdbGetAppPatchDir implementation from Mislav Blažević CORE-10369

2016-05-28 Thread mjansen
Author: mjansen
Date: Sat May 28 16:47:39 2016
New Revision: 71440

URL: http://svn.reactos.org/svn/reactos?rev=71440=rev
Log:
[APPHELP] Register AppPatch directory with cmake, import SdbGetAppPatchDir 
implementation from Mislav Blažević CORE-10369

Modified:
trunk/reactos/boot/bootdata/packages/reactos.dff.in
trunk/reactos/dll/appcompat/apphelp/apphelp.h
trunk/reactos/dll/appcompat/apphelp/apphelp.spec
trunk/reactos/dll/appcompat/apphelp/sdbapi.c
trunk/reactos/sdk/cmake/CMakeMacros.cmake

Modified: trunk/reactos/boot/bootdata/packages/reactos.dff.in
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/reactos.dff.in?rev=71440=71439=71440=diff
==
--- trunk/reactos/boot/bootdata/packages/reactos.dff.in [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/packages/reactos.dff.in [iso-8859-1] Sat May 28 
16:47:39 2016
@@ -69,6 +69,7 @@
 50 = security\templates
 51 = system32\CatRoot
 52 = system32\CatRoot2
+53 = AppPatch
 
 .InfEnd
 

Modified: trunk/reactos/dll/appcompat/apphelp/apphelp.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/apphelp.h?rev=71440=71439=71440=diff
==
--- trunk/reactos/dll/appcompat/apphelp/apphelp.h   [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/apphelp.h   [iso-8859-1] Sat May 28 
16:47:39 2016
@@ -49,6 +49,11 @@
 #define SDB_DATABASE_MAIN_MSI 0x8002
 #define SDB_DATABASE_MAIN_SHIM 0x8003
 #define SDB_DATABASE_MAIN_DRIVERS 0x8004
+
+typedef struct _SDB {
+PDB db;
+BOOL auto_loaded;
+} SDB, *HSDB;
 
 typedef struct tagATTRINFO {
   TAG   type;

Modified: trunk/reactos/dll/appcompat/apphelp/apphelp.spec
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/apphelp.spec?rev=71440=71439=71440=diff
==
--- trunk/reactos/dll/appcompat/apphelp/apphelp.spec[iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/apphelp.spec[iso-8859-1] Sat May 28 
16:47:39 2016
@@ -52,7 +52,7 @@
 @ stub SdbFreeFileInfo
 @ stub SdbFreeFlagInfo
 @ stub SdbGetAppCompatDataSize
-@ stub SdbGetAppPatchDir
+@ stdcall SdbGetAppPatchDir(ptr wstr long)
 @ stdcall SdbGetBinaryTagData(ptr long)
 @ stdcall SdbGetDatabaseID(ptr ptr)
 @ stub SdbGetDatabaseInformation

Modified: trunk/reactos/dll/appcompat/apphelp/sdbapi.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdbapi.c?rev=71440=71439=71440=diff
==
--- trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] Sat May 28 
16:47:39 2016
@@ -431,6 +431,53 @@
 NtClose(db->file);
 SdbFree(db->data);
 SdbFree(db);
+}
+
+/**
+ * Retrieves AppPatch directory.
+ *
+ * @param [in]  db  Handle to the shim database.
+ * @param [out] pathPointer to memory in which path shall be written.
+ * @param [in]  sizeSize of the buffer in characters.
+ */
+BOOL WINAPI SdbGetAppPatchDir(HSDB db, LPWSTR path, DWORD size)
+{
+static WCHAR* default_dir = NULL;
+
+if(!default_dir)
+{
+WCHAR* tmp = NULL;
+UINT len = GetSystemWindowsDirectoryW(NULL, 0) + lstrlenW((CONST 
WCHAR[]){'\\','A','p','p','P','a','t','c','h',0});
+tmp = SdbAlloc((len + 1)* sizeof(WCHAR));
+if(tmp)
+{
+UINT r = GetSystemWindowsDirectoryW(tmp, len+1);
+if (r && r < len)
+{
+if (SUCCEEDED(StringCchCatW(tmp, len+1, (CONST 
WCHAR[]){'\\','A','p','p','P','a','t','c','h',0})))
+{
+if(InterlockedCompareExchangePointer((void**)_dir, 
tmp, NULL) == NULL)
+tmp = NULL;
+}
+}
+if (tmp)
+SdbFree(tmp);
+}
+}
+
+/* In case function fails, path holds empty string */
+if (size > 0)
+*path = 0;
+
+if (!db)
+{
+return SUCCEEDED(StringCchCopyW(path, size, default_dir));
+}
+else
+{
+/* fixme */
+return FALSE;
+}
 }
 
 /**

Modified: trunk/reactos/sdk/cmake/CMakeMacros.cmake
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/cmake/CMakeMacros.cmake?rev=71440=71439=71440=diff
==
--- trunk/reactos/sdk/cmake/CMakeMacros.cmake   [iso-8859-1] (original)
+++ trunk/reactos/sdk/cmake/CMakeMacros.cmake   [iso-8859-1] Sat May 28 
16:47:39 2016
@@ -261,6 +261,8 @@
 set(${var} 51)
 elseif(${dir} STREQUAL reactos/system32/CatRoot2)
 set(${var} 52)
+elseif(${dir} STREQUAL reactos/AppPatch)
+set(${var} 53)
 else()

[ros-diffs] [mjansen] 71477: [APPHELP][ACLAYER][APPSHIM_APITEST] Fix some WCHAR hack constructions that VS 2010 didn't like, as pointed out by Hermès

2016-05-31 Thread mjansen
Author: mjansen
Date: Tue May 31 18:02:54 2016
New Revision: 71477

URL: http://svn.reactos.org/svn/reactos?rev=71477=rev
Log:
[APPHELP][ACLAYER][APPSHIM_APITEST] Fix some WCHAR hack constructions that VS 
2010 didn't like, as pointed out by Hermès

Modified:
trunk/reactos/dll/appcompat/apphelp/sdbapi.c
trunk/reactos/dll/appcompat/shims/layer/versionlie.inl
trunk/rostests/apitests/appshim/versionlie.c

Modified: trunk/reactos/dll/appcompat/apphelp/sdbapi.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdbapi.c?rev=71477=71476=71477=diff
==
--- trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] Tue May 31 
18:02:54 2016
@@ -443,18 +443,19 @@
 BOOL WINAPI SdbGetAppPatchDir(HSDB db, LPWSTR path, DWORD size)
 {
 static WCHAR* default_dir = NULL;
+static CONST WCHAR szAppPatch[] = {'\\','A','p','p','P','a','t','c','h',0};
 
 if(!default_dir)
 {
 WCHAR* tmp = NULL;
-UINT len = GetSystemWindowsDirectoryW(NULL, 0) + lstrlenW((CONST 
WCHAR[]){'\\','A','p','p','P','a','t','c','h',0});
+UINT len = GetSystemWindowsDirectoryW(NULL, 0) + lstrlenW(szAppPatch);
 tmp = SdbAlloc((len + 1)* sizeof(WCHAR));
 if(tmp)
 {
 UINT r = GetSystemWindowsDirectoryW(tmp, len+1);
 if (r && r < len)
 {
-if (SUCCEEDED(StringCchCatW(tmp, len+1, (CONST 
WCHAR[]){'\\','A','p','p','P','a','t','c','h',0})))
+if (SUCCEEDED(StringCchCatW(tmp, len+1, szAppPatch)))
 {
 if(InterlockedCompareExchangePointer((void**)_dir, 
tmp, NULL) == NULL)
 tmp = NULL;

Modified: trunk/reactos/dll/appcompat/shims/layer/versionlie.inl
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/shims/layer/versionlie.inl?rev=71477=71476=71477=diff
==
--- trunk/reactos/dll/appcompat/shims/layer/versionlie.inl  [iso-8859-1] 
(original)
+++ trunk/reactos/dll/appcompat/shims/layer/versionlie.inl  [iso-8859-1] 
Tue May 31 18:02:54 2016
@@ -47,12 +47,13 @@
 {
 if (fdwReason == SHIM_REASON_ATTACH && VERSION_INFO.wServicePackMajor)
 {
+static CONST WCHAR szServicePack[] = {'S','e','r','v','i','c','e',' 
','P','a','c','k',' ','%','u',0};
 HRESULT hr = StringCbPrintfA(VERSION_INFO.szCSDVersionA, 
sizeof(VERSION_INFO.szCSDVersionA),
 "Service Pack %u", VERSION_INFO.wServicePackMajor);
 if (FAILED(hr))
 return FALSE;
 StringCbPrintfW(VERSION_INFO.szCSDVersionW, 
sizeof(VERSION_INFO.szCSDVersionW),
-(CONST WCHAR[]){'S','e','r','v','i','c','e',' ','P','a','c','k',' 
','%','u',0}, VERSION_INFO.wServicePackMajor);
+szServicePack, VERSION_INFO.wServicePackMajor);
 if (FAILED(hr))
 return FALSE;
 }
@@ -71,3 +72,4 @@
 #include 
 
 #undef VERSION_INFO
+

Modified: trunk/rostests/apitests/appshim/versionlie.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/appshim/versionlie.c?rev=71477=71476=71477=diff
==
--- trunk/rostests/apitests/appshim/versionlie.c[iso-8859-1] (original)
+++ trunk/rostests/apitests/appshim/versionlie.c[iso-8859-1] Tue May 31 
18:02:54 2016
@@ -161,6 +161,7 @@
 }
 if (ok1 && ok2)
 {
+static const WCHAR szCSDFMT[] = {'S','e','r','v','i','c','e',' 
','P','a','c','k',' ','%','u',0};
 WCHAR szCSDVersion[128] = { 0 };
 winetest_ok(v1.dwOSVersionInfoSize == v2.dwOSVersionInfoSize, 
"Expected dwOSVersionInfoSize to be equal, was: %u, %u for %s\n", 
v1.dwOSVersionInfoSize, v2.dwOSVersionInfoSize, shim);
 winetest_ok(info->dwMajorVersion == v2.dwMajorVersion, "Expected 
dwMajorVersion to be equal, was: %u, %u for %s\n", info->dwMajorVersion, 
v2.dwMajorVersion, shim);
@@ -169,7 +170,7 @@
 winetest_ok(info->dwPlatformId == v2.dwPlatformId, "Expected 
dwPlatformId to be equal, was: %u, %u for %s\n", info->dwPlatformId, 
v2.dwPlatformId, shim);
 
 if (info->wServicePackMajor)
-swprintf(szCSDVersion, (const 
WCHAR[]){'S','e','r','v','i','c','e',' ','P','a','c','k',' ','%','u',0}, 
info->wServicePackMajor);
+swprintf(szCSDVersion, szCSDFMT, info->wServicePackMajor);
 winetest_ok(lstrcmpW(szCSDVersion, v2.szCSDVersion) == 0, 
"Expected szCSDVersion to be equal, was: %s, %s for %s\n", 
wine_dbgstr_w(szCSDVersion), wine_dbgstr_w(v2.szCSDVersion), shim);
 
 if (v1.dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXW))




[ros-diffs] [mjansen] 71476: [SHELL32] Rename CShell to CShellDispatch CORE-6892

2016-05-31 Thread mjansen
Author: mjansen
Date: Tue May 31 17:40:44 2016
New Revision: 71476

URL: http://svn.reactos.org/svn/reactos?rev=71476=rev
Log:
[SHELL32] Rename CShell to CShellDispatch CORE-6892

Added:
trunk/reactos/dll/win32/shell32/CShellDispatch.cpp   (with props)
trunk/reactos/dll/win32/shell32/CShellDispatch.h   (with props)
Removed:
trunk/reactos/dll/win32/shell32/CShell.cpp
trunk/reactos/dll/win32/shell32/CShell.h
Modified:
trunk/reactos/dll/win32/shell32/CDefViewDual.cpp
trunk/reactos/dll/win32/shell32/CMakeLists.txt
trunk/reactos/dll/win32/shell32/precomp.h
trunk/reactos/dll/win32/shell32/shell32.cpp
trunk/reactos/dll/win32/shell32/wine/shell32_main.h

Modified: trunk/reactos/dll/win32/shell32/CDefViewDual.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefViewDual.cpp?rev=71476=71475=71476=diff
==
--- trunk/reactos/dll/win32/shell32/CDefViewDual.cpp[iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CDefViewDual.cpp[iso-8859-1] Tue May 31 
17:40:44 2016
@@ -47,7 +47,7 @@
 {
 if (!app) return E_INVALIDARG;
 
-return CShell_Constructor(IID_IDispatch, (LPVOID*)app);
+return CShellDispatch_Constructor(IID_IDispatch, (LPVOID*)app);
 }
 
 virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch **parent) 
override

Modified: trunk/reactos/dll/win32/shell32/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CMakeLists.txt?rev=71476=71475=71476=diff
==
--- trunk/reactos/dll/win32/shell32/CMakeLists.txt  [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CMakeLists.txt  [iso-8859-1] Tue May 31 
17:40:44 2016
@@ -65,7 +65,7 @@
 CDefaultContextMenu.cpp
 COpenWithMenu.cpp
 CNewMenu.cpp
-CShell.cpp
+CShellDispatch.cpp
 CFolder.cpp
 CFolderItems.cpp
 CFolderItemVerbs.cpp

Removed: trunk/reactos/dll/win32/shell32/CShell.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CShell.cpp?rev=71475
==
--- trunk/reactos/dll/win32/shell32/CShell.cpp  [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CShell.cpp  (removed)
@@ -1,325 +0,0 @@
-/*
- * IShellDispatch implementation
- *
- * Copyright 2015 Mark Jansen
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "precomp.h"
-
-WINE_DEFAULT_DEBUG_CHANNEL(shell);
-
-
-CShell::CShell()
-{
-}
-
-CShell::~CShell()
-{
-}
-
-HRESULT CShell::Initialize()
-{
-return S_OK;
-}
-
-// *** IShellDispatch methods ***
-HRESULT STDMETHODCALLTYPE CShell::get_Application(IDispatch **ppid)
-{
-TRACE("(%p, %p)\n", this, ppid);
-return E_NOTIMPL;
-}
-
-HRESULT STDMETHODCALLTYPE CShell::get_Parent(IDispatch **ppid)
-{
-TRACE("(%p, %p)\n", this, ppid);
-return E_NOTIMPL;
-}
-
-HRESULT VariantToIdlist(VARIANT* var, LPITEMIDLIST* idlist)
-{
-HRESULT hr = S_FALSE;
-if(V_VT(var) == VT_I4)
-{
-hr = SHGetSpecialFolderLocation(NULL, V_I4(var), idlist);
-}
-else if(V_VT(var) == VT_BSTR)
-{
-hr = SHILCreateFromPathW(V_BSTR(var), idlist, NULL);
-}
-return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CShell::NameSpace(VARIANT vDir, Folder **ppsdf)
-{
-TRACE("(%p, %s, %p)\n", this, debugstr_variant(), ppsdf);
-if (!ppsdf)
-return E_POINTER;
-*ppsdf = NULL;
-LPITEMIDLIST idlist = NULL;
-HRESULT hr = VariantToIdlist(, );
-if (!SUCCEEDED(hr) || !idlist)
-return S_FALSE;
-CFolder* fld = new CComObject();
-fld->Init(idlist);
-*ppsdf = fld;
-fld->AddRef();
-return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CShell::BrowseForFolder(LONG Hwnd, BSTR Title, LONG 
Options, VARIANT RootFolder, Folder **ppsdf)
-{
-TRACE("(%p, %lu, %ls, %lu, %s, %p)\n", this, Hwnd, Title, Options, 
debugstr_variant(), ppsdf);
-return E_NOTIMPL;
-}
-
-HRESULT STDMETHODCALLTYPE CShell::Windows(IDispatch **ppid)
-{
-TRACE("(%p, %p)\n", this, ppid);
-return E_NOTIMPL;
-}
-
-HRESU

[ros-diffs] [mjansen] 71501: [APPHELP_APITEST][APPHELP] Add new tests showing that SdbWriteStringTag and SdbEndWriteListTag are incorrect, fix SdbEndWriteListTag CORE-10367 SdbWriteStringTag requires

2016-06-02 Thread mjansen
Author: mjansen
Date: Thu Jun  2 18:59:04 2016
New Revision: 71501

URL: http://svn.reactos.org/svn/reactos?rev=71501=rev
Log:
[APPHELP_APITEST][APPHELP] Add new tests showing that SdbWriteStringTag and 
SdbEndWriteListTag are incorrect, fix SdbEndWriteListTag CORE-10367
SdbWriteStringTag requires the database to keep track of written strings, and 
append a stringtable to a database.

Modified:
trunk/reactos/dll/appcompat/apphelp/sdbapi.c
trunk/reactos/dll/appcompat/apphelp/sdbpapi.h
trunk/reactos/dll/appcompat/apphelp/sdbwrite.c
trunk/rostests/apitests/apphelp/db.c

Modified: trunk/reactos/dll/appcompat/apphelp/sdbapi.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdbapi.c?rev=71501=71500=71501=diff
==
--- trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] Thu Jun  2 
18:59:04 2016
@@ -259,12 +259,17 @@
 
 DWORD SdbpStrlen(PCWSTR string)
 {
-return (lstrlenW(string) + 1) * sizeof(WCHAR);
+return lstrlenW(string);
+}
+
+DWORD SdbpStrsize(PCWSTR string)
+{
+return (SdbpStrlen(string) + 1) * sizeof(WCHAR);
 }
 
 PWSTR SdbpStrDup(LPCWSTR string)
 {
-PWSTR ret = SdbpAlloc(SdbpStrlen(string));
+PWSTR ret = SdbpAlloc(SdbpStrsize(string));
 lstrcpyW(ret, string);
 return ret;
 }

Modified: trunk/reactos/dll/appcompat/apphelp/sdbpapi.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdbpapi.h?rev=71501=71500=71501=diff
==
--- trunk/reactos/dll/appcompat/apphelp/sdbpapi.h   [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/sdbpapi.h   [iso-8859-1] Thu Jun  2 
18:59:04 2016
@@ -65,7 +65,8 @@
 
 PDB WINAPI SdbpCreate(LPCWSTR path, PATH_TYPE type, BOOL write);
 void WINAPI SdbpFlush(PDB db);
-DWORD SdbpStrlen(LPCWSTR string);
+DWORD SdbpStrlen(PCWSTR string);
+DWORD SdbpStrsize(PCWSTR string);
 
 
 #ifdef __cplusplus

Modified: trunk/reactos/dll/appcompat/apphelp/sdbwrite.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdbwrite.c?rev=71501=71500=71501=diff
==
--- trunk/reactos/dll/appcompat/apphelp/sdbwrite.c  [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/sdbwrite.c  [iso-8859-1] Thu Jun  2 
18:59:04 2016
@@ -36,6 +36,10 @@
 #include "sdbtagid.h"
 
 #endif
+
+BOOL WINAPI SdbWriteStringRefTag(PDB db, TAG tag, TAGID tagid);
+TAGID WINAPI SdbBeginWriteListTag(PDB db, TAG tag);
+BOOL WINAPI SdbEndWriteListTag(PDB db, TAGID tagid);
 
 
 static void WINAPI SdbpWrite(PDB db, const void* data, DWORD size)
@@ -51,6 +55,23 @@
 db->write_iter += size;
 }
 
+static BOOL WINAPI SdbpGetOrAddStringRef(PDB db, LPCWSTR string, TAGID* tagid)
+{
+/* TODO:
+- Insert or find in stringtable
+- return TAGID
+*/
+
+return FALSE;
+}
+
+static void WINAPI SdbpWriteStringtable(PDB db)
+{
+TAGID table = SdbBeginWriteListTag(db, TAG_STRINGTABLE);
+/* TODO: Write out all strings*/
+SdbEndWriteListTag(db, table);
+}
+
 /**
  * Creates new shim database file
  * 
@@ -90,6 +111,7 @@
  */
 void WINAPI SdbCloseDatabaseWrite(PDB db)
 {
+SdbpWriteStringtable(db);
 SdbpFlush(db);
 SdbCloseDatabase(db);
 }
@@ -181,10 +203,19 @@
 {
 DWORD size;
 
+if (SdbpCheckTagType(tag, TAG_TYPE_STRINGREF))
+{
+TAGID tagid = 0;
+if (!SdbpGetOrAddStringRef(db, string, ))
+return FALSE;
+
+return SdbWriteStringRefTag(db, tag, tagid);
+}
+
 if (!SdbpCheckTagType(tag, TAG_TYPE_STRING))
 return FALSE;
 
-size = SdbpStrlen(string);
+size = SdbpStrsize(string);
 SdbpWrite(db, , sizeof(TAG));
 SdbpWrite(db, , sizeof(size));
 SdbpWrite(db, string, size);
@@ -297,7 +328,7 @@
 return FALSE;
 
 /* Write size of list to list tag header */
-*(DWORD*)>data[tagid + sizeof(TAG)] = db->write_iter - tagid - 
sizeof(TAG);
-return TRUE;
-}
-
+*(DWORD*)>data[tagid + sizeof(TAG)] = db->write_iter - tagid - 
sizeof(TAG) - sizeof(TAGID);
+return TRUE;
+}
+

Modified: trunk/rostests/apitests/apphelp/db.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/apphelp/db.c?rev=71501=71500=71501=diff
==
--- trunk/rostests/apitests/apphelp/db.c[iso-8859-1] (original)
+++ trunk/rostests/apitests/apphelp/db.c[iso-8859-1] Thu Jun  2 
18:59:04 2016
@@ -312,6 +312,91 @@
 }
 DeleteFileW(path1);
 }
+
+/*
+ - Show that a stringtable is automatically generated,
+ - validate multiple lists (for the length)
+*/
+static void test_write_ex(void)
+{
+WCHAR path1[] = {'t','e','s','t','.','s','d','b',0};
+WCHAR tes

[ros-diffs] [mjansen] 71488: [APPHELP] Remove all NT api usage from sdbwrite, split apphelp.h header out in preparation of xml2sdb CORE-11302

2016-06-01 Thread mjansen
Author: mjansen
Date: Wed Jun  1 19:10:19 2016
New Revision: 71488

URL: http://svn.reactos.org/svn/reactos?rev=71488=rev
Log:
[APPHELP] Remove all NT api usage from sdbwrite, split apphelp.h header out in 
preparation of xml2sdb CORE-11302

Added:
trunk/reactos/dll/appcompat/apphelp/sdbpapi.h   (with props)
trunk/reactos/dll/appcompat/apphelp/sdbtagid.h   (with props)
trunk/reactos/dll/appcompat/apphelp/sdbtypes.h   (with props)
Modified:
trunk/reactos/dll/appcompat/apphelp/apphelp.h
trunk/reactos/dll/appcompat/apphelp/sdbapi.c
trunk/reactos/dll/appcompat/apphelp/sdbwrite.c

Modified: trunk/reactos/dll/appcompat/apphelp/apphelp.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/apphelp.h?rev=71488=71487=71488=diff
==
--- trunk/reactos/dll/appcompat/apphelp/apphelp.h   [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/apphelp.h   [iso-8859-1] Wed Jun  1 
19:10:19 2016
@@ -1,6 +1,6 @@
 /*
  * Copyright 2013 Mislav Blažević
- * Copyright 2015 Mark Jansen
+ * Copyright 2015,2016 Mark Jansen
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -24,22 +24,7 @@
 extern "C" {
 #endif
 
-typedef WORD TAG;
-typedef DWORD TAGID;
-typedef DWORD TAGREF;
-typedef UINT64 QWORD;
-
-#define TAGREF_NULL (0)
-#define TAGREF_ROOT (0)
-
-typedef struct _DB {
-HANDLE file;
-DWORD size;
-PBYTE data;
-TAGID stringtable;
-DWORD write_iter;
-GUID database_id;
-} DB, *PDB;
+#include "sdbtypes.h"
 
 /* Flags for SdbInitDatabase */
 #define HID_DOS_PATHS 0x1
@@ -56,19 +41,14 @@
 } SDB, *HSDB;
 
 typedef struct tagATTRINFO {
-  TAG   type;
-  DWORD flags;
-  union {
-QWORD qwattr;
-DWORD dwattr;
-WCHAR *lpattr;
-  };
+TAG   type;
+DWORD flags;
+union {
+QWORD qwattr;
+DWORD dwattr;
+WCHAR *lpattr;
+};
 } ATTRINFO, *PATTRINFO;
-
-typedef enum _PATH_TYPE {
-DOS_PATH,
-NT_PATH
-} PATH_TYPE;
 
 typedef enum _SHIM_LOG_LEVEL {
 SHIM_ERR = 1,
@@ -85,46 +65,12 @@
 #define SHIM_INFO(fmt, ...)  do { if (g_ShimDebugLevel) 
ShimDbgPrint(SHIM_INFO, __FUNCTION__, fmt, ##__VA_ARGS__ ); } while (0)
 
 
-/* sdbapi.c */
-void SdbpHeapInit(void);
-void SdbpHeapDeinit(void);
-#if SDBAPI_DEBUG_ALLOC
+#include "sdbpapi.h"
 
-LPVOID SdbpAlloc(SIZE_T size, int line, const char* file);
-LPVOID SdbpReAlloc(LPVOID mem, SIZE_T size, int line, const char* file);
-void SdbpFree(LPVOID mem, int line, const char* file);
-
-#define SdbAlloc(size) SdbpAlloc(size, __LINE__, __FILE__)
-#define SdbReAlloc(mem, size) SdbpReAlloc(mem, size, __LINE__, __FILE__)
-#define SdbFree(mem) SdbpFree(mem, __LINE__, __FILE__)
-
-#else
-
-LPVOID SdbpAlloc(SIZE_T size);
-LPVOID SdbpReAlloc(LPVOID mem, SIZE_T size);
-void SdbpFree(LPVOID mem);
-
-#define SdbAlloc(size) SdbpAlloc(size)
-#define SdbReAlloc(mem, size) SdbpReAlloc(mem, size)
-#define SdbFree(mem) SdbpFree(mem)
-
-#endif
-
-typedef struct tagMEMMAPPED {
-HANDLE file;
-HANDLE section;
-PBYTE view;
-SIZE_T size;
-SIZE_T mapped_size;
-} MEMMAPPED, *PMEMMAPPED;
-
-BOOL WINAPI SdbpOpenMemMappedFile(LPCWSTR path, PMEMMAPPED mapping);
-void WINAPI SdbpCloseMemMappedFile(PMEMMAPPED mapping);
-DWORD SdbpStrlen(LPCWSTR string);
 PWSTR SdbpStrDup(LPCWSTR string);
 BOOL WINAPI SdbpCheckTagType(TAG tag, WORD type);
 BOOL WINAPI SdbpCheckTagIDType(PDB db, TAGID tagid, WORD type);
-PDB WINAPI SdbpCreate(void);
+
 PDB WINAPI SdbOpenDatabase(LPCWSTR path, PATH_TYPE type);
 void WINAPI SdbCloseDatabase(PDB);
 BOOL WINAPI SdbIsNullGUID(CONST GUID *Guid);
@@ -145,198 +91,7 @@
 #define ATTRIBUTE_AVAILABLE 0x1
 #define ATTRIBUTE_FAILED 0x2
 
-#define TAGID_NULL 0x0
-#define TAGID_ROOT 0x0
-
-/* The above definition of TAGID_ROOT is used in winapi and can be found
- * on msdn it but doesn't make sense, especially internally, because
- * TAGID represents offset into database data and there is a header at
- * offset 0, NOT a tag. Therfore, this definition should be used internally
- * to represent first valid TAGID. Header size is 12 bytes. */
-#define _TAGID_ROOT 12
-
-#define TAG_TYPE_MASK 0xF000
-
-#define TAG_TYPE_NULL 0x1000
-#define TAG_TYPE_BYTE 0x2000
-#define TAG_TYPE_WORD 0x3000
-#define TAG_TYPE_DWORD 0x4000
-#define TAG_TYPE_QWORD 0x5000
-#define TAG_TYPE_STRINGREF 0x6000
-#define TAG_TYPE_LIST 0x7000
-#define TAG_TYPE_STRING 0x8000
-#define TAG_TYPE_BINARY 0x9000
-
-#define TAG_NULL 0x0
-
-/* TAG_TYPE_NULL */
-#define TAG_INCLUDE (0x1 | TAG_TYPE_NULL)
-#define TAG_GENERAL (0x2 | TAG_TYPE_NULL)
-#define TAG_MATCH_LOGIC_NOT (0x3 | TAG_TYPE_NULL)
-#define TAG_APPLY_ALL_SHIMS (0x4 | TAG_TYPE_NULL)
-#define TAG_USE_SERVICE_PACK_FILES (0x5 | TAG_TYPE_NULL)
-#define TAG_MITIGATION_OS (0x6 | TAG_TYPE_NULL)
-#define TAG_BLOCK_UPGRADE (0x7 | TAG_TYPE_NULL)
-#define TAG_INCLUDEE

[ros-diffs] [mjansen] 71489: [APPHELP] Fix a possible out of bounds write.

2016-06-01 Thread mjansen
Author: mjansen
Date: Wed Jun  1 19:37:25 2016
New Revision: 71489

URL: http://svn.reactos.org/svn/reactos?rev=71489=rev
Log:
[APPHELP] Fix a possible out of bounds write.

Modified:
trunk/reactos/dll/appcompat/apphelp/sdbwrite.c

Modified: trunk/reactos/dll/appcompat/apphelp/sdbwrite.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdbwrite.c?rev=71489=71488=71489=diff
==
--- trunk/reactos/dll/appcompat/apphelp/sdbwrite.c  [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/sdbwrite.c  [iso-8859-1] Wed Jun  1 
19:37:25 2016
@@ -272,13 +272,14 @@
 TAGID WINAPI SdbBeginWriteListTag(PDB db, TAG tag)
 {
 TAGID list_id;
+DWORD dum = 0;
 
 if (!SdbpCheckTagType(tag, TAG_TYPE_LIST))
 return TAGID_NULL;
 
 list_id = db->write_iter;
 SdbpWrite(db, , sizeof(TAG));
-db->write_iter += sizeof(DWORD); /* reserve some memory for storing list 
size */
+SdbpWrite(db, , sizeof(dum)); /* reserve some memory for storing list 
size */
 return list_id;
 }
 




[ros-diffs] [mjansen] 71649: [MSGINA_APITEST] Add a test for ShellDimScreen, used to fade out the background of the logoff dialog. Thanks to Jared for finding the api, and Hermès for his help! CORE-11

2016-06-16 Thread mjansen
Author: mjansen
Date: Thu Jun 16 21:00:08 2016
New Revision: 71649

URL: http://svn.reactos.org/svn/reactos?rev=71649=rev
Log:
[MSGINA_APITEST] Add a test for ShellDimScreen, used to fade out the background 
of the logoff dialog. Thanks to Jared for finding the api, and Hermès for his 
help! CORE-11422

Added:
trunk/rostests/apitests/msgina/
trunk/rostests/apitests/msgina/CMakeLists.txt   (with props)
trunk/rostests/apitests/msgina/ShellDimScreen.cpp   (with props)
trunk/rostests/apitests/msgina/testlist.c   (with props)
Modified:
trunk/rostests/apitests/CMakeLists.txt

Modified: trunk/rostests/apitests/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/CMakeLists.txt?rev=71649=71648=71649=diff
==
--- trunk/rostests/apitests/CMakeLists.txt  [iso-8859-1] (original)
+++ trunk/rostests/apitests/CMakeLists.txt  [iso-8859-1] Thu Jun 16 
21:00:08 2016
@@ -14,6 +14,7 @@
 if(NOT ARCH STREQUAL "amd64")
 add_subdirectory(kernel32)
 endif()
+add_subdirectory(msgina)
 add_subdirectory(msvcrt)
 add_subdirectory(ntdll)
 add_subdirectory(ole32)

Added: trunk/rostests/apitests/msgina/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/msgina/CMakeLists.txt?rev=71649
==
--- trunk/rostests/apitests/msgina/CMakeLists.txt   (added)
+++ trunk/rostests/apitests/msgina/CMakeLists.txt   [iso-8859-1] Thu Jun 16 
21:00:08 2016
@@ -0,0 +1,13 @@
+
+set_cpp(WITH_RUNTIME)
+
+include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
+
+add_executable(msgina_apitest
+ShellDimScreen.cpp
+testlist.c)
+
+target_link_libraries(msgina_apitest wine uuid)
+set_module_type(msgina_apitest win32cui)
+add_importlibs(msgina_apitest msvcrt user32 kernel32)
+add_cd_file(TARGET msgina_apitest DESTINATION reactos/bin FOR all)

Propchange: trunk/rostests/apitests/msgina/CMakeLists.txt
--
svn:eol-style = native

Added: trunk/rostests/apitests/msgina/ShellDimScreen.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/msgina/ShellDimScreen.cpp?rev=71649
==
--- trunk/rostests/apitests/msgina/ShellDimScreen.cpp   (added)
+++ trunk/rostests/apitests/msgina/ShellDimScreen.cpp   [iso-8859-1] Thu Jun 16 
21:00:08 2016
@@ -0,0 +1,114 @@
+/*
+ * PROJECT: ReactOS api tests
+ * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
+ * PURPOSE: Test for ShellDimScreen
+ * PROGRAMMER:  Mark Jansen
+ */
+
+#include 
+#include 
+#include 
+
+#define INITGUID
+#include 
+// stolen from com_apitest.h
+DEFINE_GUID(CLSID_FadeTask,0x7EB5FBE4, 0x2100, 0x49E6, 0x85, 
0x93, 0x17, 0xE1, 0x30, 0x12, 0x2F, 0x91);
+
+
+typedef HRESULT (__stdcall *tShellDimScreen) (IUnknown** Unknown, HWND* 
hWindow);
+
+tShellDimScreen ShellDimScreen;
+
+static void Test_Dim()
+{
+IUnknown* unk = (IUnknown*)0xdeadbeef;
+HWND wnd = (HWND)0xdeadbeef;
+ULONG count;
+
+HRESULT hr = ShellDimScreen(NULL, NULL);
+ok_hex(hr, E_INVALIDARG);
+
+hr = ShellDimScreen(, );
+ok_hex(hr, S_OK);
+ok(unk != ((IUnknown*)0xdeadbeef), "Expected a valid object\n");
+ok(wnd != ((HWND)0xdeadbeef), "Expected a valid window ptr\n");
+ok(IsWindow(wnd), "Expected a valid window\n");
+ok(IsWindowVisible(wnd), "Expected the window to be visible\n");
+
+if (unk != ((IUnknown*)0xdeadbeef) && unk)
+{
+count = unk->Release();
+ok(count == 0, "Expected count to be 0, was: %lu\n", count);
+ok(!IsWindow(wnd), "Expected the window to be destroyed\n");
+}
+
+unk = (IUnknown*)0xdeadbeef;
+wnd = (HWND)0xdeadbeef;
+hr = ShellDimScreen(, );
+ok_hex(hr, S_OK);
+ok(unk != ((IUnknown*)0xdeadbeef), "Expected a valid object\n");
+ok(wnd != ((HWND)0xdeadbeef), "Expected a valid window ptr\n");
+ok(IsWindow(wnd), "Expected a valid window\n");
+ok(IsWindowVisible(wnd), "Expected the window to be visible\n");
+char classname[100] = {0};;
+int nRet = GetClassNameA(wnd, classname, 100);
+ok(nRet == 17, "Expected GetClassName to return 3 was %i\n", nRet);
+ok(!strcmp(classname, "DimmedWindowClass"), "Expected classname to be 
DimmedWindowClass, was %s\n", classname);
+LONG style = GetWindowLong(wnd, GWL_STYLE);
+LONG expectedstyle = WS_POPUP | WS_VISIBLE | WS_DISABLED | WS_CLIPSIBLINGS;
+ok(style == expectedstyle, "Expected style to be %lx, was %lx\n", 
expectedstyle, style);
+style = GetWindowLong(wnd, GWL_EXSTYLE);
+ok(style == WS_EX_TOPMOST, "Expected exstyle to be %x

[ros-diffs] [mjansen] 71675: [SCHANNEL] add missing function to the delayload header. Spotted by Peter Hater. CORE-11270 #resolve

2016-06-26 Thread mjansen
Author: mjansen
Date: Sun Jun 26 12:52:46 2016
New Revision: 71675

URL: http://svn.reactos.org/svn/reactos?rev=71675=rev
Log:
[SCHANNEL] add missing function to the delayload header. Spotted by Peter 
Hater. CORE-11270 #resolve

Modified:
trunk/reactos/dll/win32/schannel/schannel_mbedtls_lazyload.h

Modified: trunk/reactos/dll/win32/schannel/schannel_mbedtls_lazyload.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/schannel/schannel_mbedtls_lazyload.h?rev=71675=71674=71675=diff
==
--- trunk/reactos/dll/win32/schannel/schannel_mbedtls_lazyload.h
[iso-8859-1] (original)
+++ trunk/reactos/dll/win32/schannel/schannel_mbedtls_lazyload.h
[iso-8859-1] Sun Jun 26 12:52:46 2016
@@ -49,6 +49,7 @@
 MAKE_FUNCPTR(mbedtls_ssl_write)
 MAKE_FUNCPTR(mbedtls_ssl_get_peer_cert)
 MAKE_FUNCPTR(mbedtls_ssl_config_init)
+MAKE_FUNCPTR(mbedtls_ssl_config_free)
 MAKE_FUNCPTR(mbedtls_ssl_config_defaults)
 MAKE_FUNCPTR(mbedtls_ssl_conf_dbg)
 MAKE_FUNCPTR(mbedtls_ssl_setup)
@@ -103,6 +104,7 @@
 LOAD_FUNCPTR(mbedtls_ssl_write)
 LOAD_FUNCPTR(mbedtls_ssl_get_peer_cert)
 LOAD_FUNCPTR(mbedtls_ssl_config_init)
+LOAD_FUNCPTR(mbedtls_ssl_config_free)
 LOAD_FUNCPTR(mbedtls_ssl_config_defaults)
 LOAD_FUNCPTR(mbedtls_ssl_conf_dbg)
 LOAD_FUNCPTR(mbedtls_ssl_setup)
@@ -162,6 +164,7 @@
 #define mbedtls_ssl_write   pmbedtls_ssl_write
 #define mbedtls_ssl_get_peer_cert   pmbedtls_ssl_get_peer_cert
 #define mbedtls_ssl_config_init pmbedtls_ssl_config_init
+#define mbedtls_ssl_config_free pmbedtls_ssl_config_free
 #define mbedtls_ssl_config_defaults pmbedtls_ssl_config_defaults
 #define mbedtls_ssl_conf_dbgpmbedtls_ssl_conf_dbg
 #define mbedtls_ssl_setup   pmbedtls_ssl_setup




[ros-diffs] [mjansen] 71139: [ATL] - Implement Typelib registration in CComModule::RegisterServer, based on dll/win32/atl/atl.c and dll/win32/atl80/atl80.c - Add oleaut32 to devmgr and stobject import

2016-04-10 Thread mjansen
Author: mjansen
Date: Sun Apr 10 16:53:00 2016
New Revision: 71139

URL: http://svn.reactos.org/svn/reactos?rev=71139=rev
Log:
[ATL]
- Implement Typelib registration in CComModule::RegisterServer, based on 
dll/win32/atl/atl.c and dll/win32/atl80/atl80.c
- Add oleaut32 to devmgr and stobject import libraries
CORE-11104 #resolve

Modified:
trunk/reactos/dll/shellext/stobject/CMakeLists.txt
trunk/reactos/dll/win32/devmgr/CMakeLists.txt
trunk/reactos/lib/atl/atlbase.h

Modified: trunk/reactos/dll/shellext/stobject/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/stobject/CMakeLists.txt?rev=71139=71138=71139=diff
==
--- trunk/reactos/dll/shellext/stobject/CMakeLists.txt  [iso-8859-1] (original)
+++ trunk/reactos/dll/shellext/stobject/CMakeLists.txt  [iso-8859-1] Sun Apr 10 
16:53:00 2016
@@ -31,6 +31,7 @@
 advapi32
 winmm
 ole32
+oleaut32
 shlwapi
 shell32
 comctl32

Modified: trunk/reactos/dll/win32/devmgr/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/CMakeLists.txt?rev=71139=71138=71139=diff
==
--- trunk/reactos/dll/win32/devmgr/CMakeLists.txt   [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr/CMakeLists.txt   [iso-8859-1] Sun Apr 10 
16:53:00 2016
@@ -36,6 +36,6 @@
 
 set_module_type(devmgr win32dll UNICODE)
 target_link_libraries(devmgr uuid atlnew wine)
-add_importlibs(devmgr setupapi advapi32 newdev user32 gdi32 comctl32 version 
msvcrt kernel32 ole32 uxtheme ntdll)
+add_importlibs(devmgr setupapi advapi32 newdev user32 gdi32 comctl32 version 
msvcrt kernel32 ole32 oleaut32 uxtheme ntdll)
 add_pch(devmgr precomp.h SOURCE)
 add_cd_file(TARGET devmgr DESTINATION reactos/system32 FOR all)

Modified: trunk/reactos/lib/atl/atlbase.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/atl/atlbase.h?rev=71139=71138=71139=diff
==
--- trunk/reactos/lib/atl/atlbase.h [iso-8859-1] (original)
+++ trunk/reactos/lib/atl/atlbase.h [iso-8859-1] Sun Apr 10 16:53:00 2016
@@ -24,6 +24,7 @@
 #include "statreg.h"
 #include "atlcomcli.h"
 #include "atlalloc.h"
+#include "comcat.h"
 
 #ifdef _MSC_VER
 // It is common to use this in ATL constructors. They only store this for 
later use, so the usage is safe.
@@ -63,6 +64,18 @@
 __declspec(selectany) CAtlModule *_pAtlModule = NULL;
 __declspec(selectany) CComModule *_pModule = NULL;
 extern CAtlComModule _AtlComModule;
+
+
+struct _ATL_CATMAP_ENTRY
+{
+   int iType;
+   const GUID* pcatid;
+};
+
+#define _ATL_CATMAP_ENTRY_END 0
+#define _ATL_CATMAP_ENTRY_IMPLEMENTED 1
+#define _ATL_CATMAP_ENTRY_REQUIRED 2
+
 
 typedef HRESULT (WINAPI _ATL_CREATORFUNC)(void *pv, REFIID riid, LPVOID *ppv);
 typedef LPCTSTR (WINAPI _ATL_DESCRIPTIONFUNC)();
@@ -178,6 +191,10 @@
 void __stdcall AtlWinModuleAddCreateWndData(_ATL_WIN_MODULE *pWinModule, 
_AtlCreateWndData *pData, void *pObject);
 void *__stdcall AtlWinModuleExtractCreateWndData(_ATL_WIN_MODULE *pWinModule);
 HRESULT __stdcall AtlComModuleGetClassObject(_ATL_COM_MODULE *pComModule, 
REFCLSID rclsid, REFIID riid, LPVOID *ppv);
+
+HRESULT __stdcall AtlComModuleRegisterServer(_ATL_COM_MODULE *mod, BOOL 
bRegTypeLib, const CLSID *clsid);
+HRESULT __stdcall AtlComModuleUnregisterServer(_ATL_COM_MODULE *mod, BOOL 
bRegTypeLib, const CLSID *clsid);
+
 
 template
 class CComCritSecLock
@@ -516,6 +533,10 @@
 {
 public:
 
+HRESULT RegisterServer(BOOL bRegTypeLib = FALSE, const CLSID *pCLSID = 
NULL);
+HRESULT UnregisterServer(BOOL bUnRegTypeLib, const CLSID *pCLSID = NULL);
+
+
 virtual HRESULT AddCommonRGSReplacements(IRegistrarBase *pRegistrar)
 {
 return pRegistrar->AddReplacement(L"APPID", T::GetAppId());
@@ -549,6 +570,17 @@
 Term();
 }
 
+HRESULT RegisterServer(BOOL bRegTypeLib = FALSE, const CLSID *pCLSID = 
NULL)
+{
+return AtlComModuleRegisterServer(this, bRegTypeLib, pCLSID);
+}
+
+HRESULT UnregisterServer(BOOL bUnRegTypeLib, const CLSID *pCLSID = NULL)
+{
+return AtlComModuleUnregisterServer(this, bUnRegTypeLib, pCLSID);
+}
+
+
 void Term()
 {
 if (cbSize != 0)
@@ -560,6 +592,18 @@
 }
 }
 };
+
+template 
+HRESULT CAtlModuleT::RegisterServer(BOOL bRegTypeLib, const CLSID *pCLSID)
+{
+return _AtlComModule.RegisterServer(bRegTypeLib, pCLSID);
+}
+
+template 
+HRESULT CAtlModuleT::UnregisterServer(BOOL bUnRegTypeLib, const CLSID 
*pCLSID)
+{
+return _AtlComModule.UnregisterServer(bUnRegTypeLib, pCLSID);
+}
 
 template 
 class CAtlDllModuleT : public CAtlModuleT
@@ -730,6 +774,8 @@
 objectMapEntry++;
 }
 }
+if (SUCCEEDED(hResult))
+hResu

[ros-diffs] [mjansen] 71133: [SHELL32] - Stub IShellView2 Patch by Jared Smudde CORE-11049 #resolve #comment Thanks!

2016-04-09 Thread mjansen
Author: mjansen
Date: Sat Apr  9 23:20:15 2016
New Revision: 71133

URL: http://svn.reactos.org/svn/reactos?rev=71133=rev
Log:
[SHELL32]
- Stub IShellView2
Patch by Jared Smudde
CORE-11049 #resolve #comment Thanks!

Modified:
trunk/reactos/dll/win32/shell32/CDefView.cpp

Modified: trunk/reactos/dll/win32/shell32/CDefView.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefView.cpp?rev=71133=71132=71133=diff
==
--- trunk/reactos/dll/win32/shell32/CDefView.cpp[iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CDefView.cpp[iso-8859-1] Sat Apr  9 
23:20:15 2016
@@ -66,7 +66,7 @@
 class CDefView :
 public CWindowImpl<CDefView, CWindow, CControlWinTraits>,
 public CComObjectRootEx,
-public IShellView,
+public IShellView2,
 public IFolderView,
 public IShellFolderView,
 public IOleCommandTarget,
@@ -165,6 +165,12 @@
 virtual HRESULT STDMETHODCALLTYPE SelectItem(PCUITEMID_CHILD pidlItem, 
SVSIF uFlags);
 virtual HRESULT STDMETHODCALLTYPE GetItemObject(UINT uItem, REFIID 
riid, void **ppv);
 
+// *** IShellView2 methods ***
+virtual HRESULT STDMETHODCALLTYPE GetView(SHELLVIEWID *view_guid, 
ULONG view_type);
+virtual HRESULT STDMETHODCALLTYPE CreateViewWindow2(LPSV2CVW2_PARAMS 
view_params);
+virtual HRESULT STDMETHODCALLTYPE HandleRename(LPCITEMIDLIST new_pidl);
+virtual HRESULT STDMETHODCALLTYPE SelectAndPositionItem(LPCITEMIDLIST 
item, UINT flags, POINT *point);
+
 // *** IFolderView methods ***
 virtual HRESULT STDMETHODCALLTYPE GetCurrentViewMode(UINT *pViewMode);
 virtual HRESULT STDMETHODCALLTYPE SetCurrentViewMode(UINT ViewMode);
@@ -319,6 +325,7 @@
 // Windows returns E_NOINTERFACE for IOleWindow
 // COM_INTERFACE_ENTRY_IID(IID_IOleWindow, IOleWindow)
 COM_INTERFACE_ENTRY_IID(IID_IShellView, IShellView)
+COM_INTERFACE_ENTRY_IID(IID_IShellView2, IShellView2)
 COM_INTERFACE_ENTRY_IID(IID_IFolderView, IFolderView)
 COM_INTERFACE_ENTRY_IID(IID_IShellFolderView, IShellFolderView)
 COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget)
@@ -2490,6 +2497,34 @@
 }
 
 /**
+ * IShellView2 implementation
+ */
+
+HRESULT STDMETHODCALLTYPE CDefView::GetView(SHELLVIEWID *view_guid, ULONG 
view_type)
+{
+FIXME("(%p)->(%p, %lu) stub\n", this, view_guid, view_type);
+return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE CDefView::CreateViewWindow2(LPSV2CVW2_PARAMS 
view_params)
+{
+FIXME("(%p)->(%p) stub\n", this, view_params);
+return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE CDefView::HandleRename(LPCITEMIDLIST new_pidl)
+{
+FIXME("(%p)->(%p) stub\n", this, new_pidl);
+return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE CDefView::SelectAndPositionItem(LPCITEMIDLIST item, 
UINT flags, POINT *point)
+{
+FIXME("(%p)->(%p, %u, %p) stub\n", this, item, flags, point);
+return E_NOTIMPL;
+}
+
+/**
  * IShellFolderView implementation
  */
 HRESULT STDMETHODCALLTYPE CDefView::Rearrange(LPARAM sort)




[ros-diffs] [mjansen] 71138: [SHELL32] - Stub IShellFolderViewDual2 ROSTESTS-209 #comment CDefViewDual.patch committed.

2016-04-10 Thread mjansen
Author: mjansen
Date: Sun Apr 10 12:05:06 2016
New Revision: 71138

URL: http://svn.reactos.org/svn/reactos?rev=71138=rev
Log:
[SHELL32]
- Stub IShellFolderViewDual2
ROSTESTS-209 #comment CDefViewDual.patch committed.

Added:
trunk/reactos/dll/win32/shell32/CDefViewDual.cpp   (with props)
Modified:
trunk/reactos/dll/win32/shell32/CDefView.cpp
trunk/reactos/dll/win32/shell32/CMakeLists.txt
trunk/reactos/dll/win32/shell32/shell32.cpp
trunk/reactos/dll/win32/shell32/wine/shell32_main.h

Modified: trunk/reactos/dll/win32/shell32/CDefView.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefView.cpp?rev=71138=71137=71138=diff
==
--- trunk/reactos/dll/win32/shell32/CDefView.cpp[iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CDefView.cpp[iso-8859-1] Sun Apr 10 
12:05:06 2016
@@ -80,6 +80,7 @@
 CComPtrm_pSF2Parent;
 CComPtrm_pShellBrowser;
 CComPtr  m_pCommDlgBrowser;
+CComPtr m_pShellFolderViewDual;
 CListView m_ListView;
 HWND  m_hWndParent;
 FOLDERSETTINGSm_FolderSettings;
@@ -2302,6 +2303,12 @@
 return hr;
 *ppvOut = pcm;
 }
+else if (IsEqualIID(riid, IID_IDispatch))
+{
+if (m_pShellFolderViewDual == NULL)
+hr = CDefViewDual_Constructor(riid, 
(LPVOID*)_pShellFolderViewDual);
+hr = m_pShellFolderViewDual->QueryInterface(riid, ppvOut);
+}
 break;
 
 case SVGIO_SELECTION:

Added: trunk/reactos/dll/win32/shell32/CDefViewDual.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefViewDual.cpp?rev=71138
==
--- trunk/reactos/dll/win32/shell32/CDefViewDual.cpp(added)
+++ trunk/reactos/dll/win32/shell32/CDefViewDual.cpp[iso-8859-1] Sun Apr 10 
12:05:06 2016
@@ -0,0 +1,143 @@
+/*
+ *ShellFolderViewDual
+ *
+ *Copyright 2016 Mark Jansen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ *
+ */
+
+#include "precomp.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(shell);
+
+class CDefViewDual :
+public CComObjectRootEx,
+public IDispatchImpl<IShellFolderViewDual2, _IShellFolderViewDual2>
+{
+public:
+CDefViewDual()
+{
+}
+
+~CDefViewDual()
+{
+}
+
+HRESULT STDMETHODCALLTYPE Initialize()
+{
+// Nothing to do for now..
+return S_OK;
+}
+
+// *** IShellFolderViewDual methods ***
+virtual HRESULT STDMETHODCALLTYPE get_Application(IDispatch **app) 
override
+{
+if (!app) return E_INVALIDARG;
+*app = NULL;
+FIXME("CDefViewDual::get_Application is UNIMPLEMENTED (%p, %p)\n", 
this, app);
+return E_NOTIMPL;
+}
+
+virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch **parent) 
override
+{
+if (!parent) return E_INVALIDARG;
+*parent = NULL;
+FIXME("CDefViewDual::get_Parent is UNIMPLEMENTED (%p, %p)\n", 
this, parent);
+return E_NOTIMPL;
+}
+
+virtual HRESULT STDMETHODCALLTYPE get_Folder(Folder **folder) override
+{
+if (!folder) return E_INVALIDARG;
+*folder = NULL;
+FIXME("CDefViewDual::get_Folder is UNIMPLEMENTED (%p, %p)\n", 
this, folder);
+return E_NOTIMPL;
+}
+
+virtual HRESULT STDMETHODCALLTYPE SelectedItems(FolderItems **items) 
override
+{
+if (!items) return E_INVALIDARG;
+*items = NULL;
+FIXME("CDefViewDual::SelectedItems is UNIMPLEMENTED (%p, %p)\n", 
this, items);
+return E_NOTIMPL;
+}
+
+virtual  HRESULT STDMETHODCALLTYPE get_FocusedItem(FolderItem **item) 
override
+{
+if (!item) return E_INVALIDARG;
+*item = NULL;
+FIXME("CDefViewDual::get_FocusedItem is UNIMPLEMENTED (%p, %p)\n", 
this

[ros-diffs] [mjansen] 71131: [ACPPAGE] Implement the base of the compatibility tab in explorer as shell extension. Because the underlying shim infrastructure is not active yet, the page is disabled by

2016-04-09 Thread mjansen
Author: mjansen
Date: Sat Apr  9 21:40:32 2016
New Revision: 71131

URL: http://svn.reactos.org/svn/reactos?rev=71131=rev
Log:
[ACPPAGE] Implement the base of the compatibility tab in explorer as shell 
extension.
Because the underlying shim infrastructure is not active yet, the page is 
disabled by default.
Hello Reactos :)
CORE-10375

Added:
trunk/reactos/dll/shellext/acppage/   (with props)
trunk/reactos/dll/shellext/acppage/ACPPage.cpp   (with props)
trunk/reactos/dll/shellext/acppage/ACPPage.rc   (with props)
trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp   (with props)
trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.hpp   (with props)
trunk/reactos/dll/shellext/acppage/CMakeLists.txt   (with props)
trunk/reactos/dll/shellext/acppage/acppage.spec   (with props)
trunk/reactos/dll/shellext/acppage/lang/   (with props)
trunk/reactos/dll/shellext/acppage/lang/en-US.rc   (with props)
trunk/reactos/dll/shellext/acppage/precomp.h   (with props)
trunk/reactos/dll/shellext/acppage/res/   (with props)
trunk/reactos/dll/shellext/acppage/res/acppage.rgs   (with props)
trunk/reactos/dll/shellext/acppage/resource.h   (with props)
Modified:
trunk/reactos/dll/appcompat/apphelp/apphelp.h
trunk/reactos/dll/shellext/CMakeLists.txt
trunk/reactos/media/inf/syssetup.inf

Modified: trunk/reactos/dll/appcompat/apphelp/apphelp.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/apphelp.h?rev=71131=71130=71131=diff
==
--- trunk/reactos/dll/appcompat/apphelp/apphelp.h   [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/apphelp.h   [iso-8859-1] Sat Apr  9 
21:40:32 2016
@@ -64,6 +64,13 @@
 
 #endif
 
+
+/* layer.c */
+BOOL WINAPI AllowPermLayer(PCWSTR path);
+BOOL WINAPI SdbGetPermLayerKeys(PCWSTR wszPath, PWSTR pwszLayers, PDWORD 
pdwBytes, DWORD dwFlags);
+BOOL WINAPI SetPermLayerState(PCWSTR wszPath, PCWSTR wszLayer, DWORD dwFlags, 
BOOL bMachine, BOOL bEnable);
+
+
 #ifdef __cplusplus
 } // extern "C"
 #endif

Modified: trunk/reactos/dll/shellext/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/CMakeLists.txt?rev=71131=71130=71131=diff
==
--- trunk/reactos/dll/shellext/CMakeLists.txt   [iso-8859-1] (original)
+++ trunk/reactos/dll/shellext/CMakeLists.txt   [iso-8859-1] Sat Apr  9 
21:40:32 2016
@@ -1,4 +1,5 @@
 
+add_subdirectory(acppage)
 add_subdirectory(deskadp)
 add_subdirectory(deskmon)
 add_subdirectory(devcpux)

Propchange: trunk/reactos/dll/shellext/acppage/
--
--- bugtraq:logregex(added)
+++ bugtraq:logregexSat Apr  9 21:40:32 2016
@@ -0,0 +1 @@
+((CORE|ROSTESTS|ROSAPPS)-\d+)(,? ?((CORE|ROSTESTS|ROSAPPS)-\d+))*(,? ?(and |or 
)?((CORE|ROSTESTS|ROSAPPS)-\d+))?

Propchange: trunk/reactos/dll/shellext/acppage/
--
bugtraq:message = See issue %BUGID% for more details.

Propchange: trunk/reactos/dll/shellext/acppage/
--
bugtraq:url = https://jira.reactos.org/browse/%BUGID%

Added: trunk/reactos/dll/shellext/acppage/ACPPage.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/acppage/ACPPage.cpp?rev=71131
==
--- trunk/reactos/dll/shellext/acppage/ACPPage.cpp  (added)
+++ trunk/reactos/dll/shellext/acppage/ACPPage.cpp  [iso-8859-1] Sat Apr  9 
21:40:32 2016
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2015 Mark Jansen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "precomp.h"
+
+HMODULE g_hModule = NULL;
+LONG g_ModuleRefCnt = 0;
+
+class CLayerUIPropPageModule : public CComModule
+{
+public:
+void Term()
+{
+CComModule::Term();
+}
+};
+
+BEGIN_OBJECT_MAP(ObjectMap)
+OBJECT_ENTRY(CLSID_CLayerUIPropPage, CLayerUIPropPage)
+END_OBJECT_MAP()
+
+CLayerUIPropPageModule gModule;
+
+EXTERN_C
+BOOL WINAPI DllMain(HINSTANCE hInstance, DW

[ros-diffs] [mjansen] 71142: [SHELL32] Use the previously implemented Typelib registration from ATL to register shell32. ROSTESTS-209

2016-04-10 Thread mjansen
Author: mjansen
Date: Sun Apr 10 21:32:27 2016
New Revision: 71142

URL: http://svn.reactos.org/svn/reactos?rev=71142=rev
Log:
[SHELL32] Use the previously implemented Typelib registration from ATL to 
register shell32. ROSTESTS-209

Added:
trunk/reactos/dll/win32/shell32/shell32_shldisp.idl
Modified:
trunk/reactos/dll/win32/shell32/CMakeLists.txt
trunk/reactos/dll/win32/shell32/shell32.cpp
trunk/reactos/dll/win32/shell32/shell32.rc

Modified: trunk/reactos/dll/win32/shell32/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CMakeLists.txt?rev=71142=71141=71142=diff
==
--- trunk/reactos/dll/win32/shell32/CMakeLists.txt  [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CMakeLists.txt  [iso-8859-1] Sun Apr 10 
21:32:27 2016
@@ -91,6 +91,10 @@
 ${CMAKE_CURRENT_BINARY_DIR}/shell32_stubs.c
 ${CMAKE_CURRENT_BINARY_DIR}/shell32.def)
 
+
+add_typelib(shell32_shldisp.idl)
+set_source_files_properties(shell32.rc PROPERTIES OBJECT_DEPENDS 
${CMAKE_CURRENT_BINARY_DIR}/shell32_shldisp.tlb)
+
 set_module_type(shell32 win32dll UNICODE)
 target_link_libraries(shell32 shellmenu shelldesktop atlnew wine uuid 
recyclebin)
 add_delay_importlibs(shell32 uxtheme ole32 oleaut32 userenv version fmifs)

Modified: trunk/reactos/dll/win32/shell32/shell32.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32.cpp?rev=71142=71141=71142=diff
==
--- trunk/reactos/dll/win32/shell32/shell32.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shell32.cpp [iso-8859-1] Sun Apr 10 
21:32:27 2016
@@ -350,7 +350,7 @@
 {
 HRESULT hr;
 
-hr = gModule.DllRegisterServer(FALSE);
+hr = gModule.DllRegisterServer(TRUE);
 if (FAILED(hr))
 return hr;
 
@@ -372,7 +372,7 @@
 {
 HRESULT hr;
 
-hr = gModule.DllUnregisterServer(FALSE);
+hr = gModule.DllUnregisterServer(TRUE);
 if (FAILED(hr))
 return hr;
 

Modified: trunk/reactos/dll/win32/shell32/shell32.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32.rc?rev=71142=71141=71142=diff
==
--- trunk/reactos/dll/win32/shell32/shell32.rc  [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shell32.rc  [iso-8859-1] Sun Apr 10 
21:32:27 2016
@@ -78,6 +78,8 @@
 #include "rgs_res.rc"
 
 #include 
+
+1 TYPELIB "shell32_shldisp.tlb"
 
 /*
  * Everything specific to any language goes

Added: trunk/reactos/dll/win32/shell32/shell32_shldisp.idl
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32_shldisp.idl?rev=71142
==
--- trunk/reactos/dll/win32/shell32/shell32_shldisp.idl (added)
+++ trunk/reactos/dll/win32/shell32/shell32_shldisp.idl [iso-8859-1] Sun Apr 10 
21:32:27 2016
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2011 Alexandre Julliard
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/* just a wrapper for shldisp.idl */
+
+#pragma makedep proxy
+#pragma makedep register
+
+#include "shldisp.idl"
+




[ros-diffs] [mjansen] 71144: [SHELL32][SHELL32_WINETEST] Connect CDefViewDual to CDefView to fix crashes in the shelldispatch test ROSTESTS-209 - CDefViewDual::get_Application now returns a new CDefVi

2016-04-11 Thread mjansen
Author: mjansen
Date: Mon Apr 11 18:28:31 2016
New Revision: 71144

URL: http://svn.reactos.org/svn/reactos?rev=71144=rev
Log:
[SHELL32][SHELL32_WINETEST] Connect CDefViewDual to CDefView to fix crashes in 
the shelldispatch test ROSTESTS-209
- CDefViewDual::get_Application now returns a new CDefView to fix the winetest.
- Update CFolder, CFolderItem(s), CFolderItemVerb(s), CShell to use the new 
IDispatchImpl
- Enable the last two skipped testcases (test_ShellFolderViewDual, 
test_ShellWindows)

Modified:
trunk/reactos/dll/win32/shell32/CDefViewDual.cpp
trunk/reactos/dll/win32/shell32/CFolder.cpp
trunk/reactos/dll/win32/shell32/CFolder.h
trunk/reactos/dll/win32/shell32/CFolderItemVerbs.cpp
trunk/reactos/dll/win32/shell32/CFolderItemVerbs.h
trunk/reactos/dll/win32/shell32/CFolderItems.cpp
trunk/reactos/dll/win32/shell32/CFolderItems.h
trunk/reactos/dll/win32/shell32/CShell.cpp
trunk/reactos/dll/win32/shell32/CShell.h
trunk/reactos/dll/win32/shell32/wine/shell32_main.h
trunk/rostests/winetests/shell32/shelldispatch.c

Modified: trunk/reactos/dll/win32/shell32/CDefViewDual.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefViewDual.cpp?rev=71144=71143=71144=diff
==
--- trunk/reactos/dll/win32/shell32/CDefViewDual.cpp[iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CDefViewDual.cpp[iso-8859-1] Mon Apr 11 
18:28:31 2016
@@ -46,9 +46,8 @@
 virtual HRESULT STDMETHODCALLTYPE get_Application(IDispatch **app) 
override
 {
 if (!app) return E_INVALIDARG;
-*app = NULL;
-FIXME("CDefViewDual::get_Application is UNIMPLEMENTED (%p, %p)\n", 
this, app);
-return E_NOTIMPL;
+
+return CShell_Constructor(IID_IDispatch, (LPVOID*)app);
 }
 
 virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch **parent) 
override

Modified: trunk/reactos/dll/win32/shell32/CFolder.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CFolder.cpp?rev=71144=71143=71144=diff
==
--- trunk/reactos/dll/win32/shell32/CFolder.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CFolder.cpp [iso-8859-1] Mon Apr 11 
18:28:31 2016
@@ -36,38 +36,30 @@
 m_idlist.Attach(idlist);
 }
 
-// *** IDispatch methods ***
-HRESULT STDMETHODCALLTYPE CFolder::GetTypeInfoCount(UINT *pctinfo)
+HRESULT CFolder::GetShellFolder(CComPtr& psfCurrent)
 {
-TRACE("(%p, %p)\n", this, pctinfo);
-return E_NOTIMPL;
+CComPtr psfDesktop;
+
+HRESULT hr = SHGetDesktopFolder();
+if (FAILED_UNEXPECTEDLY(hr))
+return hr;
+
+return psfDesktop->BindToObject(m_idlist, NULL, IID_PPV_ARG(IShellFolder, 
));
 }
-
-HRESULT STDMETHODCALLTYPE CFolder::GetTypeInfo(UINT iTInfo, LCID lcid, 
ITypeInfo **ppTInfo)
-{
-TRACE("(%p, %lu, %lu, %p)\n", this, iTInfo, lcid, ppTInfo);
-return E_NOTIMPL;
-}
-
-HRESULT STDMETHODCALLTYPE CFolder::GetIDsOfNames(REFIID riid, LPOLESTR 
*rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
-{
-TRACE("(%p, %s, %p, %lu, %lu, %p)\n", this, wine_dbgstr_guid(), 
rgszNames, cNames, lcid, rgDispId);
-return E_NOTIMPL;
-}
-
-HRESULT STDMETHODCALLTYPE CFolder::Invoke(DISPID dispIdMember, REFIID riid, 
LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO 
*pExcepInfo, UINT *puArgErr)
-{
-TRACE("(%p, %lu, %s, %lu, %lu, %p, %p, %p, %p)\n", this, dispIdMember, 
wine_dbgstr_guid(), lcid, (DWORD)wFlags,
-pDispParams, pVarResult, pExcepInfo, puArgErr);
-return E_NOTIMPL;
-}
-
 
 // *** Folder methods ***
 HRESULT STDMETHODCALLTYPE CFolder::get_Title(BSTR *pbs)
 {
-TRACE("(%p, %p)\n", this, pbs);
-return E_NOTIMPL;
+if (!pbs)
+return E_POINTER;
+
+WCHAR path[MAX_PATH+2] = {0};
+HRESULT hr = ILGetDisplayNameExW(NULL, m_idlist, path, ILGDN_INFOLDER);
+if (FAILED_UNEXPECTEDLY(hr))
+return hr;
+
+*pbs = SysAllocString(path);
+return S_OK;
 }
 
 HRESULT STDMETHODCALLTYPE CFolder::get_Application(IDispatch **ppid)
@@ -97,15 +89,12 @@
 HRESULT STDMETHODCALLTYPE CFolder::ParseName(BSTR bName, FolderItem **ppid)
 {
 TRACE("(%p, %s, %p)\n", this, wine_dbgstr_w(bName), ppid);
-
-CComPtr psfDesktop;
-
-HRESULT hr = SHGetDesktopFolder();
-if (FAILED_UNEXPECTEDLY(hr))
-return hr;
+if (!ppid)
+return E_POINTER;
+*ppid = NULL;
 
 CComPtr psfCurrent;
-hr = psfDesktop->BindToObject(m_idlist, NULL, IID_PPV_ARG(IShellFolder, 
));
+HRESULT hr = GetShellFolder(psfCurrent);
 if (FAILED_UNEXPECTEDLY(hr))
 return hr;
 

Modified: trunk/reactos/dll/win32/shell32/CFolder.h
URL: 
http://svn.reactos.org/

[ros-diffs] [mjansen] 71154: [APPHELP] Change the ApphelpCheckInstallShieldPackage stub to a non-throwing one, use OutputDebugString by default. CORE-8591

2016-04-13 Thread mjansen
Author: mjansen
Date: Wed Apr 13 18:23:54 2016
New Revision: 71154

URL: http://svn.reactos.org/svn/reactos?rev=71154=rev
Log:
[APPHELP] Change the ApphelpCheckInstallShieldPackage stub to a non-throwing 
one, use OutputDebugString by default. CORE-8591

Modified:
trunk/reactos/dll/appcompat/apphelp/apphelp.c
trunk/reactos/dll/appcompat/apphelp/apphelp.spec

Modified: trunk/reactos/dll/appcompat/apphelp/apphelp.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/apphelp.c?rev=71154=71153=71154=diff
==
--- trunk/reactos/dll/appcompat/apphelp/apphelp.c   [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/apphelp.c   [iso-8859-1] Wed Apr 13 
18:23:54 2016
@@ -26,8 +26,6 @@
 #include "apphelp.h"
 
 #include "wine/winternl.h"
-#include "wine/debug.h"
-#include "wine/unicode.h"
 
 /* from dpfilter.h */
 #define DPFLTR_APPCOMPAT_ID 123
@@ -82,6 +80,12 @@
 return TRUE;
 }
 
+BOOL WINAPI ApphelpCheckInstallShieldPackage(void* ptr, LPCWSTR path)
+{
+SHIM_WARN("stub: ptr=%p path='%S'\r\n", ptr, path);
+return TRUE;
+}
+
 
 /**
  * Outputs diagnostic info.
@@ -130,6 +134,11 @@
 va_start(ArgList, Format);
 StringCchVPrintfExA(Current, Length, , , 
STRSAFE_NULL_ON_FAILURE, Format, ArgList);
 va_end(ArgList);
+#if defined(APPCOMPAT_USE_DBGPRINTEX) && APPCOMPAT_USE_DBGPRINTEX
 return NT_SUCCESS(DbgPrintEx(DPFLTR_APPCOMPAT_ID, Level, "%s", Buffer));
+#else
+OutputDebugStringA(Buffer);
+return TRUE;
+#endif
 }
 

Modified: trunk/reactos/dll/appcompat/apphelp/apphelp.spec
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/apphelp.spec?rev=71154=71153=71154=diff
==
--- trunk/reactos/dll/appcompat/apphelp/apphelp.spec[iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/apphelp.spec[iso-8859-1] Wed Apr 13 
18:23:54 2016
@@ -1,6 +1,6 @@
 @ stdcall AllowPermLayer(wstr)
 @ stub ApphelpCheckExe
-@ stub ApphelpCheckInstallShieldPackage
+@ stdcall ApphelpCheckInstallShieldPackage(ptr wstr)
 @ stub ApphelpCheckMsiPackage
 @ stub ApphelpCheckRunApp
 @ stub ApphelpCheckRunAppEx




[ros-diffs] [mjansen] 71197: [APPHELP][APPHELP_APITEST] Add SdbTagToString + test by Mislav Blažević CORE-10367

2016-04-24 Thread mjansen
Author: mjansen
Date: Sun Apr 24 13:05:00 2016
New Revision: 71197

URL: http://svn.reactos.org/svn/reactos?rev=71197=rev
Log:
[APPHELP][APPHELP_APITEST] Add SdbTagToString + test by Mislav Blažević 
CORE-10367

Added:
trunk/rostests/apitests/apphelp/apphelp.c   (with props)
Modified:
trunk/reactos/dll/appcompat/apphelp/apphelp.h
trunk/reactos/dll/appcompat/apphelp/apphelp.spec
trunk/reactos/dll/appcompat/apphelp/sdbapi.c
trunk/rostests/apitests/apphelp/CMakeLists.txt
trunk/rostests/apitests/apphelp/testlist.c

Modified: trunk/reactos/dll/appcompat/apphelp/apphelp.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/apphelp.h?rev=71197=71196=71197=diff
==
--- trunk/reactos/dll/appcompat/apphelp/apphelp.h   [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/apphelp.h   [iso-8859-1] Sun Apr 24 
13:05:00 2016
@@ -24,6 +24,14 @@
 extern "C" {
 #endif
 
+typedef WORD TAG;
+typedef DWORD TAGID;
+typedef DWORD TAGREF;
+typedef UINT64 QWORD;
+
+#define TAGREF_NULL (0)
+#define TAGREF_ROOT (0)
+
 typedef enum _SHIM_LOG_LEVEL {
 SHIM_ERR = 1,
 SHIM_WARN = 2,
@@ -71,6 +79,196 @@
 BOOL WINAPI SetPermLayerState(PCWSTR wszPath, PCWSTR wszLayer, DWORD dwFlags, 
BOOL bMachine, BOOL bEnable);
 
 
+#define TAGID_NULL 0x0
+#define TAGID_ROOT 0x0
+
+/* The above definition of TAGID_ROOT is used in winapi and can be found
+ * on msdn it but doesn't make sense, especially internally, because
+ * TAGID represents offset into database data and there is a header at
+ * offset 0, NOT a tag. Therfore, this definition should be used internally
+ * to represent first valid TAGID. Header size is 12 bytes. */
+#define _TAGID_ROOT 12
+
+#define TAG_TYPE_MASK 0xF000
+
+#define TAG_TYPE_NULL 0x1000
+#define TAG_TYPE_BYTE 0x2000
+#define TAG_TYPE_WORD 0x3000
+#define TAG_TYPE_DWORD 0x4000
+#define TAG_TYPE_QWORD 0x5000
+#define TAG_TYPE_STRINGREF 0x6000
+#define TAG_TYPE_LIST 0x7000
+#define TAG_TYPE_STRING 0x8000
+#define TAG_TYPE_BINARY 0x9000
+
+#define TAG_NULL 0x0
+
+/* TAG_TYPE_NULL */
+#define TAG_INCLUDE (0x1 | TAG_TYPE_NULL)
+#define TAG_GENERAL (0x2 | TAG_TYPE_NULL)
+#define TAG_MATCH_LOGIC_NOT (0x3 | TAG_TYPE_NULL)
+#define TAG_APPLY_ALL_SHIMS (0x4 | TAG_TYPE_NULL)
+#define TAG_USE_SERVICE_PACK_FILES (0x5 | TAG_TYPE_NULL)
+#define TAG_MITIGATION_OS (0x6 | TAG_TYPE_NULL)
+#define TAG_BLOCK_UPGRADE (0x7 | TAG_TYPE_NULL)
+#define TAG_INCLUDEEXCLUDEDLL (0x8 | TAG_TYPE_NULL)
+#define TAG_RAC_EVENT_OFF (0x9 | TAG_TYPE_NULL)
+#define TAG_TELEMETRY_OFF (0xA | TAG_TYPE_NULL)
+#define TAG_SHIM_ENGINE_OFF (0xB | TAG_TYPE_NULL)
+#define TAG_LAYER_PROPAGATION_OFF (0xC | TAG_TYPE_NULL)
+#define TAG_REINSTALL_UPGRADE (0xD | TAG_TYPE_NULL)
+
+/* TAG_TYPE_BYTE */
+
+/* TAG_TYPE_WORD */
+#define TAG_MATCH_MODE (0x1 | TAG_TYPE_WORD)
+#define TAG_TAG (0x801 | TAG_TYPE_WORD)
+#define TAG_INDEX_TAG (0x802 | TAG_TYPE_WORD)
+#define TAG_INDEX_KEY (0x803 | TAG_TYPE_WORD)
+
+/* TAG_TYPE_DWORD */
+#define TAG_SIZE (0x1 | TAG_TYPE_DWORD)
+#define TAG_OFFSET (0x2 | TAG_TYPE_DWORD)
+#define TAG_CHECKSUM (0x3 | TAG_TYPE_DWORD)
+#define TAG_SHIM_TAGID (0x4 | TAG_TYPE_DWORD)
+#define TAG_PATCH_TAGID (0x5 | TAG_TYPE_DWORD)
+#define TAG_MODULE_TYPE (0x6 | TAG_TYPE_DWORD)
+#define TAG_VERDATEHI (0x7 | TAG_TYPE_DWORD)
+#define TAG_VERDATELO (0x8 | TAG_TYPE_DWORD)
+#define TAG_VERFILEOS (0x9 | TAG_TYPE_DWORD)
+#define TAG_VERFILETYPE (0xA | TAG_TYPE_DWORD)
+#define TAG_PE_CHECKSUM (0xB | TAG_TYPE_DWORD)
+#define TAG_PREVOSMAJORVER (0xC | TAG_TYPE_DWORD)
+#define TAG_PREVOSMINORVER (0xD | TAG_TYPE_DWORD)
+#define TAG_PREVOSPLATFORMID (0xE | TAG_TYPE_DWORD)
+#define TAG_PREVOSBUILDNO (0xF | TAG_TYPE_DWORD)
+#define TAG_PROBLEMSEVERITY (0x10 | TAG_TYPE_DWORD)
+#define TAG_LANGID (0x11 | TAG_TYPE_DWORD)
+#define TAG_VER_LANGUAGE (0x12 | TAG_TYPE_DWORD)
+#define TAG_ENGINE (0x14 | TAG_TYPE_DWORD)
+#define TAG_HTMLHELPID (0x15 | TAG_TYPE_DWORD)
+#define TAG_INDEX_FLAGS (0x16 | TAG_TYPE_DWORD)
+#define TAG_FLAGS (0x17 | TAG_TYPE_DWORD)
+#define TAG_DATA_VALUETYPE (0x18 | TAG_TYPE_DWORD)
+#define TAG_DATA_DWORD (0x19 | TAG_TYPE_DWORD)
+#define TAG_LAYER_TAGID (0x1A | TAG_TYPE_DWORD)
+#define TAG_MSI_TRANSFORM_TAGID (0x1B | TAG_TYPE_DWORD)
+#define TAG_LINKER_VERSION (0x1C | TAG_TYPE_DWORD)
+#define TAG_LINK_DATE (0x1D | TAG_TYPE_DWORD)
+#define TAG_UPTO_LINK_DATE (0x1E | TAG_TYPE_DWORD)
+#define TAG_OS_SERVICE_PACK (0x1F | TAG_TYPE_DWORD)
+#define TAG_FLAG_TAGID (0x20 | TAG_TYPE_DWORD)
+#define TAG_RUNTIME_PLATFORM (0x21 | TAG_TYPE_DWORD)
+#define TAG_OS_SKU (0x22 | TAG_TYPE_DWORD)
+#define TAG_OS_PLATFORM (0x23 | TAG_TYPE_DWORD)
+#define TAG_APP_NAME_RC_ID (0x24 | TAG_TYPE_DWORD)
+#define TAG_VENDOR_NAME_RC_ID (0x25 | TAG_TYPE_DWORD)
+#define TAG_SUMMARY_MSG_RC_ID (0x26 | TAG_TYPE_DWORD)
+#define TAG_VISTA_SKU (0x27 | TAG_TYPE_DWORD)
+#define TAG_DESCRIPTION_RC_ID (0x28 | TAG_TYPE_DWORD)
+#define TAG_PARAME

[ros-diffs] [mjansen] 71198: Nothing to see here.

2016-04-24 Thread mjansen
Author: mjansen
Date: Sun Apr 24 13:27:22 2016
New Revision: 71198

URL: http://svn.reactos.org/svn/reactos?rev=71198=rev
Log:
Nothing to see here.

Modified:
trunk/rostests/apitests/apphelp/testlist.c

Modified: trunk/rostests/apitests/apphelp/testlist.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/apphelp/testlist.c?rev=71198=71197=71198=diff
==
--- trunk/rostests/apitests/apphelp/testlist.c  [iso-8859-1] (original)
+++ trunk/rostests/apitests/apphelp/testlist.c  [iso-8859-1] Sun Apr 24 
13:27:22 2016
@@ -3,12 +3,12 @@
 #define STANDALONE
 #include 
 
+extern void func_apphelp(void);
 extern void func_layerapi(void);
-extern void func_apphelp(void);
 
 const struct test winetest_testlist[] =
 {
+{ "apphelp", func_apphelp },
 { "layerapi", func_layerapi },
-{ "apphelp", func_apphelp },
 { 0, 0 }
 };




[ros-diffs] [mjansen] 71200: [APPHELP][APPHELP_APITEST] Update SdbTagToString tests to check all known tags CORE-10367 - Add a list of hardcoded tags, for all versions up to win7 they are checked agai

2016-04-24 Thread mjansen
Author: mjansen
Date: Sun Apr 24 17:19:09 2016
New Revision: 71200

URL: http://svn.reactos.org/svn/reactos?rev=71200=rev
Log:
[APPHELP][APPHELP_APITEST] Update SdbTagToString tests to check all known tags 
CORE-10367
- Add a list of hardcoded tags, for all versions up to win7 they are checked 
against windows.
- Update SdbTagToString with a few missing strings
- Hardcode the used version to Win7 for now, as backporting these strings would 
not make much sense.

Modified:
trunk/reactos/dll/appcompat/apphelp/apphelp.h
trunk/reactos/dll/appcompat/apphelp/sdbapi.c
trunk/rostests/apitests/apphelp/apphelp.c

Modified: trunk/reactos/dll/appcompat/apphelp/apphelp.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/apphelp.h?rev=71200=71199=71200=diff
==
--- trunk/reactos/dll/appcompat/apphelp/apphelp.h   [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/apphelp.h   [iso-8859-1] Sun Apr 24 
17:19:09 2016
@@ -169,6 +169,7 @@
 #define TAG_PARAMETER1_RC_ID (0x29 | TAG_TYPE_DWORD)
 #define TAG_CONTEXT_TAGID (0x30 | TAG_TYPE_DWORD)
 #define TAG_EXE_WRAPPER (0x31 | TAG_TYPE_DWORD)
+#define TAG_URL_ID (0x32 | TAG_TYPE_DWORD)
 #define TAG_TAGID (0x801 | TAG_TYPE_DWORD)
 
 /* TAG_TYPE_QWORD */
@@ -222,6 +223,7 @@
 #define TAG_COMPILER_VERSION (0x22 | TAG_TYPE_STRINGREF)
 #define TAG_ACTION_TYPE (0x23 | TAG_TYPE_STRINGREF)
 #define TAG_EXPORT_NAME (0x24 | TAG_TYPE_STRINGREF)
+#define TAG_URL (0x25 | TAG_TYPE_STRINGREF)
 
 /* TAG_TYPE_LIST */
 #define TAG_DATABASE (0x1 | TAG_TYPE_LIST)
@@ -249,6 +251,7 @@
 #define TAG_LOOKUP (0x17 | TAG_TYPE_LIST)
 #define TAG_CONTEXT (0x18 | TAG_TYPE_LIST)
 #define TAG_CONTEXT_REF (0x19 | TAG_TYPE_LIST)
+#define TAG_SPC (0x20 | TAG_TYPE_LIST)
 #define TAG_STRINGTABLE (0x801 | TAG_TYPE_LIST)
 #define TAG_INDEXES (0x802 | TAG_TYPE_LIST)
 #define TAG_INDEX (0x803 | TAG_TYPE_LIST)

Modified: trunk/reactos/dll/appcompat/apphelp/sdbapi.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdbapi.c?rev=71200=71199=71200=diff
==
--- trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] Sun Apr 24 
17:19:09 2016
@@ -213,7 +213,7 @@
 LPCWSTR WINAPI SdbTagToString(TAG tag)
 {
 /* lookup tables for tags in range 0x1 -> 0xFF | TYPE */
-static const WCHAR table[9][0x31][25] = {
+static const WCHAR table[9][0x32][25] = {
 {   /* TAG_TYPE_NULL */
 {'I','N','C','L','U','D','E',0},
 {'G','E','N','E','R','A','L',0},
@@ -284,7 +284,8 @@
 {'I','n','v','a','l','i','d','T','a','g',0},
 {'I','n','v','a','l','i','d','T','a','g',0},
 {'C','O','N','T','E','X','T','_','T','A','G','I','D',0},
-{'E','X','E','_','W','R','A','P','P','E','R',0}
+{'E','X','E','_','W','R','A','P','P','E','R',0},
+{'U','R','L','_','I','D',0}
 },
 {   /* TAG_TYPE_QWORD */
 {'T','I','M','E',0},
@@ -341,7 +342,8 @@
 
{'L','A','Y','E','R','_','D','I','S','P','L','A','Y','N','A','M','E',0},
 {'C','O','M','P','I','L','E','R','_','V','E','R','S','I','O','N',0},
 {'A','C','T','I','O','N','_','T','Y','P','E',0},
-{'E','X','P','O','R','T','_','N','A','M','E',0}
+{'E','X','P','O','R','T','_','N','A','M','E',0},
+{'U','R','L',0}
 },
 {   /* TAG_TYPE_LIST */
 {'D','A','T','A','B','A','S','E',0},
@@ -368,7 +370,14 @@
 {'A','C','T','I','O','N',0},
 {'L','O','O','K','U','P',0},
 {'C','O','N','T','E','X','T',0},
-{'C','O','N','T','E','X','T','_','R','E','F',0}
+{'C','O','N','T','E','X','T','_','R','E','F',0},
+{'I','n','v','a','l','i','d','T','a','g',0},
+{'I','n','v','a','l','i','d','T','a','g',0},
+{'I','n','v','a','l','i','d','T','a','g',0},
+{'I','n','v','a','l','i','d','T','a','g',0},
+{'I','n','v','a','l','i','d','T','a','g',0},
+{'I','n','v','a','l','i','d','T','a','g',0},
+{'S','P','C',0}
 },
 {   /* TAG_TYPE_STRING */
 {'I','n','v','a','l','i','d','T','a','g',0}
@@ -400,10 +409,10 @@
 TAG_REINSTALL_UPGRADE & 0xFF,
 1,
 TAG_MATCH_MODE & 0xFF,
-TAG_EXE_WRAPPER & 0xFF,
+TAG_URL_ID & 0xFF,
 TAG_FLAG_INSTALL & 0xFF,
-TAG_EXPORT_NAME & 0xFF,
-TAG_CONTEXT_REF & 0xFF,
+TAG_URL & 0xFF,
+TAG_SPC & 0xFF,
 1,
 TAG_APP_ID & 0xFF
 };

Modified: trunk/rostests/apitests/apphelp/apphelp.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/apphelp/apphelp.c?rev=71200=71199=71200=diff
==
--- trunk/rostests/apitests/apphelp/apphelp.c   [iso-885

[ros-diffs] [mjansen] 71193: * Addendum to r71192, which was based on the research of Jared Smudde, Sylvain Deverre and Robert Naumann. CORE-10837

2016-04-23 Thread mjansen
Author: mjansen
Date: Sat Apr 23 23:20:44 2016
New Revision: 71193

URL: http://svn.reactos.org/svn/reactos?rev=71193=rev
Log:
* Addendum to r71192,
which was based on the research of Jared Smudde, Sylvain Deverre and Robert 
Naumann.
CORE-10837

Modified:
trunk/reactos/dll/win32/browseui/shellbrowser.cpp

Modified: trunk/reactos/dll/win32/browseui/shellbrowser.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/shellbrowser.cpp?rev=71193=71192=71193=diff
==
--- trunk/reactos/dll/win32/browseui/shellbrowser.cpp   [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/shellbrowser.cpp   [iso-8859-1] Sat Apr 23 
23:20:44 2016
@@ -3207,6 +3207,7 @@
 SHEnableMenuItem(theMenu, IDM_TOOLS_MAPNETWORKDRIVE, FALSE);
 SHEnableMenuItem(theMenu, IDM_TOOLS_DISCONNECTNETWORKDRIVE, FALSE);
 SHEnableMenuItem(theMenu, IDM_TOOLS_SYNCHRONIZE, FALSE);
+FIXME("Folder options dialog is stubbed: CORE-11141\n");
 SHEnableMenuItem(theMenu, IDM_TOOLS_FOLDEROPTIONS, FALSE);  // Remove 
when CORE-11141 is fixed.
 menuIndex = 4;
 }




[ros-diffs] [mjansen] 71190: [SDK][SDK_APITEST] Improve delayload support CORE-10935 - Add an apitest for our delayload functions. - Improve the delayload (mainly the failure cases, throw exceptions w

2016-04-23 Thread mjansen
Author: mjansen
Date: Sat Apr 23 20:38:06 2016
New Revision: 71190

URL: http://svn.reactos.org/svn/reactos?rev=71190=rev
Log:
[SDK][SDK_APITEST] Improve delayload support CORE-10935
- Add an apitest for our delayload functions.
- Improve the delayload (mainly the failure cases, throw exceptions where 
expected etc).
- Add some tests for advanced delayload features (currently blocked on 
CORE-6504 and CORE-10957)

Added:
trunk/rostests/apitests/sdk/
trunk/rostests/apitests/sdk/CMakeLists.txt   (with props)
trunk/rostests/apitests/sdk/delayimp.cpp   (with props)
trunk/rostests/apitests/sdk/testlist.c   (with props)
Modified:
trunk/reactos/sdk/include/psdk/delayimp.h
trunk/reactos/sdk/lib/delayimp/CMakeLists.txt
trunk/reactos/sdk/lib/delayimp/delayimp.c
trunk/rostests/apitests/CMakeLists.txt

Modified: trunk/reactos/sdk/include/psdk/delayimp.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/psdk/delayimp.h?rev=71190=71189=71190=diff
==
--- trunk/reactos/sdk/include/psdk/delayimp.h   [iso-8859-1] (original)
+++ trunk/reactos/sdk/include/psdk/delayimp.h   [iso-8859-1] Sat Apr 23 
20:38:06 2016
@@ -5,6 +5,17 @@
 /* Hack, for bug in ld.  Will be removed soon.  */
 #define __ImageBase _image_base__
 #endif
+
+#if defined(__cplusplus)
+#define ExternC extern "C"
+#else
+#define ExternC extern
+#endif
+
+#ifndef FACILITY_VISUALCPP
+#define FACILITY_VISUALCPP  ((LONG)0x6d)
+#endif
+#define VcppException(sev,err)  ((sev) | (FACILITY_VISUALCPP<<16) | err)
 
 #define DELAYLOAD_VERSION 0x200
 
@@ -65,24 +76,8 @@
 
 typedef FARPROC (WINAPI *PfnDliHook)(unsigned, PDelayLoadInfo);
 
-FORCEINLINE
-unsigned
-IndexFromPImgThunkData(PCImgThunkData pData, PCImgThunkData pBase)
-{
-return pData - pBase;
-}
 
-extern const IMAGE_DOS_HEADER __ImageBase;
-
-FORCEINLINE
-PVOID
-PFromRva(RVA rva)
-{
-return (PVOID)(((ULONG_PTR)(rva)) + ((ULONG_PTR)&__ImageBase));
-}
-
-
-extern PfnDliHook __pfnDliNotifyHook2;
-extern PfnDliHook __pfnDliFailureHook2;
+ExternC PfnDliHook __pfnDliNotifyHook2;
+ExternC PfnDliHook __pfnDliFailureHook2;
 
 #endif /* not _delayimp_h */

Modified: trunk/reactos/sdk/lib/delayimp/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/delayimp/CMakeLists.txt?rev=71190=71189=71190=diff
==
--- trunk/reactos/sdk/lib/delayimp/CMakeLists.txt   [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/delayimp/CMakeLists.txt   [iso-8859-1] Sat Apr 23 
20:38:06 2016
@@ -2,3 +2,4 @@
 add_definitions(-DUNICODE -D_UNICODE)
 add_library(delayimp delayimp.c)
 add_dependencies(delayimp psdk)
+add_importlibs(delayimp kernel32)

Modified: trunk/reactos/sdk/lib/delayimp/delayimp.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/delayimp/delayimp.c?rev=71190=71189=71190=diff
==
--- trunk/reactos/sdk/lib/delayimp/delayimp.c   [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/delayimp/delayimp.c   [iso-8859-1] Sat Apr 23 
20:38:06 2016
@@ -4,6 +4,7 @@
  * FILE:lib/sdk/delayimp/delayimp.c
  * PURPOSE: Library for delay importing from dlls
  * PROGRAMMERS: Timo Kreuzer <timo.kreu...@reactos.org>
+ *  Mark Jansen
  *
  */
 
@@ -12,17 +13,55 @@
 #include 
 #include 
 
+/ Linker magic: provide a default (NULL) pointer, but allow the user to 
override it /
+
+#if defined(__GNUC__)
+PfnDliHook __pfnDliNotifyHook2;
+PfnDliHook __pfnDliFailureHook2;
+#else
+/* The actual items we use */
+extern PfnDliHook __pfnDliNotifyHook2;
+extern PfnDliHook __pfnDliFailureHook2;
+
+/* The fallback symbols */
+extern PfnDliHook __pfnDliNotifyHook2Default = NULL;
+extern PfnDliHook __pfnDliFailureHook2Default = NULL;
+
+/* Tell the linker to use the fallback symbols */
+#pragma comment(linker, 
"/alternatename:___pfnDliNotifyHook2=___pfnDliNotifyHook2Default")
+#pragma comment(linker, 
"/alternatename:___pfnDliFailureHook2=___pfnDliFailureHook2Default")
+#endif
+
+
+/ Helper functions to convert from RVA to address /
+
+FORCEINLINE
+unsigned
+IndexFromPImgThunkData(PCImgThunkData pData, PCImgThunkData pBase)
+{
+return pData - pBase;
+}
+
+extern const IMAGE_DOS_HEADER __ImageBase;
+
+FORCEINLINE
+PVOID
+PFromRva(RVA rva)
+{
+return (PVOID)(((ULONG_PTR)(rva)) + ((ULONG_PTR)&__ImageBase));
+}
+
+
 / load helper /
 
 FARPROC WINAPI
 __delayLoadHelper2(PCImgDelayDescr pidd, PImgThunkData pIATEntry)
 {
-DelayLoadInfo dli;
+DelayLoadInfo dli = {0};
 int index;
 PImgThunkData pIAT;
 PImgThunkData pINT;
 HMODULE *phMod;
-FARPROC pProc;
 
 pIAT = PFromRva(pidd->rvaIAT);
 pINT = PFromRva(pidd->rvaINT);
@@ -31,9 +70,9 @@
 
 dli.cb = sizeof(dli);
 dli.pidd = pidd;
-dl

[ros-diffs] [mjansen] 71191: [SHELL32] Fix the grouping of folder options radiobuttons CORE-10837

2016-04-23 Thread mjansen
Author: mjansen
Date: Sat Apr 23 22:22:40 2016
New Revision: 71191

URL: http://svn.reactos.org/svn/reactos?rev=71191=rev
Log:
[SHELL32] Fix the grouping of folder options radiobuttons CORE-10837

Modified:
trunk/reactos/dll/win32/shell32/lang/bg-BG.rc
trunk/reactos/dll/win32/shell32/lang/ca-ES.rc
trunk/reactos/dll/win32/shell32/lang/cs-CZ.rc
trunk/reactos/dll/win32/shell32/lang/da-DK.rc
trunk/reactos/dll/win32/shell32/lang/de-DE.rc
trunk/reactos/dll/win32/shell32/lang/el-GR.rc
trunk/reactos/dll/win32/shell32/lang/en-GB.rc
trunk/reactos/dll/win32/shell32/lang/en-US.rc
trunk/reactos/dll/win32/shell32/lang/es-ES.rc
trunk/reactos/dll/win32/shell32/lang/fi-FI.rc
trunk/reactos/dll/win32/shell32/lang/fr-FR.rc
trunk/reactos/dll/win32/shell32/lang/he-IL.rc
trunk/reactos/dll/win32/shell32/lang/hu-HU.rc
trunk/reactos/dll/win32/shell32/lang/it-IT.rc
trunk/reactos/dll/win32/shell32/lang/ja-JP.rc
trunk/reactos/dll/win32/shell32/lang/ko-KR.rc
trunk/reactos/dll/win32/shell32/lang/nl-NL.rc
trunk/reactos/dll/win32/shell32/lang/no-NO.rc
trunk/reactos/dll/win32/shell32/lang/pl-PL.rc
trunk/reactos/dll/win32/shell32/lang/pt-BR.rc
trunk/reactos/dll/win32/shell32/lang/pt-PT.rc
trunk/reactos/dll/win32/shell32/lang/ro-RO.rc
trunk/reactos/dll/win32/shell32/lang/ru-RU.rc
trunk/reactos/dll/win32/shell32/lang/sk-SK.rc
trunk/reactos/dll/win32/shell32/lang/sl-SI.rc
trunk/reactos/dll/win32/shell32/lang/sq-AL.rc
trunk/reactos/dll/win32/shell32/lang/sv-SE.rc
trunk/reactos/dll/win32/shell32/lang/tr-TR.rc
trunk/reactos/dll/win32/shell32/lang/uk-UA.rc
trunk/reactos/dll/win32/shell32/lang/zh-CN.rc
trunk/reactos/dll/win32/shell32/lang/zh-TW.rc

Modified: trunk/reactos/dll/win32/shell32/lang/bg-BG.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/bg-BG.rc?rev=71191=71190=71191=diff
==
--- trunk/reactos/dll/win32/shell32/lang/bg-BG.rc   [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/lang/bg-BG.rc   [iso-8859-1] Sat Apr 23 
22:22:40 2016
@@ -407,17 +407,17 @@
 GROUPBOX "Задачи", -1, 7, 10, 249, 45
 ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL
 AUTORADIOBUTTON "Показване на общите задачи в 
папките", 14001, 20, 25, 210, 10, WS_TABSTOP | WS_GROUP
-AUTORADIOBUTTON "Използване на обичайните папки 
на Windows", 14002, 20, 37, 210, 10, WS_TABSTOP | WS_GROUP
+AUTORADIOBUTTON "Използване на обичайните папки 
на Windows", 14002, 20, 37, 210, 10
 GROUPBOX "Обзор на папките", -1, 7, 60, 249, 45, WS_TABSTOP
 ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL
 AUTORADIOBUTTON "Отваряне на всички папки в 
&един прозорец", 14004, 20, 70, 210, 10, WS_TABSTOP | WS_GROUP
-AUTORADIOBUTTON "Отваряне на всяка папка в 
от&делен прозорец", 14005, 20, 82, 210, 10, WS_TABSTOP | WS_GROUP
+AUTORADIOBUTTON "Отваряне на всяка папка в 
от&делен прозорец", 14005, 20, 82, 210, 10
 GROUPBOX "Цъкането действа така:", -1, 7, 110, 249, 60
 ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL
 AUTORADIOBUTTON "&Отваряне с единично цъкане 
(избор с посочване)", 14007, 20, 120, 210, 10, WS_TABSTOP | 
WS_GROUP
-AUTORADIOBUTTON "Подчертаване заглавията на 
значетата съгласно &обзорника ми", 14008, 30, 220, 
170, 10, WS_TABSTOP | WS_GROUP
-AUTORADIOBUTTON "Подчертаване на заглавията на 
значетата при &посочване", 14009, 30, 144, 220, 10, 
WS_TABSTOP | WS_GROUP
-AUTORADIOBUTTON "&Отваряне с двойно цъкане 
(избиране с единично)", 14010, 20, 156, 170, 10, WS_TABSTOP | 
WS_GROUP
+AUTORADIOBUTTON "Подчертаване заглавията на 
значетата съгласно &обзорника ми", 14008, 30, 220, 
170, 10
+AUTORADIOBUTTON "Подчертаване на заглавията на 
значетата при &посочване", 14009, 30, 144, 220, 10
+AUTORADIOBUTTON "&Отваряне с двойно цъкане 
(избиране с единично)", 14010, 20, 156, 170, 10
 PUSHBUTTON "От под&разбираните", 14011, 160, 180, 75, 14, 
WS_TABSTOP
 END
 

Modified: trunk/reactos/dll/win32/shell32/lang/ca-ES.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32

[ros-diffs] [mjansen] 71362: [MBEDTLS][SCHANNEL] Export mbedtls_ssl_config_free and use it. Patch by Peter Hater. CORE-11270 #resolve #comment Thanks!

2016-05-20 Thread mjansen
Author: mjansen
Date: Fri May 20 17:09:56 2016
New Revision: 71362

URL: http://svn.reactos.org/svn/reactos?rev=71362=rev
Log:
[MBEDTLS][SCHANNEL] Export mbedtls_ssl_config_free and use it. Patch by Peter 
Hater. CORE-11270 #resolve #comment Thanks!

Modified:
trunk/reactos/dll/3rdparty/mbedtls/mbedtls.spec
trunk/reactos/dll/win32/schannel/schannel_mbedtls.c

Modified: trunk/reactos/dll/3rdparty/mbedtls/mbedtls.spec
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/3rdparty/mbedtls/mbedtls.spec?rev=71362=71361=71362=diff
==
--- trunk/reactos/dll/3rdparty/mbedtls/mbedtls.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/3rdparty/mbedtls/mbedtls.spec [iso-8859-1] Fri May 20 
17:09:56 2016
@@ -23,6 +23,7 @@
 @ cdecl mbedtls_ssl_write(ptr ptr ptr)
 @ cdecl mbedtls_ssl_get_peer_cert(ptr)
 @ cdecl mbedtls_ssl_config_init(ptr)
+@ cdecl mbedtls_ssl_config_free(ptr)
 @ cdecl mbedtls_ssl_config_defaults(ptr long long long)
 @ cdecl mbedtls_ssl_conf_dbg(ptr ptr ptr)
 @ cdecl mbedtls_ssl_setup(ptr ptr)

Modified: trunk/reactos/dll/win32/schannel/schannel_mbedtls.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/schannel/schannel_mbedtls.c?rev=71362=71361=71362=diff
==
--- trunk/reactos/dll/win32/schannel/schannel_mbedtls.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/schannel/schannel_mbedtls.c [iso-8859-1] Fri May 20 
17:09:56 2016
@@ -244,6 +244,7 @@
 mbedtls_ssl_free(>ssl);
 mbedtls_ctr_drbg_free(>ctr_drbg);
 mbedtls_entropy_free(>entropy);
+mbedtls_ssl_config_free(>conf);
 
 /* safely overwrite the freed context with zeroes */
 HeapFree(GetProcessHeap(), HEAP_ZERO_MEMORY, s);




[ros-diffs] [mjansen] 71381: [APPHELP][APPHELP_APITEST] Add more db tests and implement SdbGetDatabaseVersion. CORE-10367

2016-05-22 Thread mjansen
Author: mjansen
Date: Sun May 22 20:39:41 2016
New Revision: 71381

URL: http://svn.reactos.org/svn/reactos?rev=71381=rev
Log:
[APPHELP][APPHELP_APITEST] Add more db tests and implement 
SdbGetDatabaseVersion. CORE-10367


Modified:
trunk/reactos/dll/appcompat/apphelp/apphelp.spec
trunk/reactos/dll/appcompat/apphelp/sdbapi.c
trunk/rostests/apitests/apphelp/data.c
trunk/rostests/apitests/apphelp/db.c

Modified: trunk/reactos/dll/appcompat/apphelp/apphelp.spec
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/apphelp.spec?rev=71381=71380=71381=diff
==
--- trunk/reactos/dll/appcompat/apphelp/apphelp.spec[iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/apphelp.spec[iso-8859-1] Sun May 22 
20:39:41 2016
@@ -58,7 +58,7 @@
 @ stub SdbGetDatabaseInformation
 @ stub SdbGetDatabaseInformationByName
 @ stub SdbGetDatabaseMatch
-@ stub SdbGetDatabaseVersion
+@ stdcall SdbGetDatabaseVersion(wstr ptr ptr)
 @ stub SdbGetDllPath
 @ stub SdbGetEntryFlags
 @ stdcall SdbGetFileAttributes(wstr ptr ptr)

Modified: trunk/reactos/dll/appcompat/apphelp/sdbapi.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdbapi.c?rev=71381=71380=71381=diff
==
--- trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] Sun May 22 
20:39:41 2016
@@ -313,6 +313,78 @@
 return SdbpCheckTagType(tag, type);
 }
 
+PDB SdbpOpenDatabase(LPCWSTR path, PATH_TYPE type, PDWORD major, PDWORD minor)
+{
+UNICODE_STRING str;
+OBJECT_ATTRIBUTES attr;
+IO_STATUS_BLOCK io;
+PDB db;
+NTSTATUS Status;
+BYTE header[12];
+
+if (type == DOS_PATH)
+{
+if (!RtlDosPathNameToNtPathName_U(path, , NULL, NULL))
+return NULL;
+}
+else
+RtlInitUnicodeString(, path);
+
+db = SdbpCreate();
+if (!db)
+{
+SHIM_ERR("Failed to allocate memory for shim database\n");
+return NULL;
+}
+
+InitializeObjectAttributes(, , OBJ_CASE_INSENSITIVE, NULL, NULL);
+
+Status = NtCreateFile(>file, FILE_GENERIC_READ | SYNCHRONIZE,
+  , , NULL, FILE_ATTRIBUTE_NORMAL, 
FILE_SHARE_READ,
+  FILE_OPEN, FILE_NON_DIRECTORY_FILE | 
FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0);
+
+if (type == DOS_PATH)
+RtlFreeUnicodeString();
+
+if (!NT_SUCCESS(Status))
+{
+SdbCloseDatabase(db);
+SHIM_ERR("Failed to open shim database file: 0x%lx\n", Status);
+return NULL;
+}
+
+db->size = GetFileSize(db->file, NULL);
+db->data = SdbAlloc(db->size);
+Status = NtReadFile(db->file, NULL, NULL, NULL, , db->data, db->size, 
NULL, NULL);
+
+if (!NT_SUCCESS(Status))
+{
+SdbCloseDatabase(db);
+SHIM_ERR("Failed to open shim database file: 0x%lx\n", Status);
+return NULL;
+}
+
+if (!SdbpReadData(db, , 0, 12))
+{
+SdbCloseDatabase(db);
+SHIM_ERR("Failed to read shim database header\n");
+return NULL;
+}
+
+if (memcmp([8], "sdbf", 4) != 0)
+{
+SdbCloseDatabase(db);
+SHIM_ERR("Shim database header is invalid\n");
+return NULL;
+}
+
+*major = *(DWORD*)[0];
+*minor = *(DWORD*)[4];
+
+return db;
+}
+
+
 /**
  * Opens specified shim database file.
  *
@@ -323,64 +395,14 @@
  */
 PDB WINAPI SdbOpenDatabase(LPCWSTR path, PATH_TYPE type)
 {
-NTSTATUS Status;
-IO_STATUS_BLOCK io;
-OBJECT_ATTRIBUTES attr;
-UNICODE_STRING str;
 PDB db;
-BYTE header[12];
-DWORD dwRead = 0;
-
-if (type == DOS_PATH)
-{
-if (!RtlDosPathNameToNtPathName_U(path, , NULL, NULL))
-return NULL;
-}
-else
-RtlInitUnicodeString(, path);
-
-db = SdbpCreate();
+DWORD major, minor;
+
+db = SdbpOpenDatabase(path, type, , );
 if (!db)
-{
-SHIM_ERR("Failed to allocate memory for shim database\n");
 return NULL;
-}
-
-InitializeObjectAttributes(, , OBJ_CASE_INSENSITIVE, NULL, NULL);
-
-Status = NtCreateFile(>file, FILE_GENERIC_READ | SYNCHRONIZE,
-  , , NULL, FILE_ATTRIBUTE_NORMAL, 
FILE_SHARE_READ,
-  FILE_OPEN, FILE_NON_DIRECTORY_FILE | 
FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0);
-
-if (type == DOS_PATH)
-RtlFreeUnicodeString();
-
-if (!NT_SUCCESS(Status))
-{
-SdbCloseDatabase(db);
-SHIM_ERR("Failed to open shim database file: 0x%lx\n", Status);
-return NULL;
-}
-
-db->size = GetFileSize(db->file, NULL);
-db->data = SdbAlloc(db->size);
-ReadFile(db->file, db->data, db->si

[ros-diffs] [mjansen] 71380: [APPHELP][APPHELP_APITEST] Implement most of sdbread and sdbwrite, mainly the work of Mislav Blaževic, with some small additions from me. CORE-10367

2016-05-22 Thread mjansen
Author: mjansen
Date: Sun May 22 20:27:02 2016
New Revision: 71380

URL: http://svn.reactos.org/svn/reactos?rev=71380=rev
Log:
[APPHELP][APPHELP_APITEST] Implement most of sdbread and sdbwrite, mainly the 
work of Mislav Blaževic, with some small additions from me. CORE-10367

Added:
trunk/reactos/dll/appcompat/apphelp/sdbread.c   (with props)
trunk/reactos/dll/appcompat/apphelp/sdbwrite.c   (with props)
trunk/rostests/apitests/apphelp/db.c   (with props)
Modified:
trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt
trunk/reactos/dll/appcompat/apphelp/apphelp.h
trunk/reactos/dll/appcompat/apphelp/apphelp.spec
trunk/reactos/dll/appcompat/apphelp/sdbapi.c
trunk/rostests/apitests/apphelp/CMakeLists.txt
trunk/rostests/apitests/apphelp/testlist.c

Modified: trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt?rev=71380=71379=71380=diff
==
--- trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt  [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt  [iso-8859-1] Sun May 22 
20:27:02 2016
@@ -5,6 +5,8 @@
 apphelp.c
 layer.c
 sdbapi.c
+sdbread.c
+sdbwrite.c
 sdbfileattr.c
 apphelp.spec
 apphelp.h

Modified: trunk/reactos/dll/appcompat/apphelp/apphelp.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/apphelp.h?rev=71380=71379=71380=diff
==
--- trunk/reactos/dll/appcompat/apphelp/apphelp.h   [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/apphelp.h   [iso-8859-1] Sun May 22 
20:27:02 2016
@@ -32,6 +32,19 @@
 #define TAGREF_NULL (0)
 #define TAGREF_ROOT (0)
 
+typedef struct _DB {
+HANDLE file;
+DWORD size;
+PBYTE data;
+TAGID stringtable;
+DWORD write_iter;
+GUID database_id;
+} DB, *PDB;
+
+/* Flags for SdbInitDatabase */
+#define HID_DOS_PATHS 0x1
+#define HID_DATABASE_FULLPATH 0x2
+#define HID_NO_DATABASE 0x4
 #define HID_DATABASE_TYPE_MASK 0xF00F
 #define SDB_DATABASE_MAIN_MSI 0x8002
 #define SDB_DATABASE_MAIN_SHIM 0x8003
@@ -47,6 +60,11 @@
   };
 } ATTRINFO, *PATTRINFO;
 
+typedef enum _PATH_TYPE {
+DOS_PATH,
+NT_PATH
+} PATH_TYPE;
+
 typedef enum _SHIM_LOG_LEVEL {
 SHIM_ERR = 1,
 SHIM_WARN = 2,
@@ -99,6 +117,18 @@
 void WINAPI SdbpCloseMemMappedFile(PMEMMAPPED mapping);
 DWORD SdbpStrlen(LPCWSTR string);
 PWSTR SdbpStrDup(LPCWSTR string);
+BOOL WINAPI SdbpCheckTagType(TAG tag, WORD type);
+BOOL WINAPI SdbpCheckTagIDType(PDB db, TAGID tagid, WORD type);
+PDB WINAPI SdbpCreate(void);
+PDB WINAPI SdbOpenDatabase(LPCWSTR path, PATH_TYPE type);
+void WINAPI SdbCloseDatabase(PDB);
+BOOL WINAPI SdbIsNullGUID(CONST GUID *Guid);
+
+/* sdbread.c */
+BOOL WINAPI SdbpReadData(PDB db, PVOID dest, DWORD offset, DWORD num);
+TAG WINAPI SdbGetTagFromTagID(PDB db, TAGID tagid);
+TAGID WINAPI SdbFindFirstTag(PDB db, TAGID parent, TAG tag);
+BOOL WINAPI SdbGetDatabaseID(PDB db, GUID* Guid);
 
 
 /* layer.c */

Modified: trunk/reactos/dll/appcompat/apphelp/apphelp.spec
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/apphelp.spec?rev=71380=71379=71380=diff
==
--- trunk/reactos/dll/appcompat/apphelp/apphelp.spec[iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/apphelp.spec[iso-8859-1] Sun May 22 
20:27:02 2016
@@ -20,32 +20,32 @@
 @ stub SdbAddLayerTagRefToQuery
 @ stub SdbApphelpNotify
 @ stub SdbApphelpNotifyExSdbApphelpNotifyEx
-@ stub SdbBeginWriteListTag
+@ stdcall SdbBeginWriteListTag(ptr long)
 @ stub SdbBuildCompatEnvVariables
 @ stub SdbCloseApphelpInformation
-@ stub SdbCloseDatabase
-@ stub SdbCloseDatabaseWrite
+@ stdcall SdbCloseDatabase(ptr)
+@ stdcall SdbCloseDatabaseWrite(ptr)
 @ stub SdbCloseLocalDatabase
 @ stub SdbCommitIndexes
-@ stub SdbCreateDatabase
+@ stdcall SdbCreateDatabase(wstr long)
 @ stub SdbCreateHelpCenterURL
 @ stub SdbCreateMsiTransformFile
 @ stub SdbDeclareIndex
 @ stub SdbDumpSearchPathPartCaches
 @ stub SdbEnumMsiTransforms
-@ stub SdbEndWriteListTag
+@ stdcall SdbEndWriteListTag(ptr long)
 @ stub SdbEscapeApphelpURL
 @ stub SdbFindFirstDWORDIndexedTag
 @ stub SdbFindFirstMsiPackage
 @ stub SdbFindFirstMsiPackage_Str
 @ stub SdbFindFirstNamedTag
 @ stub SdbFindFirstStringIndexedTag
-@ stub SdbFindFirstTag
+@ stdcall SdbFindFirstTag(ptr long long)
 @ stub SdbFindFirstTagRef
 @ stub SdbFindNextDWORDIndexedTag
 @ stub SdbFindNextMsiPackage
 @ stub SdbFindNextStringIndexedTag
-@ stub SdbFindNextTag
+@ stdcall SdbFindNextTag(ptr long long)
 @ stub SdbFindNextTagRef
 @ stub SdbFreeDatabaseInformation
 @ stdcall SdbFreeFileAttributes(ptr)
@@ -53,8 +53,8 @@
 @ stub SdbFreeFlagInfo
 @ stub SdbGetAppCompatDataSize
 @ stub SdbGetAppPatchDir
-@ stub

[ros-diffs] [mjansen] 71312: [APPHELP] Remove imagehlp.dll dependency. CORE-10367

2016-05-10 Thread mjansen
Author: mjansen
Date: Tue May 10 20:42:37 2016
New Revision: 71312

URL: http://svn.reactos.org/svn/reactos?rev=71312=rev
Log:
[APPHELP] Remove imagehlp.dll dependency. CORE-10367

Modified:
trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt
trunk/reactos/dll/appcompat/apphelp/sdbfileattr.c

Modified: trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt?rev=71312=71311=71312=diff
==
--- trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt  [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt  [iso-8859-1] Tue May 10 
20:42:37 2016
@@ -16,7 +16,6 @@
 
 set_module_type(apphelp win32dll)
 target_link_libraries(apphelp wine)
-# When binutils is fixed, we should move imagehlp to delay! CORE-6504
 add_delay_importlibs(apphelp version)
-add_importlibs(apphelp msvcrt imagehlp kernel32 ntdll)
+add_importlibs(apphelp msvcrt kernel32 ntdll)
 add_cd_file(TARGET apphelp DESTINATION reactos/system32 FOR all)

Modified: trunk/reactos/dll/appcompat/apphelp/sdbfileattr.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdbfileattr.c?rev=71312=71311=71312=diff
==
--- trunk/reactos/dll/appcompat/apphelp/sdbfileattr.c   [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/sdbfileattr.c   [iso-8859-1] Tue May 10 
20:42:37 2016
@@ -18,11 +18,13 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#define WIN32_NO_STATUS
 #include "windef.h"
 #include "winbase.h"
 #include "apphelp.h"
 #include "imagehlp.h"
 #include "winver.h"
+#include "rtlfuncs.h"
 
 #include "wine/unicode.h"
 
@@ -334,11 +336,11 @@
 SdbpSetDWORDAttr(_info[23], TAG_LINK_DATE, 
headers->FileHeader.TimeDateStamp);
 SdbpSetDWORDAttr(_info[24], TAG_UPTO_LINK_DATE, 
headers->FileHeader.TimeDateStamp);
 
-export_dir = 
(PIMAGE_EXPORT_DIRECTORY)ImageDirectoryEntryToData(mapped.view, FALSE, 
IMAGE_DIRECTORY_ENTRY_EXPORT, _dir_size);
+export_dir = 
(PIMAGE_EXPORT_DIRECTORY)RtlImageDirectoryEntryToData(mapped.view, FALSE, 
IMAGE_DIRECTORY_ENTRY_EXPORT, _dir_size);
 if (export_dir && ((PBYTE)(export_dir+1) <= mapping_end))
 {
 PIMAGE_SECTION_HEADER section = NULL;
-PBYTE export_name = ImageRvaToVa(headers, mapped.view, 
export_dir->Name, );
+PBYTE export_name = RtlImageRvaToVa(headers, mapped.view, 
export_dir->Name, );
 if (export_name)
 SdbpSetStringAttrFromAnsiString(_info[25], 
TAG_EXPORT_NAME, export_name, strlen((char*)export_name));
 else




[ros-diffs] [mjansen] 71344: [PSDK] Add missing definitions for IACList2 Options. CORE-9281

2016-05-16 Thread mjansen
Author: mjansen
Date: Mon May 16 17:59:10 2016
New Revision: 71344

URL: http://svn.reactos.org/svn/reactos?rev=71344=rev
Log:
[PSDK] Add missing definitions for IACList2 Options. CORE-9281

Modified:
trunk/reactos/sdk/include/psdk/shlobj.h

Modified: trunk/reactos/sdk/include/psdk/shlobj.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/psdk/shlobj.h?rev=71344=71343=71344=diff
==
--- trunk/reactos/sdk/include/psdk/shlobj.h [iso-8859-1] (original)
+++ trunk/reactos/sdk/include/psdk/shlobj.h [iso-8859-1] Mon May 16 
17:59:10 2016
@@ -691,6 +691,15 @@
 #endif
 
 /* IACList2 interface */
+
+#define ACLO_NONE   0x
+#define ACLO_CURRENTDIR 0x0001
+#define ACLO_MYCOMPUTER 0x0002
+#define ACLO_DESKTOP0x0004
+#define ACLO_FAVORITES  0x0008
+#define ACLO_FILESYSONLY0x0010
+#define ACLO_FILESYSDIRS0x0020
+
 #define INTERFACE IACList2
 DECLARE_INTERFACE_(IACList2,IACList)
 {




[ros-diffs] [mjansen] 71347: [PSDK] now the ICurrentWorkingDirectory interface is actually an interface.

2016-05-16 Thread mjansen
Author: mjansen
Date: Mon May 16 18:50:14 2016
New Revision: 71347

URL: http://svn.reactos.org/svn/reactos?rev=71347=rev
Log:
[PSDK] now the ICurrentWorkingDirectory interface is actually an interface.

Modified:
trunk/reactos/sdk/include/psdk/shlobj.h

Modified: trunk/reactos/sdk/include/psdk/shlobj.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/psdk/shlobj.h?rev=71347=71346=71347=diff
==
--- trunk/reactos/sdk/include/psdk/shlobj.h [iso-8859-1] (original)
+++ trunk/reactos/sdk/include/psdk/shlobj.h [iso-8859-1] Mon May 16 
18:50:14 2016
@@ -653,7 +653,7 @@
 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
 STDMETHOD_(ULONG,Release) (THIS) PURE;
 /*** ICurrentWorkingDirectory methods ***/
-STDMETHOD(GetDirectory)(THIS_ _Out_writes_(cchSize) PWSTR pwzPath, DWORD 
cchSize);
+STDMETHOD(GetDirectory)(THIS_ _Out_writes_(cchSize) PWSTR pwzPath, DWORD 
cchSize) PURE;
 STDMETHOD(SetDirectory)(THIS_ _In_ PCWSTR pwzPath) PURE;
 };
 #undef INTERFACE




[ros-diffs] [mjansen] 71345: [BROWSEUI_APITEST] Add tests for ACListISF, a class used for autocompletion. CORE-9281 - Add tests for ACListISF. - Change the SHExplorerParseCmdLine test to use GetProcAd

2016-05-16 Thread mjansen
Author: mjansen
Date: Mon May 16 18:03:09 2016
New Revision: 71345

URL: http://svn.reactos.org/svn/reactos?rev=71345=rev
Log:
[BROWSEUI_APITEST] Add tests for ACListISF, a class used for autocompletion. 
CORE-9281
- Add tests for ACListISF.
- Change the SHExplorerParseCmdLine test to use GetProcAddress instead of 
relying on the import (it's not there anymore in NT 6.0+)

Added:
trunk/rostests/apitests/browseui/ACListISF.cpp   (with props)
Modified:
trunk/rostests/apitests/browseui/CMakeLists.txt
trunk/rostests/apitests/browseui/SHExplorerParseCmdLine.c
trunk/rostests/apitests/browseui/testlist.c

Added: trunk/rostests/apitests/browseui/ACListISF.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/browseui/ACListISF.cpp?rev=71345
==
--- trunk/rostests/apitests/browseui/ACListISF.cpp  (added)
+++ trunk/rostests/apitests/browseui/ACListISF.cpp  [iso-8859-1] Mon May 16 
18:03:09 2016
@@ -0,0 +1,472 @@
+/*
+ * PROJECT: ReactOS api tests
+ * LICENSE: GPLv2+ - See COPYING in the top level directory
+ * PURPOSE: Test for ACListISF objects
+ * PROGRAMMER:  Mark Jansen
+ */
+
+#define _UNICODE
+#define UNICODE
+#include 
+#include 
+#include 
+#include   //
+#include  // These 3 includes only exist here to make gcc happy 
about (unused) templates..
+#include  //
+
+// Yes, gcc at it again, let's validate everything found inside unused 
templates!
+ULONG DbgPrint(PCH Format,...);
+
+#include 
+#include 
+#include 
+
+static bool g_ShowHidden;
+static DWORD g_WinVersion;
+#define WINVER_VISTA   0x0600
+
+
+#define ok_hr(status, expected) ok_hex(status, expected)
+
+// We do not want our results to originate from the helper functions, so have 
them originate from the calls to them
+#define test_at_end (winetest_set_location(__FILE__, 
__LINE__), 0) ? (void)0 : test_at_end_imp
+#define test_ExpectDrives   (winetest_set_location(__FILE__, 
__LINE__), 0) ? (void)0 : test_ExpectDrives_imp
+#define test_ExpectFolders  (winetest_set_location(__FILE__, 
__LINE__), 0) ? (void)0 : test_ExpectFolders_imp
+#define winetest_ok_hr(expression, expected) \
+do { \
+int _value = (expression); \
+winetest_ok(_value == (expected), "Wrong value for '%s', expected: " 
#expected " (0x%x), got: 0x%x\n", \
+   #expression, (int)(expected), _value); \
+} while (0)
+
+
+
+
+static void test_at_end_imp(CComPtr& EnumStr)
+{
+CComHeapPtr Result;
+ULONG Fetched = 12345;
+HRESULT hr = EnumStr->Next(1, , );
+winetest_ok(hr == S_FALSE, "Expected hr to be S_FALSE, was 0x%lx\n", hr);
+winetest_ok(Fetched == 0u, "Expected Fetched to be 0, was: %lu\n", 
Fetched);
+if (Fetched == 1u)
+winetest_ok(0, "Expected there not to be a result, got: %s\n", 
wine_dbgstr_w(Result));
+}
+
+static bool GetDisplayname(CComPtr& spDrives, 
CComHeapPtr& pidl, CComHeapPtr& DisplayName)
+{
+STRRET StrRet;
+HRESULT hr;
+winetest_ok_hr(hr = spDrives->GetDisplayNameOf(pidl, SHGDN_INFOLDER | 
SHGDN_FORPARSING | SHGDN_FORADDRESSBAR, ), S_OK);
+if (!SUCCEEDED(hr))
+return false;
+
+winetest_ok_hr(hr = StrRetToStrW(, NULL, ), S_OK);
+if (!SUCCEEDED(hr))
+return false;
+return true;
+}
+
+enum ExpectOptions
+{
+None = 0,
+IgnoreRoot = 1,
+CheckLast = 2,
+IgnoreHidden = 4,
+IgnoreFiles = 8,
+};
+
+// wtf c++
+ExpectOptions operator | (const ExpectOptions& left, const ExpectOptions& 
right)
+{
+return static_cast(static_cast(left) | 
static_cast(right));
+}
+
+
+static void
+test_ExpectFolders_imp(CComPtr& EnumStr, LPITEMIDLIST pidlTarget, 
const WCHAR* Root, ExpectOptions options)
+{
+CComPtr spDesktop;
+HRESULT hr = SHGetDesktopFolder();
+
+CComPtr spTarget;
+if (pidlTarget)
+{
+winetest_ok_hr(hr = spDesktop->BindToObject(pidlTarget, NULL, 
IID_PPV_ARG(IShellFolder, )), S_OK);
+if (!SUCCEEDED(hr))
+return;
+}
+else
+{
+spTarget = spDesktop;
+}
+
+SHCONTF EnumFlags = SHCONTF_FOLDERS | SHCONTF_INIT_ON_FIRST_NEXT;
+if (g_ShowHidden && !(options & IgnoreHidden))
+EnumFlags |= SHCONTF_INCLUDEHIDDEN;
+if (!(options & IgnoreFiles))
+EnumFlags |= SHCONTF_NONFOLDERS;
+
+CComPtr spEnumIDList;
+winetest_ok_hr(hr = spTarget->EnumObjects(NULL, EnumFlags, ), 
S_OK);
+if (!SUCCEEDED(hr))
+return;
+
+WCHAR Buffer[512];
+CComHeapPtr pidl;
+INT Count = 0;
+while (spEnumIDList->Next(1, , NULL) == S_OK)
+{
+CComHeapPtr DisplayName;
+if (!GetDisplayname(spTarget, pidl, DisplayName))
+break;
+
+CComHeapPtr Result;
+ULONG Fetched;
+hr = EnumStr->Next(1, , );
+winetest_ok_hr(hr,

[ros-diffs] [mjansen] 71333: [PSDK] Add missing ICurrentWorkingDirectory definition. CORE-9281

2016-05-15 Thread mjansen
Author: mjansen
Date: Sun May 15 10:31:15 2016
New Revision: 71333

URL: http://svn.reactos.org/svn/reactos?rev=71333=rev
Log:
[PSDK] Add missing ICurrentWorkingDirectory definition. CORE-9281

Modified:
trunk/reactos/sdk/include/psdk/shlguid.h
trunk/reactos/sdk/include/psdk/shlobj.h

Modified: trunk/reactos/sdk/include/psdk/shlguid.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/psdk/shlguid.h?rev=71333=71332=71333=diff
==
--- trunk/reactos/sdk/include/psdk/shlguid.h[iso-8859-1] (original)
+++ trunk/reactos/sdk/include/psdk/shlguid.h[iso-8859-1] Sun May 15 
10:31:15 2016
@@ -84,6 +84,7 @@
 DEFINE_GUID(IID_IACList,   
0x77A130B0,0x94FD,0x11D0,0xA5,0x44,0x00,0xC0,0x4F,0xD7,0xD0,0x62);
 DEFINE_GUID(IID_IACList2,  
0x470141A0,0x5186,0x11D2,0xBB,0xB6,0x00,0x60,0x97,0x7B,0x46,0x4C);
 DEFINE_GUID(IID_IObjMgr,   
0x00BB2761,0x6A77,0x11D0,0xA5,0x35,0x00,0xC0,0x4F,0xD7,0xD0,0x62);
+DEFINE_GUID(IID_ICurrentWorkingDirectory,   
0x91956D21,0x9276,0x11D1,0x92,0x1A,0x00,0x60,0x97,0xDF,0x5B,0xD4);
 
 DEFINE_GUID(IID_IProgressDialog, 
0xEBBC7C04,0x315E,0x11D2,0xB6,0x2F,0x00,0x60,0x97,0xDF,0x5B,0xD4);
 #define SID_SProgressUI CLSID_ProgressDialog

Modified: trunk/reactos/sdk/include/psdk/shlobj.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/psdk/shlobj.h?rev=71333=71332=71333=diff
==
--- trunk/reactos/sdk/include/psdk/shlobj.h [iso-8859-1] (original)
+++ trunk/reactos/sdk/include/psdk/shlobj.h [iso-8859-1] Sun May 15 
10:31:15 2016
@@ -644,6 +644,30 @@
 #define IObjMgr_Remove(p,a) (p)->lpVtbl->Remove(p,a)
 #endif
 
+/* ICurrentWorkingDirectory interface */
+#define INTERFACE ICurrentWorkingDirectory
+DECLARE_INTERFACE_(ICurrentWorkingDirectory,IUnknown)
+{
+/*** IUnknown methods ***/
+STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void** ppvObject) 
PURE;
+STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+STDMETHOD_(ULONG,Release) (THIS) PURE;
+/*** ICurrentWorkingDirectory methods ***/
+STDMETHOD(GetDirectory)(THIS_ _Out_writes_(cchSize) PWSTR pwzPath, DWORD 
cchSize);
+STDMETHOD(SetDirectory)(THIS_ _In_ PCWSTR pwzPath) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define ICurrentWorkingDirectory_QueryInterface(p,a,b)  
(p)->lpVtbl->QueryInterface(p,a,b)
+#define ICurrentWorkingDirectory_AddRef(p)  (p)->lpVtbl->AddRef(p)
+#define ICurrentWorkingDirectory_Release(p) (p)->lpVtbl->Release(p)
+/*** ICurrentWorkingDirectory methods ***/
+#define ICurrentWorkingDirectory_GetDirectory(p,a,b)
(p)->lpVtbl->GetDirectory(p,a,b)
+#define ICurrentWorkingDirectory_SetDirectory(p,a)  
(p)->lpVtbl->SetDirectory(p,a)
+#endif
+
 /* IACList interface */
 #define INTERFACE IACList
 DECLARE_INTERFACE_(IACList,IUnknown)




[ros-diffs] [mjansen] 71332: [SHELL] Addendum to r71328, correct one german resource id.

2016-05-15 Thread mjansen
Author: mjansen
Date: Sun May 15 10:25:47 2016
New Revision: 71332

URL: http://svn.reactos.org/svn/reactos?rev=71332=rev
Log:
[SHELL] Addendum to r71328, correct one german resource id.

Modified:
trunk/reactos/dll/win32/shell32/lang/de-DE.rc

Modified: trunk/reactos/dll/win32/shell32/lang/de-DE.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/de-DE.rc?rev=71332=71331=71332=diff
==
--- trunk/reactos/dll/win32/shell32/lang/de-DE.rc   [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/lang/de-DE.rc   [iso-8859-1] Sun May 15 
10:25:47 2016
@@ -413,7 +413,7 @@
 AUTORADIOBUTTON "Jeden Ordner im  Fenster öffnen", 
IDC_FOLDER_OPTIONS_SAMEWINDOW, 40, 70, 150, 10, WS_TABSTOP | WS_GROUP
 AUTORADIOBUTTON " Ordner im eigenen Fenster öffnen", 
IDC_FOLDER_OPTIONS_OWNWINDOW, 40, 82, 150, 10
 GROUPBOX "Markieren von Elementen", -1, 7, 110, 249, 60
-CONTROL "", IDC_FOLDER_OPTIONS_TASKICON, "Static", SS_ICON | WS_CHILD | 
WS_VISIBLE, 14, 120, 21, 20
+CONTROL "", IDC_FOLDER_OPTIONS_CLICKICON, "Static", SS_ICON | WS_CHILD | 
WS_VISIBLE, 14, 120, 21, 20
 AUTORADIOBUTTON "&Öffnen durch  Klick (Markieren durch 
zeigen)", IDC_FOLDER_OPTIONS_SINGLECLICK, 40, 120, 210, 10, WS_TABSTOP | 
WS_GROUP
 AUTORADIOBUTTON "Symbolbeschriftungen wie im Br unterstreichen", 
IDC_FOLDER_OPTIONS_ULBROWSER, 50, 132, 200, 10
 AUTORADIOBUTTON "Symbolbeschriftungen nur beim Zeigen ", 
IDC_FOLDER_OPTIONS_ULPOINT, 50, 144, 200, 10




[ros-diffs] [mjansen] 71334: [COM_APITEST] Add ICurrentWorkingDirectory for CORE-9281

2016-05-15 Thread mjansen
Author: mjansen
Date: Sun May 15 14:45:01 2016
New Revision: 71334

URL: http://svn.reactos.org/svn/reactos?rev=71334=rev
Log:
[COM_APITEST] Add ICurrentWorkingDirectory for CORE-9281

Modified:
trunk/rostests/apitests/com/browseui.c
trunk/rostests/apitests/com/com_apitest.c

Modified: trunk/rostests/apitests/com/browseui.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/com/browseui.c?rev=71334=71333=71334=diff
==
--- trunk/rostests/apitests/com/browseui.c  [iso-8859-1] (original)
+++ trunk/rostests/apitests/com/browseui.c  [iso-8859-1] Sun May 15 
14:45:01 2016
@@ -51,6 +51,7 @@
 {0x0,   _IUnknown },
 {0x4,   _IACList2 },
 {0x4,   _IACList },
+{0x8,   _ICurrentWorkingDirectory },
 {0xc,   _IShellService },
 {   0x10,   _IPersistFolder },
 }

Modified: trunk/rostests/apitests/com/com_apitest.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/com/com_apitest.c?rev=71334=71333=71334=diff
==
--- trunk/rostests/apitests/com/com_apitest.c   [iso-8859-1] (original)
+++ trunk/rostests/apitests/com/com_apitest.c   [iso-8859-1] Sun May 15 
14:45:01 2016
@@ -97,6 +97,7 @@
 { ID_NAME(IID_IContinue) },
 { ID_NAME(IID_ICopyHookA),  TRUE },
 { ID_NAME(IID_ICopyHookW),  TRUE },
+{ ID_NAME(IID_ICurrentWorkingDirectory),TRUE },
 { ID_NAME(IID_ICustomizeInfoTip) },
 { ID_NAME(IID_IDVGetEnum),  TRUE },
 { ID_NAME(IID_IDataObject)   },




[ros-diffs] [mjansen] 71248: [WINTRUST_WINETEST] Import Wine Staging commit bdb15cf (WinVerifyTrust tests), by Sebastian Lackner & Me CORE-10923

2016-05-03 Thread mjansen
Author: mjansen
Date: Tue May  3 19:29:39 2016
New Revision: 71248

URL: http://svn.reactos.org/svn/reactos?rev=71248=rev
Log:
[WINTRUST_WINETEST] Import Wine Staging commit bdb15cf (WinVerifyTrust tests), 
by Sebastian Lackner & Me CORE-10923

Modified:
trunk/rostests/winetests/wintrust/softpub.c

Modified: trunk/rostests/winetests/wintrust/softpub.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wintrust/softpub.c?rev=71248=71247=71248=diff
==
--- trunk/rostests/winetests/wintrust/softpub.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/wintrust/softpub.c [iso-8859-1] Tue May  3 
19:29:39 2016
@@ -3,6 +3,7 @@
  *
  * Copyright 2007,2010 Juan Lang
  * Copyright 2010 Andrey Turkin
+ * Copyright 2016 Mark Jansen
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -869,6 +870,376 @@
 ok(r == S_OK, "WinVerifyTrust failed: %08x\n", r);
 }
 
+/* Self-signed .exe, built with tcc, signed with signtool
+ * (and a certificate generated on a self-signed CA).
+ *
+ * small.c:
+ * int _start()
+ * {
+ * return 0;
+ * }
+ *
+ * tcc -nostdlib small.c
+ * signtool sign /v /f codesign.pfx small.exe
+ */
+static const BYTE SelfSignedFile32[] =
+{
+
0x4D,0x5A,0x90,0x00,0x03,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0xB8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x0E,0x1F,0xBA,0x0E,0x00,0xB4,0x09,0xCD,
+
0x21,0xB8,0x01,0x4C,0xCD,0x21,0x54,0x68,0x69,0x73,0x20,0x70,0x72,0x6F,0x67,0x72,0x61,0x6D,0x20,0x63,0x61,0x6E,0x6E,0x6F,
+
0x74,0x20,0x62,0x65,0x20,0x72,0x75,0x6E,0x20,0x69,0x6E,0x20,0x44,0x4F,0x53,0x20,0x6D,0x6F,0x64,0x65,0x2E,0x0D,0x0D,0x0A,
+
0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x45,0x00,0x00,0x4C,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
0x00,0x00,0x00,0x00,0xE0,0x00,0x0F,0x03,0x0B,0x01,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x10,0x00,0x00,0x00,0x02,0x00,0x00,
+
0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x02,0x00,0x00,
+
0xE7,0x0C,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x10,0x00,0x00,
+
0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x68,0x05,0x00,0x00,
+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2E,0x74,0x65,0x78,0x74,0x00,0x00,0x00,
+
0x18,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x55,0x89,0xE5,0x81,0xEC,0x00,0x00,0x00,0x00,0x90,0xB8,0x00,0x00,0x00,0x00,0xE9,
+
0x00,0x00,0x00,0x00,0xC9,0xC3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

[ros-diffs] [mjansen] 71230: [APPHELP][APPHELP_APITEST] Add some apphelp GUID helper functions + tests to be used later on. CORE-10367 - SdbGetStandardDatabaseGUID - SdbGUIDFromString - SdbGUIDToStrin

2016-05-01 Thread mjansen
Author: mjansen
Date: Sun May  1 21:43:30 2016
New Revision: 71230

URL: http://svn.reactos.org/svn/reactos?rev=71230=rev
Log:
[APPHELP][APPHELP_APITEST] Add some apphelp GUID helper functions + tests to be 
used later on. CORE-10367
- SdbGetStandardDatabaseGUID
- SdbGUIDFromString
- SdbGUIDToString
- SdbIsNullGUID

Modified:
trunk/reactos/dll/appcompat/apphelp/apphelp.h
trunk/reactos/dll/appcompat/apphelp/apphelp.spec
trunk/reactos/dll/appcompat/apphelp/sdbapi.c
trunk/rostests/apitests/apphelp/apphelp.c

Modified: trunk/reactos/dll/appcompat/apphelp/apphelp.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/apphelp.h?rev=71230=71229=71230=diff
==
--- trunk/reactos/dll/appcompat/apphelp/apphelp.h   [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/apphelp.h   [iso-8859-1] Sun May  1 
21:43:30 2016
@@ -31,6 +31,11 @@
 
 #define TAGREF_NULL (0)
 #define TAGREF_ROOT (0)
+
+#define HID_DATABASE_TYPE_MASK 0xF00F
+#define SDB_DATABASE_MAIN_MSI 0x8002
+#define SDB_DATABASE_MAIN_SHIM 0x8003
+#define SDB_DATABASE_MAIN_DRIVERS 0x8004
 
 typedef struct tagATTRINFO {
   TAG   type;

Modified: trunk/reactos/dll/appcompat/apphelp/apphelp.spec
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/apphelp.spec?rev=71230=71229=71230=diff
==
--- trunk/reactos/dll/appcompat/apphelp/apphelp.spec[iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/apphelp.spec[iso-8859-1] Sun May  1 
21:43:30 2016
@@ -79,17 +79,17 @@
 @ stdcall SdbGetPermLayerKeys(wstr wstr ptr long)
 @ stub SdbGetShowDebugInfoOption
 @ stub SdbGetShowDebugInfoOptionValue
-@ stub SdbGetStandardDatabaseGUID
+@ stdcall SdbGetStandardDatabaseGUID(long ptr)
 @ stub SdbGetStringTagPtr
 @ stub SdbGetTagDataSize
 @ stub SdbGetTagFromTagID
 @ stub SdbGrabMatchingInfo
 @ stub SdbGrabMatchingInfoEx
-@ stub SdbGUIDFromString
-@ stub SdbGUIDToString
+@ stdcall SdbGUIDFromString(wstr ptr)
+@ stdcall SdbGUIDToString(ptr wstr long)
 @ stub SdbInitDatabase
 @ stub SdbInitDatabaseEx
-@ stub SdbIsNullGUID
+@ stdcall SdbIsNullGUID(ptr)
 @ stub SdbIsStandardDatabase
 @ stub SdbIsTagrefFromLocalDB
 @ stub SdbIsTagrefFromMainDB

Modified: trunk/reactos/dll/appcompat/apphelp/sdbapi.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdbapi.c?rev=71230=71229=71230=diff
==
--- trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] Sun May  1 
21:43:30 2016
@@ -26,6 +26,10 @@
 
 #include "wine/unicode.h"
 
+
+static const GUID GUID_DATABASE_MSI = {0xd8ff6d16,0x6a3a,0x468a, 
{0x8b,0x44,0x01,0x71,0x4d,0xdc,0x49,0xea}};
+static const GUID GUID_DATABASE_SHIM = {0x,0x,0x, 
{0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11}};
+static const GUID GUID_DATABASE_DRIVERS = {0xf9ab2228,0x3312,0x4a73, 
{0xb6,0xf9,0x93,0x6d,0x70,0xe1,0x12,0xef}};
 
 static HANDLE SdbpHeap(void);
 
@@ -284,6 +288,88 @@
 NtClose(mapping->section);
 NtClose(mapping->file);
 RtlZeroMemory(mapping, sizeof(*mapping));
+}
+
+/**
+ * Parses a string to retrieve a GUID.
+ *
+ * @param [in]  GuidString  The string to parse.
+ * @param [out] GuidThe resulting GUID.
+ *
+ * @return  TRUE if it succeeds, FALSE if it fails.
+ */
+BOOL WINAPI SdbGUIDFromString(PCWSTR GuidString, GUID *Guid)
+{
+UNICODE_STRING GuidString_u;
+RtlInitUnicodeString(_u, GuidString);
+return NT_SUCCESS(RtlGUIDFromString(_u, Guid));
+}
+
+/**
+ * Converts a GUID to a string.
+ *
+ * @param [in]  GuidThe GUID to convert.
+ * @param [out] GuidString  The resulting string representation of Guid.
+ * @param [in]  Length  The length of GuidString.
+ *
+ * @return  TRUE if it succeeds, FALSE if it fails.
+ */
+BOOL WINAPI SdbGUIDToString(CONST GUID *Guid, PWSTR GuidString, SIZE_T Length)
+{
+UNICODE_STRING GuidString_u;
+if(NT_SUCCESS(RtlStringFromGUID(Guid, _u)))
+{
+HRESULT hr = StringCchCopyNW(GuidString, Length, GuidString_u.Buffer, 
GuidString_u.Length / 2);
+RtlFreeUnicodeString(_u);
+return SUCCEEDED(hr);
+}
+return FALSE;
+}
+
+/**
+ * Checks if the specified GUID is a NULL GUID
+ *
+ * @param [in]  GuidThe GUID to check.
+ *
+ * @return  TRUE if it is a NULL GUID.
+ */
+BOOL WINAPI SdbIsNullGUID(CONST GUID *Guid)
+{
+static GUID NullGuid = { 0 };
+return !Guid || IsEqualGUID(, Guid);
+}
+
+/**
+ * Get the GUID from one of the standard databases.
+ *
+ * @param [in]  Flags   The ID to retrieve the guid from. (See 
SDB_DATABASE_MAIN_[xxx])
+ * @param [out] GuidThe resulting GUID.
+ *
+ * @return  TRUE if a known database ID.
+ */
+BOOL WINAPI SdbGetStandardDatabase

[ros-diffs] [mjansen] 71226: [APPHELP][APPHELP_APITEST] Add SdbGetFileAttributes + tests, based on the work of Mislav Blažević CORE-10367 - Implement SdbGetFileAttributes (based on the work of Mislav

2016-05-01 Thread mjansen
Author: mjansen
Date: Sun May  1 19:12:06 2016
New Revision: 71226

URL: http://svn.reactos.org/svn/reactos?rev=71226=rev
Log:
[APPHELP][APPHELP_APITEST] Add SdbGetFileAttributes + tests, based on the work 
of Mislav Blažević CORE-10367
- Implement SdbGetFileAttributes (based on the work of Mislav Blažević)
- Add tests for SdbGetFileAttributes

Added:
trunk/reactos/dll/appcompat/apphelp/sdbfileattr.c   (with props)
trunk/rostests/apitests/apphelp/data.c   (with props)
Modified:
trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt
trunk/reactos/dll/appcompat/apphelp/apphelp.h
trunk/reactos/dll/appcompat/apphelp/apphelp.spec
trunk/reactos/dll/appcompat/apphelp/sdbapi.c
trunk/rostests/apitests/apphelp/CMakeLists.txt
trunk/rostests/apitests/apphelp/apphelp.c

Modified: trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt?rev=71226=71225=71226=diff
==
--- trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt  [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt  [iso-8859-1] Sun May  1 
19:12:06 2016
@@ -3,8 +3,9 @@
 
 list(APPEND SOURCE
 apphelp.c
+layer.c
 sdbapi.c
-layer.c
+sdbfileattr.c
 apphelp.spec
 apphelp.h
 ${CMAKE_CURRENT_BINARY_DIR}/apphelp_stubs.c)
@@ -15,6 +16,7 @@
 
 set_module_type(apphelp win32dll)
 target_link_libraries(apphelp wine)
-#add_delay_importlibs(apphelp version imagehlp user32)
-add_importlibs(apphelp msvcrt kernel32 ntdll)
+# When binutils is fixed, we should move imagehlp to delay! CORE-6504
+add_delay_importlibs(apphelp version)
+add_importlibs(apphelp msvcrt imagehlp kernel32 ntdll)
 add_cd_file(TARGET apphelp DESTINATION reactos/system32 FOR all)

Modified: trunk/reactos/dll/appcompat/apphelp/apphelp.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/apphelp.h?rev=71226=71225=71226=diff
==
--- trunk/reactos/dll/appcompat/apphelp/apphelp.h   [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/apphelp.h   [iso-8859-1] Sun May  1 
19:12:06 2016
@@ -32,6 +32,16 @@
 #define TAGREF_NULL (0)
 #define TAGREF_ROOT (0)
 
+typedef struct tagATTRINFO {
+  TAG   type;
+  DWORD flags;
+  union {
+QWORD qwattr;
+DWORD dwattr;
+WCHAR *lpattr;
+  };
+} ATTRINFO, *PATTRINFO;
+
 typedef enum _SHIM_LOG_LEVEL {
 SHIM_ERR = 1,
 SHIM_WARN = 2,
@@ -72,12 +82,28 @@
 
 #endif
 
+typedef struct tagMEMMAPPED {
+HANDLE file;
+HANDLE section;
+PBYTE view;
+SIZE_T size;
+SIZE_T mapped_size;
+} MEMMAPPED, *PMEMMAPPED;
+
+BOOL WINAPI SdbpOpenMemMappedFile(LPCWSTR path, PMEMMAPPED mapping);
+void WINAPI SdbpCloseMemMappedFile(PMEMMAPPED mapping);
+DWORD SdbpStrlen(LPCWSTR string);
+PWSTR SdbpStrDup(LPCWSTR string);
+
 
 /* layer.c */
 BOOL WINAPI AllowPermLayer(PCWSTR path);
 BOOL WINAPI SdbGetPermLayerKeys(PCWSTR wszPath, PWSTR pwszLayers, PDWORD 
pdwBytes, DWORD dwFlags);
 BOOL WINAPI SetPermLayerState(PCWSTR wszPath, PCWSTR wszLayer, DWORD dwFlags, 
BOOL bMachine, BOOL bEnable);
 
+
+#define ATTRIBUTE_AVAILABLE 0x1
+#define ATTRIBUTE_FAILED 0x2
 
 #define TAGID_NULL 0x0
 #define TAGID_ROOT 0x0

Modified: trunk/reactos/dll/appcompat/apphelp/apphelp.spec
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/apphelp.spec?rev=71226=71225=71226=diff
==
--- trunk/reactos/dll/appcompat/apphelp/apphelp.spec[iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/apphelp.spec[iso-8859-1] Sun May  1 
19:12:06 2016
@@ -48,7 +48,7 @@
 @ stub SdbFindNextTag
 @ stub SdbFindNextTagRef
 @ stub SdbFreeDatabaseInformation
-@ stub SdbFreeFileAttributes
+@ stdcall SdbFreeFileAttributes(ptr)
 @ stub SdbFreeFileInfo
 @ stub SdbFreeFlagInfo
 @ stub SdbGetAppCompatDataSize
@@ -61,7 +61,7 @@
 @ stub SdbGetDatabaseVersion
 @ stub SdbGetDllPath
 @ stub SdbGetEntryFlags
-@ stub SdbGetFileAttributes
+@ stdcall SdbGetFileAttributes(wstr ptr ptr)
 @ stub SdbGetFileImageType
 @ stub SdbGetFileImageTypeEx
 @ stub SdbGetFileInfo

Modified: trunk/reactos/dll/appcompat/apphelp/sdbapi.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdbapi.c?rev=71226=71225=71226=diff
==
--- trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] Sun May  1 
19:12:06 2016
@@ -155,52 +155,135 @@
 HeapDestroy(g_Heap);
 }
 
+static HANDLE SdbpHeap(void)
+{
+return g_Heap;
+}
+
+LPVOID SdbpAlloc(SIZE_T size
+#if SDBAPI_DEBUG_ALLOC
+, int line, const char* file
+#endif
+)
+{
+LPVOID mem = HeapAlloc(SdbpHeap(), HEAP_ZERO_MEMORY, size

[ros-diffs] [mjansen] 71261: [NTOSKRNL][NTDLL_APITEST] Fix error returned from NtCreateSection when opening an empty file. CORE-11166

2016-05-05 Thread mjansen
Author: mjansen
Date: Thu May  5 12:06:07 2016
New Revision: 71261

URL: http://svn.reactos.org/svn/reactos?rev=71261=rev
Log:
[NTOSKRNL][NTDLL_APITEST] Fix error returned from NtCreateSection when opening 
an empty file. CORE-11166

Modified:
trunk/reactos/ntoskrnl/mm/section.c
trunk/rostests/apitests/ntdll/NtMapViewOfSection.c

Modified: trunk/reactos/ntoskrnl/mm/section.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=71261=71260=71261=diff
==
--- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Thu May  5 12:06:07 2016
@@ -2993,7 +2993,7 @@
 {
 ObDereferenceObject(Section);
 ObDereferenceObject(FileObject);
-return STATUS_FILE_INVALID;
+return STATUS_MAPPED_FILE_SIZE_ZERO;
 }
 }
 

Modified: trunk/rostests/apitests/ntdll/NtMapViewOfSection.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/NtMapViewOfSection.c?rev=71261=71260=71261=diff
==
--- trunk/rostests/apitests/ntdll/NtMapViewOfSection.c  [iso-8859-1] (original)
+++ trunk/rostests/apitests/ntdll/NtMapViewOfSection.c  [iso-8859-1] Thu May  5 
12:06:07 2016
@@ -1351,6 +1351,53 @@
 DeleteFileW(FileName);
 }
 
+static void
+Test_EmptyFile(VOID)
+{
+NTSTATUS Status;
+WCHAR TempPath[MAX_PATH];
+WCHAR FileName[MAX_PATH];
+HANDLE Handle;
+HANDLE SectionHandle;
+ULONG Length;
+
+Length = GetTempPathW(MAX_PATH, TempPath);
+ok(Length != 0, "GetTempPathW failed with %lu\n", GetLastError());
+Length = GetTempFileNameW(TempPath, L"nta", 0, FileName);
+ok(Length != 0, "GetTempFileNameW failed with %lu\n", GetLastError());
+Handle = CreateFileW(FileName,
+ FILE_ALL_ACCESS,
+ 0,
+ NULL,
+ CREATE_ALWAYS,
+ 0,
+ NULL);
+if (Handle == INVALID_HANDLE_VALUE)
+{
+skip("Failed to create temp file %ls, error %lu\n", FileName, 
GetLastError());
+return;
+}
+
+Status = NtCreateSection(,
+ STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | 
SECTION_MAP_READ,
+ 0, 0, PAGE_READONLY, SEC_COMMIT, Handle);
+ok_ntstatus(Status, STATUS_MAPPED_FILE_SIZE_ZERO);
+
+if (NT_SUCCESS(Status))
+NtClose(SectionHandle);
+
+Status = NtCreateSection(,
+ STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | 
SECTION_MAP_READ,
+ 0, 0, PAGE_READONLY, SEC_IMAGE, Handle);
+ok_ntstatus(Status, STATUS_INVALID_FILE_FOR_SECTION);
+
+if (NT_SUCCESS(Status))
+NtClose(SectionHandle);
+
+CloseHandle(Handle);
+DeleteFileW(FileName);
+}
+
 START_TEST(NtMapViewOfSection)
 {
 Test_PageFileSection();
@@ -1358,4 +1405,5 @@
 Test_BasedSection();
 Test_NoLoadSection(FALSE);
 Test_NoLoadSection(TRUE);
+Test_EmptyFile();
 }




[ros-diffs] [mjansen] 71262: fix the build for msvc (2013?) users.

2016-05-05 Thread mjansen
Author: mjansen
Date: Thu May  5 12:43:57 2016
New Revision: 71262

URL: http://svn.reactos.org/svn/reactos?rev=71262=rev
Log:
fix the build for msvc (2013?) users.

Modified:
trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp

Modified: trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp?rev=71262=71261=71262=diff
==
--- trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp [iso-8859-1] Thu May  5 
12:43:57 2016
@@ -6139,7 +6139,7 @@
 } else { // srb->Cdb[0] == SCSIOP_REQUEST_SENSE)
 
 PSENSE_DATA senseData = (PSENSE_DATA) srb->DataBuffer;
-
+(void)senseData;
 KdPrint3((PRINT_PREFIX "AtapiInterrupt: ATAPI command status 
%#x\n", status));
 if (status == SRB_STATUS_DATA_OVERRUN) {
 // Check to see if we at least get mininum number of bytes




[ros-diffs] [mjansen] 71263: [NTOSKRNL] Fix NtApphelpCacheControl image lookup failure return codes when validating file times. Also silence some debug outputs in the normal usage flow.

2016-05-05 Thread mjansen
Author: mjansen
Date: Thu May  5 14:13:29 2016
New Revision: 71263

URL: http://svn.reactos.org/svn/reactos?rev=71263=rev
Log:
[NTOSKRNL] Fix NtApphelpCacheControl image lookup failure return codes when 
validating file times.
Also silence some debug outputs in the normal usage flow.

Modified:
trunk/reactos/ntoskrnl/ps/apphelp.c

Modified: trunk/reactos/ntoskrnl/ps/apphelp.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/apphelp.c?rev=71263=71262=71263=diff
==
--- trunk/reactos/ntoskrnl/ps/apphelp.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ps/apphelp.c [iso-8859-1] Thu May  5 14:13:29 2016
@@ -546,14 +546,14 @@
 Entry = RtlLookupElementGenericTableAvl(, );
 if (Entry == NULL)
 {
-DPRINT1("SHIMS: ApphelpCacheLookupEntry: could not find %wZ\n", 
ImageName);
+DPRINT("SHIMS: ApphelpCacheLookupEntry: could not find %wZ\n", 
ImageName);
 goto Cleanup;
 }
 
-DPRINT1("SHIMS: ApphelpCacheLookupEntry: found %wZ\n", ImageName);
+DPRINT("SHIMS: ApphelpCacheLookupEntry: found %wZ\n", ImageName);
 if (ImageHandle == INVALID_HANDLE_VALUE)
 {
-DPRINT1("SHIMS: ApphelpCacheLookupEntry: ok\n");
+DPRINT("SHIMS: ApphelpCacheLookupEntry: ok\n");
 /* just return if we know it, do not query file info */
 Status = STATUS_SUCCESS;
 }
@@ -564,7 +564,7 @@
 Lookup.Persistent.DateTime.QuadPart == 
Entry->Persistent.DateTime.QuadPart &&
 Lookup.Persistent.FileSize.QuadPart == 
Entry->Persistent.FileSize.QuadPart)
 {
-DPRINT1("SHIMS: ApphelpCacheLookupEntry: found & validated\n");
+DPRINT("SHIMS: ApphelpCacheLookupEntry: found & validated\n");
 Status = STATUS_SUCCESS;
 /* move it to the front to keep it alive */
 RemoveEntryList(>List);
@@ -572,7 +572,8 @@
 }
 else
 {
-DPRINT1("SHIMS: ApphelpCacheLookupEntry: file info mismatch\n");
+DPRINT1("SHIMS: ApphelpCacheLookupEntry: file info mismatch 
(%lx)\n", Status);
+Status = STATUS_NOT_FOUND;
 /* Could not read file info, or it did not match, drop it from the 
cache */
 ApphelpCacheRemoveEntryNolock(Entry);
 }
@@ -642,7 +643,7 @@
  , );
 if (Lookup)
 {
-DPRINT1("SHIMS: ApphelpCacheUpdateEntry: Entry already exists, reusing 
it\n");
+DPRINT("SHIMS: ApphelpCacheUpdateEntry: Entry already exists, reusing 
it\n");
 /* Unlink the found item, so we can put it back at the front,
 and copy the earlier obtained file info*/
 RemoveEntryList(>List);
@@ -651,7 +652,7 @@
 }
 else
 {
-DPRINT1("SHIMS: ApphelpCacheUpdateEntry: Inserting new Entry\n");
+DPRINT("SHIMS: ApphelpCacheUpdateEntry: Inserting new Entry\n");
 /* Insert a new entry, with its own copy of the ImageName */
 ApphelpDuplicateUnicodeString(, ImageName);
 Lookup = RtlInsertElementGenericTableFullAvl(,
@@ -705,7 +706,7 @@
 PLIST_ENTRY ListEntry;
 PSHIM_CACHE_ENTRY Entry;
 
-DPRINT1("SHIMS: NtApphelpCacheControl( Dumping entries, newset to oldest 
)\n");
+DPRINT1("SHIMS: NtApphelpCacheControl( Dumping entries, newest to oldest 
)\n");
 ApphelpCacheAcquireLock();
 ListEntry = ApphelpShimCacheAge.Flink;
 while (ListEntry != )
@@ -741,19 +742,19 @@
 switch (Service)
 {
 case ApphelpCacheServiceLookup:
-DPRINT1("SHIMS: NtApphelpCacheControl( ApphelpCacheServiceLookup 
)\n");
+DPRINT("SHIMS: NtApphelpCacheControl( ApphelpCacheServiceLookup 
)\n");
 Status = ApphelpValidateData(ServiceData, , );
 if (NT_SUCCESS(Status))
 Status = ApphelpCacheLookupEntry(, Handle);
 break;
 case ApphelpCacheServiceRemove:
-DPRINT1("SHIMS: NtApphelpCacheControl( ApphelpCacheServiceRemove 
)\n");
+DPRINT("SHIMS: NtApphelpCacheControl( ApphelpCacheServiceRemove 
)\n");
 Status = ApphelpValidateData(ServiceData, , );
 if (NT_SUCCESS(Status))
 Status = ApphelpCacheRemoveEntry();
 break;
 case ApphelpCacheServiceUpdate:
-DPRINT1("SHIMS: NtApphelpCacheControl( ApphelpCacheServiceUpdate 
)\n");
+DPRINT("SHIMS: NtApphelpCacheControl( ApphelpCacheServiceUpdate 
)\n");
 Status = ApphelpCacheAccessCheck();
 if (NT_SUCCESS(Status))
 {




[ros-diffs] [mjansen] 71309: [UNIATA] Fix uninitialized variable usage. Patch by 'Alter'. CORE-11157 #resolve #comment Thanks!

2016-05-10 Thread mjansen
Author: mjansen
Date: Tue May 10 18:15:35 2016
New Revision: 71309

URL: http://svn.reactos.org/svn/reactos?rev=71309=rev
Log:
[UNIATA] Fix uninitialized variable usage. Patch by 'Alter'. CORE-11157 
#resolve #comment Thanks!

Modified:
trunk/reactos/drivers/storage/ide/uniata/id_dma.cpp

Modified: trunk/reactos/drivers/storage/ide/uniata/id_dma.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata/id_dma.cpp?rev=71309=71308=71309=diff
==
--- trunk/reactos/drivers/storage/ide/uniata/id_dma.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/ide/uniata/id_dma.cpp [iso-8859-1] Tue May 10 
18:15:35 2016
@@ -1538,7 +1538,7 @@
 if(deviceExtension->DevID == ATA_I82371FB) {
 KdPrint2((PRINT_PREFIX "  I82371FB\n"));
 USHORT reg4x;
-USHORT control;
+USHORT control=0;
 for(i=wdmamode; i>=0; i--) {
 idx = 5+i;
 if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, 
LunExt, ATA_WDMA0 + i)) {
@@ -1559,9 +1559,9 @@
 }
 GetPciConfig2(0x40+Channel*2, reg4x);
 if(apiomode > ATA_PIO0) {
-control = 0x03;/* IORDY|TIME0 */
+control |= 0x03;   /* IORDY|TIME0 */
 } else {
-control = 0x02;/* IORDY */
+control |= 0x02;   /* IORDY */
 }
// if (ata_pio_need_iordy(adev))
//control |= 2; /* IE */




[ros-diffs] [mjansen] 71289: [NTDLL_APITEST] Show that NtMapViewOfSection does not properly NULL out the remainder of the mapped memory. CORE-11206

2016-05-08 Thread mjansen
Author: mjansen
Date: Sun May  8 17:01:15 2016
New Revision: 71289

URL: http://svn.reactos.org/svn/reactos?rev=71289=rev
Log:
[NTDLL_APITEST] Show that NtMapViewOfSection does not properly NULL out the 
remainder of the mapped memory. CORE-11206

Modified:
trunk/rostests/apitests/ntdll/NtMapViewOfSection.c

Modified: trunk/rostests/apitests/ntdll/NtMapViewOfSection.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/NtMapViewOfSection.c?rev=71289=71288=71289=diff
==
--- trunk/rostests/apitests/ntdll/NtMapViewOfSection.c  [iso-8859-1] (original)
+++ trunk/rostests/apitests/ntdll/NtMapViewOfSection.c  [iso-8859-1] Sun May  8 
17:01:15 2016
@@ -1398,6 +1398,101 @@
 DeleteFileW(FileName);
 }
 
+// CORE-11206
+static void
+Test_Truncate(VOID)
+{
+WCHAR TempPath[MAX_PATH];
+WCHAR FileName[MAX_PATH];
+NTSTATUS Status;
+SIZE_T ViewSize = 0;
+HANDLE Handle;
+HANDLE SectionHandle;
+
+ULONG Length;
+BOOL Success;
+DWORD Written, Error;
+VOID* BaseAddress;
+
+Length = GetTempPathW(MAX_PATH, TempPath);
+ok(Length != 0, "GetTempPathW failed with %lu\n", GetLastError());
+Length = GetTempFileNameW(TempPath, L"nta", 0, FileName);
+ok(Length != 0, "GetTempFileNameW failed with %lu\n", GetLastError());
+Handle = CreateFileW(FileName, FILE_ALL_ACCESS, 0, NULL, CREATE_ALWAYS, 0, 
NULL);
+
+Success = WriteFile(Handle, "TESTDATA", 8, , NULL);
+ok(Success == TRUE, "WriteFile failed with %lu\n", GetLastError());
+ok(Written == 8, "WriteFile wrote %lu bytes\n", Written);
+
+Written = SetFilePointer(Handle, 6, NULL, FILE_BEGIN);
+ok(Written == 6, "SetFilePointer returned %lu bytes\n", Written);
+Success = SetEndOfFile(Handle);
+ok(Success == TRUE, "SetEndOfFile failed with %lu\n", GetLastError());
+
+Status = NtCreateSection(,
+ STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | 
SECTION_MAP_READ,
+ 0, 0, PAGE_READONLY, SEC_COMMIT, Handle);
+ok_ntstatus(Status, STATUS_SUCCESS);
+BaseAddress = NULL;
+ViewSize = 0;
+Status = NtMapViewOfSection(SectionHandle, NtCurrentProcess(), 
, 0,
+0, 0, , ViewShare, 0, PAGE_READONLY);
+ok_ntstatus(Status, STATUS_SUCCESS);
+
+if (BaseAddress)
+{
+// First we test data that was truncated even before the file mapping 
was opened
+Length = strlen((char*)BaseAddress);
+ok(Length == 6, "Old data was not properly erased! (Length=%lu)\n", 
Length);
+}
+
+// Now we truncate the file on disk some more
+Written = SetFilePointer(Handle, 4, NULL, FILE_BEGIN);
+ok(Written == 4, "SetFilePointer returned %lu bytes\n", Written);
+Success = SetEndOfFile(Handle);
+Error = GetLastError();
+ok(Success == FALSE, "SetEndOfFile succeeded\n");
+ok(Error == ERROR_USER_MAPPED_FILE, "SetEndOfFile did not set error to 
ERROR_USER_MAPPED_FILE (%lu)\n", Error);
+
+if (BaseAddress)
+{
+Length = strlen((char*)BaseAddress);
+ok(Length == 6, "Length should not have changed! (Length=%lu)\n", 
Length);
+}
+
+// Unmap and set the end shorter.
+Status = NtUnmapViewOfSection(NtCurrentProcess(), BaseAddress);
+ok_ntstatus(Status, STATUS_SUCCESS);
+Success = CloseHandle(SectionHandle);
+ok(Success == TRUE, "CloseHandle failed with %lu\n", GetLastError());
+
+Written = SetFilePointer(Handle, 4, NULL, FILE_BEGIN);
+ok(Written == 4, "SetFilePointer returned %lu bytes\n", Written);
+Success = SetEndOfFile(Handle);
+ok(Success == TRUE, "SetEndOfFile failed with %lu\n", GetLastError());
+
+Status = NtCreateSection(,
+ STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | 
SECTION_MAP_READ,
+ 0, 0, PAGE_READONLY, SEC_COMMIT, Handle);
+ok_ntstatus(Status, STATUS_SUCCESS);
+BaseAddress = NULL;
+ViewSize = 0;
+Status = NtMapViewOfSection(SectionHandle, NtCurrentProcess(), 
, 0,
+0, 0, , ViewShare, 0, PAGE_READONLY);
+ok_ntstatus(Status, STATUS_SUCCESS);
+
+// CLEANUP
+Status = NtUnmapViewOfSection(NtCurrentProcess(), BaseAddress);
+ok_ntstatus(Status, STATUS_SUCCESS);
+Success = CloseHandle(SectionHandle);
+ok(Success == TRUE, "CloseHandle failed with %lu\n", GetLastError());
+Success = CloseHandle(Handle);
+ok(Success == TRUE, "CloseHandle failed with %lu\n", GetLastError());
+
+Success = DeleteFileW(FileName);
+ok(Success == TRUE, "DeleteFileW failed with %lu\n", GetLastError());
+}
+
 START_TEST(NtMapViewOfSection)
 {
 Test_PageFileSection();
@@ -1406,4 +1501,5 @@
 Test_NoLoadSection(FALSE);
 Test_NoLoadSection(TRUE);
 Test_EmptyFile();
+Test_Truncate();
 }




[ros-diffs] [mjansen] 71290: [APPHELP] Addendum to r71226, fix some failing testcases of SdbGetFileAttributes + make it more robust. CORE-10367 - Work around a ROS bug (CORE-11206) by doing some bette

2016-05-08 Thread mjansen
Author: mjansen
Date: Sun May  8 20:43:59 2016
New Revision: 71290

URL: http://svn.reactos.org/svn/reactos?rev=71290=rev
Log:
[APPHELP] Addendum to r71226, fix some failing testcases of 
SdbGetFileAttributes + make it more robust. CORE-10367
- Work around a ROS bug (CORE-11206) by doing some better bounds checking.
- Silence a VAD warning by checking for NULL instead of blindly passing mem to 
NtUnmapViewOfSection
- Rewrite module type lookup code to use an enum and to return the found header.

Modified:
trunk/reactos/dll/appcompat/apphelp/sdbapi.c
trunk/reactos/dll/appcompat/apphelp/sdbfileattr.c

Modified: trunk/reactos/dll/appcompat/apphelp/sdbapi.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdbapi.c?rev=71290=71289=71290=diff
==
--- trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] Sun May  8 
20:43:59 2016
@@ -284,7 +284,9 @@
 
 void WINAPI SdbpCloseMemMappedFile(PMEMMAPPED mapping)
 {
-NtUnmapViewOfSection(NtCurrentProcess(), mapping->view);
+/* Prevent a VAD warning */
+if (mapping->view)
+NtUnmapViewOfSection(NtCurrentProcess(), mapping->view);
 NtClose(mapping->section);
 NtClose(mapping->file);
 RtlZeroMemory(mapping, sizeof(*mapping));

Modified: trunk/reactos/dll/appcompat/apphelp/sdbfileattr.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdbfileattr.c?rev=71290=71289=71290=diff
==
--- trunk/reactos/dll/appcompat/apphelp/sdbfileattr.c   [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/sdbfileattr.c   [iso-8859-1] Sun May  8 
20:43:59 2016
@@ -27,6 +27,14 @@
 #include "wine/unicode.h"
 
 #define NUM_ATTRIBUTES  28
+enum APPHELP_MODULETYPE
+{
+MODTYPE_UNKNOWN = 0,
+MODTYPE_DOS = 1,
+MODTYPE_NE = 2,
+MODTYPE_PE = 3,
+};
+
 
 static void WINAPI SdbpSetDWORDAttr(PATTRINFO attr, TAG tag, DWORD value)
 {
@@ -176,25 +184,33 @@
 return checks;
 }
 
-static DWORD WINAPI SdbpGetModuleType(PMEMMAPPED mapping)
+static DWORD WINAPI SdbpGetModuleType(PMEMMAPPED mapping, PIMAGE_NT_HEADERS* 
nt_headers)
 {
 PIMAGE_DOS_HEADER dos = (PIMAGE_DOS_HEADER)mapping->view;
 PIMAGE_OS2_HEADER os2;
 
+*nt_headers = NULL;
+
 if (mapping->size < 2 || dos->e_magic != IMAGE_DOS_SIGNATURE)
-return 0;
+return MODTYPE_UNKNOWN;
 
 if (mapping->size < sizeof(IMAGE_DOS_HEADER) || mapping->size < 
(dos->e_lfanew+2))
-return 1;
+return MODTYPE_DOS;
 
 os2 = (PIMAGE_OS2_HEADER)((PBYTE)dos + dos->e_lfanew);
 if (os2->ne_magic == IMAGE_OS2_SIGNATURE || os2->ne_magic == 
IMAGE_OS2_SIGNATURE_LE)
-return 2;
+{
+*nt_headers = (PIMAGE_NT_HEADERS)os2;
+return MODTYPE_NE;
+}
 
 if (mapping->size >= (dos->e_lfanew + 4) && 
((PIMAGE_NT_HEADERS)os2)->Signature == IMAGE_NT_SIGNATURE)
-return 3;
-
-return 1;
+{
+*nt_headers = (PIMAGE_NT_HEADERS)os2;
+return MODTYPE_PE;
+}
+
+return MODTYPE_DOS;
 }
 
 /**
@@ -246,8 +262,9 @@
 
 PIMAGE_NT_HEADERS headers;
 MEMMAPPED mapped;
+PBYTE mapping_end;
 PVOID file_info = 0;
-DWORD headersum, checksum, module_type;
+DWORD module_type;
 WCHAR translation[128] = {0};
 PATTRINFO attr_info;
 
@@ -261,6 +278,7 @@
 SHIM_ERR("Error retrieving FILEINFO structure\n");
 return FALSE;
 }
+mapping_end = mapped.view + mapped.size;
 
 attr_info = (PATTRINFO)SdbAlloc(NUM_ATTRIBUTES * sizeof(ATTRINFO));
 
@@ -269,15 +287,14 @@
 SdbpSetDWORDAttr(_info[1], TAG_CHECKSUM, 
SdbpCalculateFileChecksum());
 else
 SdbpSetAttrFail(_info[1]);
-module_type = SdbpGetModuleType();
-
-if (module_type)
+module_type = SdbpGetModuleType(, );
+
+if (module_type != MODTYPE_UNKNOWN)
 SdbpSetDWORDAttr(_info[16], TAG_MODULE_TYPE, module_type);
 else
 SdbpSetAttrFail(_info[16]); /* TAG_MODULE_TYPE */
 
-headers = CheckSumMappedFile(mapped.view, mapped.size, , 
);
-if (headers)
+if (headers && module_type == MODTYPE_PE && ((PBYTE)(headers+1) <= 
mapping_end))
 {
 DWORD info_size;
 SIZE_T export_dir_size;
@@ -318,7 +335,7 @@
 SdbpSetDWORDAttr(_info[24], TAG_UPTO_LINK_DATE, 
headers->FileHeader.TimeDateStamp);
 
 export_dir = 
(PIMAGE_EXPORT_DIRECTORY)ImageDirectoryEntryToData(mapped.view, FALSE, 
IMAGE_DIRECTORY_ENTRY_EXPORT, _dir_size);
-if (export_dir)
+if (export_dir && ((PBYTE)(export_dir+1) <= mapping_end))
 {
 PIMAGE_SECTION_HEADER section = NULL;
 PBYTE export_name = ImageRvaToVa(headers, mapped.vie

[ros-diffs] [mjansen] 71272: [UDFS] Avoid double free in UDFLoadLogicalVolInt. Patch by Víctor Martínez Calvo. CID 1322300 CORE-11181 #resolve #comment Thanks!

2016-05-07 Thread mjansen
Author: mjansen
Date: Sat May  7 11:50:03 2016
New Revision: 71272

URL: http://svn.reactos.org/svn/reactos?rev=71272=rev
Log:
[UDFS] Avoid double free in UDFLoadLogicalVolInt. Patch by Víctor Martínez 
Calvo. CID 1322300 CORE-11181 #resolve
#comment Thanks!

Modified:
trunk/reactos/drivers/filesystems/udfs/udf_info/mount.cpp

Modified: trunk/reactos/drivers/filesystems/udfs/udf_info/mount.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/udf_info/mount.cpp?rev=71272=71271=71272=diff
==
--- trunk/reactos/drivers/filesystems/udfs/udf_info/mount.cpp   [iso-8859-1] 
(original)
+++ trunk/reactos/drivers/filesystems/udfs/udf_info/mount.cpp   [iso-8859-1] 
Sat May  7 11:50:03 2016
@@ -1316,12 +1316,12 @@
 last_loc = loc;
 loc = Vcb->LVid->nextIntegrityExt;
 Vcb->LVid = NULL;
-MyFreePool__(Buf);
 lvid_count++;
 if(lvid_count > UDF_MAX_LVID_CHAIN_LENGTH) {
 RC = STATUS_DISK_CORRUPT_ERROR;
 goto exit_with_err;
 }
+MyFreePool__(Buf);
 continue;
 }
 // process last LVID




[ros-diffs] [mjansen] 71271: [KBDTOOL] Handle failure to parse scancodes. Patch by Víctor Martínez Calvo. CID 1341307 CORE-11177 #resolve #comment Thanks!

2016-05-07 Thread mjansen
Author: mjansen
Date: Sat May  7 10:22:45 2016
New Revision: 71271

URL: http://svn.reactos.org/svn/reactos?rev=71271=rev
Log:
[KBDTOOL] Handle failure to parse scancodes. Patch by Víctor Martínez Calvo. 
CID 1341307 CORE-11177 #resolve
#comment Thanks!

Modified:
trunk/reactos/sdk/tools/kbdtool/parser.c

Modified: trunk/reactos/sdk/tools/kbdtool/parser.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/tools/kbdtool/parser.c?rev=71271=71270=71271=diff
==
--- trunk/reactos/sdk/tools/kbdtool/parser.c[iso-8859-1] (original)
+++ trunk/reactos/sdk/tools/kbdtool/parser.c[iso-8859-1] Sat May  7 
10:22:45 2016
@@ -917,6 +917,14 @@
 exit(1);
 }
 }
+
+/* Check if we have found any ScanCode in the file */
+
+if (ScanCodeCount == -1)
+{
+printf("No ScanCode found!\n");
+exit(1);
+}
 
 /* Process the scan code table */
 Entry = >Entry[ScanCodeCount];




[ros-diffs] [mjansen] 71396: [CRT] Partially sync strtoi64 with Wine Staging 1.9.9. Patch by Samuel Serapión CORE-11174 #resolve #comment Thanks!

2016-05-24 Thread mjansen
Author: mjansen
Date: Tue May 24 19:27:57 2016
New Revision: 71396

URL: http://svn.reactos.org/svn/reactos?rev=71396=rev
Log:
[CRT] Partially sync strtoi64 with Wine Staging 1.9.9. Patch by Samuel Serapión 
CORE-11174 #resolve #comment Thanks!

Modified:
trunk/reactos/media/doc/README.WINE
trunk/reactos/sdk/lib/crt/libcntpr.cmake
trunk/reactos/sdk/lib/crt/string/strtoi64.c
trunk/reactos/sdk/lib/crt/string/strtoul.c

Modified: trunk/reactos/media/doc/README.WINE
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=71396=71395=71396=diff
==
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue May 24 19:27:57 2016
@@ -291,7 +291,8 @@
   reactos/lib/sdk/crt/process/_cwait.c  # Synced to WineStaging-1.7.37
   reactos/lib/sdk/crt/signal/xcptinfo.c # Synced to WineStaging-1.7.37
   reactos/lib/sdk/crt/string/scanf.c/h  # Synced to Wine-1.7.17
-  reactos/lib/sdk/crt/string/strtoul.c  # Synced to WineStaging-1.7.37
+  reactos/lib/sdk/crt/string/strtoi64.c # Synced to WineStaging-1.9.9
+  reactos/lib/sdk/crt/string/strtoul.c  # Synced to WineStaging-1.9.9
   reactos/lib/sdk/crt/strings/wcs.c # Synced at 20080611
   reactos/lib/sdk/crt/wine/heap.c   # Synced at 20080529
   reactos/lib/sdk/crt/wine/undname.c# Synced to WineStaging-1.7.55

Modified: trunk/reactos/sdk/lib/crt/libcntpr.cmake
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/crt/libcntpr.cmake?rev=71396=71395=71396=diff
==
--- trunk/reactos/sdk/lib/crt/libcntpr.cmake[iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/crt/libcntpr.cmake[iso-8859-1] Tue May 24 
19:27:57 2016
@@ -48,6 +48,7 @@
 string/itoa.c
 string/itow.c
 string/mbstowcs_nt.c
+string/strtoi64.c
 string/strtol.c
 string/strtoul.c
 string/strtoull.c

Modified: trunk/reactos/sdk/lib/crt/string/strtoi64.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/crt/string/strtoi64.c?rev=71396=71395=71396=diff
==
--- trunk/reactos/sdk/lib/crt/string/strtoi64.c [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/crt/string/strtoi64.c [iso-8859-1] Tue May 24 
19:27:57 2016
@@ -1,13 +1,28 @@
 #include 
 
+/* Based on Wine Staging 1.9.9 - dlls/msvcrt/string.c */
 
-__int64
-_strtoi64(const char *nptr, char **endptr, int base)
+/*
+*  _strtoi64_l (MSVCRT.@)
+*
+* FIXME: locale parameter is ignored
+*/
+__int64 CDECL strtoi64_l(const char *nptr, char **endptr, int base, _locale_t 
locale)
 {
+const char *p = nptr;
 BOOL negative = FALSE;
+BOOL got_digit = FALSE;
 __int64 ret = 0;
 
-   while(isspace((unsigned char)*nptr)) nptr++;
+#ifndef _LIBCNT_
+TRACE("(%s %p %d %p)\n", debugstr_a(nptr), endptr, base, locale);
+#endif
+
+if (!MSVCRT_CHECK_PMT(nptr != NULL)) return 0;
+if (!MSVCRT_CHECK_PMT(base == 0 || base >= 2)) return 0;
+if (!MSVCRT_CHECK_PMT(base <= 36)) return 0;
+
+while (isspace(*nptr)) nptr++;
 
 if(*nptr == '-') {
 negative = TRUE;
@@ -31,7 +46,7 @@
 char cur = tolower(*nptr);
 int v;
 
-if(isdigit((unsigned char)cur)) {
+if(isdigit(cur)) {
 if(cur >= '0'+base)
 break;
 v = cur-'0';
@@ -40,6 +55,7 @@
 break;
 v = cur-'a'+10;
 }
+got_digit = TRUE;
 
 if(negative)
 v = -v;
@@ -48,19 +64,31 @@
 
 if(!negative && (ret>_I64_MAX/base || ret*base>_I64_MAX-v)) {
 ret = _I64_MAX;
+#ifndef _LIBCNT_
 *_errno() = ERANGE;
-} else if(negative && (ret<_I64_MIN/base || ret*base<_I64_MIN-v)) {
+#endif
+}
+else if (negative && (ret<_I64_MIN / base || ret*base<_I64_MIN - v)) {
 ret = _I64_MIN;
+#ifndef _LIBCNT_
 *_errno() = ERANGE;
-} else
+#endif
+}
+else
 ret = ret*base + v;
 }
 
 if(endptr)
-*endptr = (char*)nptr;
+*endptr = (char*)(got_digit ? nptr : p);
 
 return ret;
 }
 
+__int64
+_strtoi64(const char *nptr, char **endptr, int base)
+{
+return  strtoi64_l(nptr, endptr, base, NULL);
+}
+
 
 /* EOF */

Modified: trunk/reactos/sdk/lib/crt/string/strtoul.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/crt/string/strtoul.c?rev=71396=71395=71396=diff
==
--- trunk/reactos/sdk/lib/crt/string/strtoul.c  [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/crt/string/strtoul.c  [iso-8859-1] Tue 

[ros-diffs] [mjansen] 71985: [CRT][GDI32] Introduce atan2 library, use it for gdi32 to fix a crash. CORE-11521 As suggested by Thomas :)

2016-07-23 Thread mjansen
Author: mjansen
Date: Sat Jul 23 20:35:11 2016
New Revision: 71985

URL: http://svn.reactos.org/svn/reactos?rev=71985=rev
Log:
[CRT][GDI32] Introduce atan2 library, use it for gdi32 to fix a crash. 
CORE-11521
As suggested by Thomas :)

Modified:
trunk/reactos/sdk/lib/crt/CMakeLists.txt
trunk/reactos/win32ss/gdi/gdi32/CMakeLists.txt
trunk/reactos/win32ss/gdi/gdi32/wine/rosglue.c

Modified: trunk/reactos/sdk/lib/crt/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/crt/CMakeLists.txt?rev=71985=71984=71985=diff
==
--- trunk/reactos/sdk/lib/crt/CMakeLists.txt[iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/crt/CMakeLists.txt[iso-8859-1] Sat Jul 23 
20:35:11 2016
@@ -66,3 +66,19 @@
 string/wctype.c)
 add_target_compile_definitions(strtol _LIBCNT_)
 add_dependencies(strtol psdk)
+
+
+if(ARCH STREQUAL "i386")
+list(APPEND ATAN2_ASM_SOURCE math/i386/atan2_asm.s)
+elseif(ARCH STREQUAL "amd64")
+list(APPEND ATAN2_ASM_SOURCE math/amd64/atan2.S)
+elseif(ARCH STREQUAL "arm")
+list(APPEND ATAN2_ASM_SOURCE math/arm/atan2.s)
+endif()
+
+add_asm_files(atan2_asm ${ATAN2_ASM_SOURCE})
+add_library(atan2 ${atan2_asm})
+set_target_properties(atan2 PROPERTIES LINKER_LANGUAGE "C")
+add_dependencies(atan2 asm)
+
+

Modified: trunk/reactos/win32ss/gdi/gdi32/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/CMakeLists.txt?rev=71985=71984=71985=diff
==
--- trunk/reactos/win32ss/gdi/gdi32/CMakeLists.txt  [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/gdi32/CMakeLists.txt  [iso-8859-1] Sat Jul 23 
20:35:11 2016
@@ -61,6 +61,7 @@
 win32ksys
 dxguid
 msvcrtex
+atan2
 ${PSEH_LIB})
 
 add_importlibs(gdi32 user32 advapi32 kernel32 ntdll)

Modified: trunk/reactos/win32ss/gdi/gdi32/wine/rosglue.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/wine/rosglue.c?rev=71985=71984=71985=diff
==
--- trunk/reactos/win32ss/gdi/gdi32/wine/rosglue.c  [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/gdi32/wine/rosglue.c  [iso-8859-1] Sat Jul 23 
20:35:11 2016
@@ -519,23 +519,6 @@
 {
 DbgRaiseAssertionFailure();
 }
-
-#if defined(_MSC_VER) && (DBG != 1)
-
-/* MSVC uses its own in this case. */
-#else
-
-double
-__cdecl
-atan2(
-double y,
-double x)
-{
-__debugbreak();
-return 0.;
-}
-
-#endif
 
 
/**/
 




[ros-diffs] [mjansen] 72061: [ATL][ATL_APITEST] Implement / Improve CString, based upon the code that was already there. CORE-11579 #resolve Add code + tests for: Conversion of A->W and W->A, equality

2016-07-30 Thread mjansen
Author: mjansen
Date: Sat Jul 30 19:07:43 2016
New Revision: 72061

URL: http://svn.reactos.org/svn/reactos?rev=72061=rev
Log:
[ATL][ATL_APITEST] Implement / Improve CString, based upon the code that was 
already there. CORE-11579 #resolve
Add code + tests for:
Conversion of A->W and W->A, equality operators, MakeLower, MakeUpper, Find, 
FindOneOf, ReverseFind, Compare, Mid, Left, Right, Format, Replace, Trim, 
TrimLeft, TrimRight.

Added:
trunk/rostests/apitests/atl/CString.cpp   (with props)
trunk/rostests/apitests/atl/CString.inl   (with props)
Modified:
trunk/reactos/sdk/lib/atl/atlsimpstr.h
trunk/reactos/sdk/lib/atl/atlstr.h
trunk/reactos/sdk/lib/atl/cstringt.h
trunk/rostests/apitests/atl/CMakeLists.txt
trunk/rostests/apitests/atl/testlist.c

Modified: trunk/reactos/sdk/lib/atl/atlsimpstr.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/atl/atlsimpstr.h?rev=72061=72060=72061=diff
==
--- trunk/reactos/sdk/lib/atl/atlsimpstr.h  [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/atl/atlsimpstr.h  [iso-8859-1] Sat Jul 30 
19:07:43 2016
@@ -200,6 +200,28 @@
 return *this;
 }
 
+CSimpleStringT& operator=(_In_ const CSimpleStringT& strSrc)
+{
+CStringData* pData = GetData();
+CStringData* pNewData = strSrc.GetData();
+
+if (pNewData != pData)
+{
+if (!pData->IsLocked() && (pNewData->pStringMgr == 
pData->pStringMgr))
+{
+pNewData = CloneData(pNewData);
+pData->Release();
+Attach(pNewData);
+}
+else
+{
+SetString(strSrc.GetString(), strSrc.GetLength());
+}
+}
+
+return *this;
+}
+
 CSimpleStringT& operator+=(_In_ const CSimpleStringT& strSrc)
 {
 Append(strSrc);
@@ -495,7 +517,7 @@
 if (pOldData->IsShared())
 {
 Fork(nLength);
-ATLASSERT(FALSE);
+//ATLASSERT(FALSE);
 }
 else if (pOldData->nAllocLength < nLength)
 {

Modified: trunk/reactos/sdk/lib/atl/atlstr.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/atl/atlstr.h?rev=72061=72060=72061=diff
==
--- trunk/reactos/sdk/lib/atl/atlstr.h  [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/atl/atlstr.h  [iso-8859-1] Sat Jul 30 19:07:43 2016
@@ -124,6 +124,12 @@
 
 
 typedef CStringT< wchar_t, StrTraitATL< wchar_t, ChTraitsCRT > > 
CAtlStringW;
+typedef CStringT< char, StrTraitATL< char, ChTraitsCRT > > CAtlStringA;
+
+
+typedef CAtlStringW CStringW;
+typedef CAtlStringA CStringA;
+
 
 }
 

Modified: trunk/reactos/sdk/lib/atl/cstringt.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/atl/cstringt.h?rev=72061=72060=72061=diff
==
--- trunk/reactos/sdk/lib/atl/cstringt.h[iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/atl/cstringt.h[iso-8859-1] Sat Jul 30 
19:07:43 2016
@@ -28,14 +28,28 @@
 
 static int __cdecl GetBaseTypeLength(_In_z_ LPCWSTR pszSource) throw()
 {
-return ::WideCharToMultiByte(_AtlGetConversionACP(), 0, pszSource, -1, 
NULL, 0, NULL, NULL) - 1;
+if (pszSource == NULL) return -1;
+return static_cast(wcslen(pszSource));
+}
+
+static int __cdecl GetBaseTypeLength(_In_z_ LPCSTR pszSource) throw()
+{
+if (pszSource == NULL) return 0;
+return ::MultiByteToWideChar(_AtlGetConversionACP(), 0, pszSource, -1, 
NULL, 0) - 1;
 }
 
 static int __cdecl GetBaseTypeLength(
 _In_reads_(nLength) LPCWSTR pszSource,
 _In_ int nLength) throw()
 {
-return ::WideCharToMultiByte(_AtlGetConversionACP(), 0, pszSource, 
nLength, NULL, 0, NULL, NULL);
+return nLength;
+}
+
+static int __cdecl GetBaseTypeLength(
+_In_reads_(nLength) LPCSTR pszSource,
+_In_ int nLength) throw()
+{
+return ::MultiByteToWideChar(_AtlGetConversionACP(), 0, pszSource, 
nLength, NULL, 0);
 }
 
 static void __cdecl ConvertToBaseType(
@@ -49,8 +63,197 @@
 
 wmemcpy(pszDest, pszSrc, nSrcLength);
 }
+
+static void __cdecl ConvertToBaseType(
+_Out_writes_(nDestLength) LPWSTR pszDest,
+_In_ int nDestLength,
+_In_ LPCSTR pszSrc,
+_In_ int nSrcLength = -1)
+{
+if (nSrcLength == -1)
+nSrcLength = 1 + GetBaseTypeLength(pszSrc);
+
+::MultiByteToWideChar(_AtlGetConversionACP(), 0, pszSrc, nSrcLength, 
pszDest, nDestLength);
+}
+
+static void __cdecl MakeLower(
+_Out_writes_(nSrcLength) LPWSTR pszSource,
+_In_ int nSrcLength)
+{
+::CharLowerBuffW(pszSource, nSrc

[ros-diffs] [mjansen] 72063: [BROWSEUI] Correct the 'Is this legal' url as suggested by Ken Rochard. Also rewrite the function to remove todo's, and make it localizable. CORE-11721 #resolve #comment T

2016-07-31 Thread mjansen
Author: mjansen
Date: Sun Jul 31 11:59:15 2016
New Revision: 72063

URL: http://svn.reactos.org/svn/reactos?rev=72063=rev
Log:
[BROWSEUI] Correct the 'Is this legal' url as suggested by Ken Rochard. Also 
rewrite the function to remove todo's, and make it localizable. CORE-11721 
#resolve #comment Thanks!

Modified:
trunk/reactos/dll/win32/browseui/lang/bg-BG.rc
trunk/reactos/dll/win32/browseui/lang/de-DE.rc
trunk/reactos/dll/win32/browseui/lang/en-US.rc
trunk/reactos/dll/win32/browseui/lang/es-ES.rc
trunk/reactos/dll/win32/browseui/lang/fr-FR.rc
trunk/reactos/dll/win32/browseui/lang/he-IL.rc
trunk/reactos/dll/win32/browseui/lang/it-IT.rc
trunk/reactos/dll/win32/browseui/lang/pl-PL.rc
trunk/reactos/dll/win32/browseui/lang/pt-BR.rc
trunk/reactos/dll/win32/browseui/lang/ro-RO.rc
trunk/reactos/dll/win32/browseui/lang/ru-RU.rc
trunk/reactos/dll/win32/browseui/lang/sq-AL.rc
trunk/reactos/dll/win32/browseui/lang/tr-TR.rc
trunk/reactos/dll/win32/browseui/lang/uk-UA.rc
trunk/reactos/dll/win32/browseui/lang/zh-CN.rc
trunk/reactos/dll/win32/browseui/lang/zh-TW.rc
trunk/reactos/dll/win32/browseui/resource.h
trunk/reactos/dll/win32/browseui/shellbrowser.cpp

Modified: trunk/reactos/dll/win32/browseui/lang/bg-BG.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/bg-BG.rc?rev=72063=72062=72063=diff
==
--- trunk/reactos/dll/win32/browseui/lang/bg-BG.rc  [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/lang/bg-BG.rc  [iso-8859-1] Sun Jul 31 
11:59:15 2016
@@ -273,3 +273,10 @@
 BEGIN
 IDS_STANDARD_TOOLBAR, "|Back|Forward|Up|Search|Folders|Move To|Copy 
To|Delete|Undo|Views|Stop|Refresh|Home|Map 
Drive|Disconnect|Favorites|History|Full Screen|Properties|Cut|Copy|Paste|Folder 
Options||"
 END
+
+STRINGTABLE
+BEGIN
+IDS_LEGAL_URL, "https://www.reactos.org/joining/faqs;
+IDS_SORRY_CAPTION, "Sorry"
+IDS_SORRY_MESSAGE, "ReactOS could not browse to '%s' (error 
0x%lx).\nPlease make sure there is a web browser installed."
+END

Modified: trunk/reactos/dll/win32/browseui/lang/de-DE.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/de-DE.rc?rev=72063=72062=72063=diff
==
--- trunk/reactos/dll/win32/browseui/lang/de-DE.rc  [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/lang/de-DE.rc  [iso-8859-1] Sun Jul 31 
11:59:15 2016
@@ -292,3 +292,10 @@
 BEGIN
 IDS_STANDARD_TOOLBAR, "|Zurück|Vorwärts|Übergeordneter 
Ordner|Suchen|Ordner|Verschieben nach|Kopieren 
nach|Löschen|Rückgängig|Ansicht|Stop|Aktualisieren|Startseite|Netzlaufwerk 
verbinden|Netzlaufwerk 
trennen|Favoriten|Verlauf|Vollbild|Eigenschaften|Ausschneiden|Kopieren|Einfügen|Ordneroptionen||"
 END
+
+STRINGTABLE
+BEGIN
+IDS_LEGAL_URL, "https://www.reactos.org/joining/faqs;
+IDS_SORRY_CAPTION, "Sorry"
+IDS_SORRY_MESSAGE, "ReactOS could not browse to '%s' (error 
0x%lx).\nPlease make sure there is a web browser installed."
+END

Modified: trunk/reactos/dll/win32/browseui/lang/en-US.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/en-US.rc?rev=72063=72062=72063=diff
==
--- trunk/reactos/dll/win32/browseui/lang/en-US.rc  [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/lang/en-US.rc  [iso-8859-1] Sun Jul 31 
11:59:15 2016
@@ -291,3 +291,10 @@
 BEGIN
 IDS_STANDARD_TOOLBAR, "|Back|Forward|Up|Search|Folders|Move To|Copy 
To|Delete|Undo|Views|Stop|Refresh|Home|Map 
Drive|Disconnect|Favorites|History|Full Screen|Properties|Cut|Copy|Paste|Folder 
Options||"
 END
+
+STRINGTABLE
+BEGIN
+IDS_LEGAL_URL, "https://www.reactos.org/joining/faqs;
+IDS_SORRY_CAPTION, "Sorry"
+IDS_SORRY_MESSAGE, "ReactOS could not browse to '%s' (error 
0x%lx).\nPlease make sure there is a web browser installed."
+END

Modified: trunk/reactos/dll/win32/browseui/lang/es-ES.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/es-ES.rc?rev=72063=72062=72063=diff
==
--- trunk/reactos/dll/win32/browseui/lang/es-ES.rc  [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/lang/es-ES.rc  [iso-8859-1] Sun Jul 31 
11:59:15 2016
@@ -275,3 +275,10 @@
 BEGIN
 IDS_STANDARD_TOOLBAR, "|Atrás|Adelante|Subir|Búsqueda|Carpetas|Mover 
a|Copiar a|Borrar|Deshacer|Vistas|Detener|Recargar|Inicio|Montar 
disco|Desconectar|Favoritos|Historial|Pantalla 
completa|Propiedades|Cortar|Copiar|Pegar|Opciones de carpeta||"
 END
+
+STRINGTABLE
+BEGIN
+IDS_LEGAL_URL, "https://www.reactos.org/joining

[ros-diffs] [mjansen] 72191: [ATL][ATL_APITEST] Partially implement CRegKey + add tests. CORE-11746

2016-08-10 Thread mjansen
Author: mjansen
Date: Wed Aug 10 19:34:38 2016
New Revision: 72191

URL: http://svn.reactos.org/svn/reactos?rev=72191=rev
Log:
[ATL][ATL_APITEST] Partially implement CRegKey + add tests. CORE-11746

Added:
trunk/rostests/apitests/atl/CRegKey.cpp   (with props)
Modified:
trunk/reactos/sdk/lib/atl/atlbase.cpp
trunk/reactos/sdk/lib/atl/atlbase.h
trunk/rostests/apitests/atl/CMakeLists.txt
trunk/rostests/apitests/atl/testlist.c

Modified: trunk/reactos/sdk/lib/atl/atlbase.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/atl/atlbase.cpp?rev=72191=72190=72191=diff
==
--- trunk/reactos/sdk/lib/atl/atlbase.cpp   [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/atl/atlbase.cpp   [iso-8859-1] Wed Aug 10 
19:34:38 2016
@@ -18,7 +18,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
  */
 
-#include 
 #include "atlbase.h"
 
 namespace ATL

Modified: trunk/reactos/sdk/lib/atl/atlbase.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/atl/atlbase.h?rev=72191=72190=72191=diff
==
--- trunk/reactos/sdk/lib/atl/atlbase.h [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/atl/atlbase.h [iso-8859-1] Wed Aug 10 19:34:38 2016
@@ -25,6 +25,7 @@
 #include "atlcomcli.h"
 #include "atlalloc.h"
 #include "comcat.h"
+#include "tchar.h"
 
 #ifdef _MSC_VER
 // It is common to use this in ATL constructors. They only store this for 
later use, so the usage is safe.
@@ -886,6 +887,218 @@
 }
 };
 
+class CRegKey
+{
+public:
+HKEY m_hKey;
+
+public:
+
+CRegKey() throw()
+: m_hKey(NULL)
+{
+}
+
+CRegKey(CRegKey& key) throw()
+{
+Attach(key.Detach());
+}
+
+explicit CRegKey(HKEY hKey) throw()
+:m_hKey(hKey)
+{
+}
+
+~CRegKey() throw()
+{
+}
+
+void Attach(HKEY hKey) throw()
+{
+m_hKey = hKey;
+}
+
+LONG Close() throw()
+{
+if (m_hKey)
+{
+HKEY hKey = Detach();
+return RegCloseKey(hKey);
+}
+return ERROR_SUCCESS;
+}
+
+HKEY Detach() throw()
+{
+HKEY hKey = m_hKey;
+m_hKey = NULL;
+return hKey;
+}
+
+LONG Open(HKEY hKeyParent, LPCTSTR lpszKeyName, REGSAM samDesired = 
KEY_READ | KEY_WRITE) throw()
+{
+HKEY hKey = NULL;
+
+LONG lRes = RegOpenKeyEx(hKeyParent, lpszKeyName, NULL, samDesired, 
);
+if (lRes == ERROR_SUCCESS)
+{
+Close();
+m_hKey = hKey;
+}
+return lRes;
+}
+
+LONG Create(HKEY hKeyParent, LPCTSTR lpszKeyName, LPTSTR lpszClass = 
REG_NONE, DWORD dwOptions = REG_OPTION_NON_VOLATILE, REGSAM samDesired = 
KEY_READ | KEY_WRITE, LPSECURITY_ATTRIBUTES lpSecAttr = NULL, LPDWORD 
lpdwDisposition = NULL) throw()
+{
+HKEY hKey = NULL;
+
+LONG lRes = RegCreateKeyEx(hKeyParent, lpszKeyName, NULL, lpszClass, 
dwOptions, samDesired, lpSecAttr, , lpdwDisposition);
+if (lRes == ERROR_SUCCESS)
+{
+Close();
+m_hKey = hKey;
+}
+return lRes;
+}
+
+
+LONG QueryValue(LPCTSTR pszValueName, DWORD* pdwType, void* pData, ULONG* 
pnBytes) throw()
+{
+return RegQueryValueEx(m_hKey, pszValueName, NULL, pdwType, 
(LPBYTE)pData, pnBytes);
+}
+
+LONG QueryDWORDValue(LPCTSTR pszValueName, DWORD& dwValue) throw()
+{
+ULONG size = sizeof(DWORD);
+DWORD type = 0;
+LONG lRet = QueryValue(pszValueName, , , );
+
+if (lRet == ERROR_SUCCESS && type != REG_DWORD)
+lRet = ERROR_INVALID_DATA;
+
+return lRet;
+}
+
+LONG QueryBinaryValue(LPCTSTR pszValueName, void* pValue, ULONG* pnBytes) 
throw()
+{
+DWORD type = 0;
+LONG lRet = QueryValue(pszValueName, , pValue, pnBytes);
+
+if (lRet == ERROR_SUCCESS && type != REG_BINARY)
+lRet = ERROR_INVALID_DATA;
+
+return lRet;
+}
+
+LONG QueryStringValue(LPCTSTR pszValueName, LPTSTR pszValue, ULONG* 
pnChars) throw()
+{
+ULONG size = (*pnChars) * sizeof(TCHAR);
+DWORD type = 0;
+LONG lRet = QueryValue(pszValueName, , pszValue, );
+
+if (lRet == ERROR_SUCCESS && type != REG_SZ)
+lRet = ERROR_INVALID_DATA;
+
+*pnChars = size / sizeof(TCHAR);
+return lRet;
+}
+
+LONG QueryGUIDValue(LPCTSTR pszValueName, GUID& guidValue) throw()
+{
+OLECHAR buf[40] = {0};
+ULONG nChars = 39;
+LONG lRet;
+
+#ifdef UNICODE
+lRet = QueryStringValue(pszValueName, buf, );
+#else
+CHAR bufA[40] = {0};
+lRet = QueryStringValue(pszValueName, bufA, );
+if (lRet != ERROR_SUCCESS)
+  

[ros-diffs] [mjansen] 72214: [CRT][CRT_APITEST] Fix __getmainargs and __wgetmainargs parsing, verified with apitests. Patch by Yaroslav Veremenko. CORE-11673 #resolve #comment Thanks!

2016-08-12 Thread mjansen
Author: mjansen
Date: Fri Aug 12 21:31:32 2016
New Revision: 72214

URL: http://svn.reactos.org/svn/reactos?rev=72214=rev
Log:
[CRT][CRT_APITEST] Fix __getmainargs and __wgetmainargs parsing, verified with 
apitests. Patch by Yaroslav Veremenko. CORE-11673 #resolve #comment Thanks!

Added:
trunk/rostests/apitests/crt/__getmainargs.c   (with props)
Modified:
trunk/reactos/sdk/lib/crt/misc/getargs.c
trunk/rostests/apitests/crt/msvcrt_crt_apitest.cmake
trunk/rostests/apitests/crt/testlist.c

Modified: trunk/reactos/sdk/lib/crt/misc/getargs.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/crt/misc/getargs.c?rev=72214=72213=72214=diff
==
--- trunk/reactos/sdk/lib/crt/misc/getargs.c[iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/crt/misc/getargs.c[iso-8859-1] Fri Aug 12 
21:31:32 2016
@@ -181,16 +181,18 @@
  */
 void __getmainargs(int* argc, char*** argv, char*** env, int expand_wildcards, 
int* new_mode)
 {
-   int i, afterlastspace, ignorespace, doexpand;
+   int i, doexpand, slashesAdded, escapedQuote, inQuotes, bufferIndex;
size_t len;
-   char* aNewCmdln;
+   char* buffer;
 
/* missing threading init */
 
i = 0;
-   afterlastspace = 0;
-   ignorespace = 0;
doexpand = expand_wildcards;
+   escapedQuote = FALSE;
+   slashesAdded = 0;
+   inQuotes = 0;
+   bufferIndex = 0;
 
if (__argv && _environ)
{
@@ -203,58 +205,94 @@
__argc = 0;
 
len = strlen(_acmdln);
-
-   /* Allocate a temporary buffer to be used instead of the original _acmdln 
parameter. */
-   aNewCmdln = strndup(_acmdln, len);
-
-   while (aNewCmdln[i])
-   {
-  if (aNewCmdln[i] == '"')
-  {
- if(ignorespace)
- {
-ignorespace = 0;
- }
- else
- {
-ignorespace = 1;
-doexpand = 0;
- }
- memmove(aNewCmdln + i, aNewCmdln + i + 1, len - i);
- len--;
- continue;
-  }
-
-  if (aNewCmdln[i] == ' ' && !ignorespace)
-  {
- aexpand(strndup(aNewCmdln + afterlastspace, i - afterlastspace), 
doexpand);
- i++;
- while (aNewCmdln[i] == ' ')
-i++;
- afterlastspace=i;
- doexpand = expand_wildcards;
-  }
-  else
-  {
- i++;
-  }
-   }
-
-   if (aNewCmdln[afterlastspace] != 0)
-   {
-  aexpand(strndup(aNewCmdln + afterlastspace, i - afterlastspace), 
doexpand);
+   buffer = malloc(sizeof(char) * len);
+
+   // Reference: 
https://msdn.microsoft.com/en-us/library/a1y7w461(v=vs.71).aspx
+   while (TRUE)
+   {
+  // Arguments are delimited by white space, which is either a space or a 
tab.
+  if (i >= len || ((_acmdln[i] == ' ' || _acmdln[i] == '\t') && !inQuotes))
+  {
+ aexpand(strndup(buffer, bufferIndex), doexpand);
+ // Copy the last element from buffer and quit the loop
+ if (i >= len)
+ {
+break;
+ }
+
+ while (_acmdln[i] == ' ' || _acmdln[i] == '\t')
+++i;
+ bufferIndex = 0;
+ slashesAdded = 0;
+ escapedQuote = FALSE;
+ continue;
+  }
+
+  if (_acmdln[i] == '\\')
+  {
+ buffer[bufferIndex++] = _acmdln[i];
+ ++slashesAdded;
+ ++i;
+ escapedQuote = FALSE;
+ continue;
+  }
+
+  if (_acmdln[i] == '\"')
+  {
+ if (slashesAdded > 0)
+ {
+if (slashesAdded % 2 == 0)
+{
+   // If an even number of backslashes is followed by a double 
quotation mark, then one backslash (\)
+   // is placed in the argv array for every pair of backslashes 
(\\), and the double quotation mark (")
+   // is interpreted as a string delimiter.
+   bufferIndex -= slashesAdded / 2;
+}
+else
+{
+   // If an odd number of backslashes is followed by a double 
quotation mark, then one backslash (\)
+   // is placed in the argv array for every pair of backslashes 
(\\) and the double quotation mark is
+   // interpreted as an escape sequence by the remaining 
backslash, causing a literal double quotation mark (")
+   // to be placed in argv.
+   bufferIndex -= slashesAdded / 2 + 1;
+   buffer[bufferIndex++] = '\"';
+   slashesAdded = 0;
+   escapedQuote = TRUE;
+   ++i;
+   continue;
+}
+slashesAdded = 0;
+ }
+ else if (!inQuotes && i > 0 && _acmdln[i - 1] == '\"' && 
!escapedQuote)
+ {
+buffer[bufferIndex++] = '\"';
+++i;
+escapedQuote = TRUE;
+continue;
+ }
+ slashesAdded = 0;
+ escapedQuote = FALSE;
+   

[ros-diffs] [mjansen] 71931: [APPHELP] Dereference after null check (default_dir). CID 1363509

2016-07-13 Thread mjansen
Author: mjansen
Date: Wed Jul 13 18:02:16 2016
New Revision: 71931

URL: http://svn.reactos.org/svn/reactos?rev=71931=rev
Log:
[APPHELP] Dereference after null check (default_dir). CID 1363509

Modified:
trunk/reactos/dll/appcompat/apphelp/sdbapi.c

Modified: trunk/reactos/dll/appcompat/apphelp/sdbapi.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdbapi.c?rev=71931=71930=71931=diff
==
--- trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] Wed Jul 13 
18:02:16 2016
@@ -472,30 +472,35 @@
 static WCHAR* default_dir = NULL;
 static CONST WCHAR szAppPatch[] = {'\\','A','p','p','P','a','t','c','h',0};
 
-if(!default_dir)
+/* In case function fails, path holds empty string */
+if (size > 0)
+*path = 0;
+
+if (!default_dir)
 {
 WCHAR* tmp = NULL;
 UINT len = GetSystemWindowsDirectoryW(NULL, 0) + lstrlenW(szAppPatch);
 tmp = SdbAlloc((len + 1)* sizeof(WCHAR));
-if(tmp)
+if (tmp)
 {
 UINT r = GetSystemWindowsDirectoryW(tmp, len+1);
 if (r && r < len)
 {
 if (SUCCEEDED(StringCchCatW(tmp, len+1, szAppPatch)))
 {
-if(InterlockedCompareExchangePointer((void**)_dir, 
tmp, NULL) == NULL)
+if 
(InterlockedCompareExchangePointer((void**)_dir, tmp, NULL) == NULL)
 tmp = NULL;
 }
 }
 if (tmp)
 SdbFree(tmp);
 }
-}
-
-/* In case function fails, path holds empty string */
-if (size > 0)
-*path = 0;
+if (!default_dir)
+{
+SHIM_ERR("Unable to obtain default AppPatch directory\n");
+return FALSE;
+}
+}
 
 if (!db)
 {




[ros-diffs] [mjansen] 71932: [ACLAYER] Use the return of StringCbPrintfW instead of ignoring it. CID 1363460-63, 65-70, 76, 78, 85, 88, 90

2016-07-13 Thread mjansen
Author: mjansen
Date: Wed Jul 13 18:10:37 2016
New Revision: 71932

URL: http://svn.reactos.org/svn/reactos?rev=71932=rev
Log:
[ACLAYER] Use the return of StringCbPrintfW instead of ignoring it. CID 
1363460-63, 65-70, 76, 78, 85, 88, 90

Modified:
trunk/reactos/dll/appcompat/shims/layer/versionlie.inl

Modified: trunk/reactos/dll/appcompat/shims/layer/versionlie.inl
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/shims/layer/versionlie.inl?rev=71932=71931=71932=diff
==
--- trunk/reactos/dll/appcompat/shims/layer/versionlie.inl  [iso-8859-1] 
(original)
+++ trunk/reactos/dll/appcompat/shims/layer/versionlie.inl  [iso-8859-1] 
Wed Jul 13 18:10:37 2016
@@ -52,7 +52,7 @@
 "Service Pack %u", VERSION_INFO.wServicePackMajor);
 if (FAILED(hr))
 return FALSE;
-StringCbPrintfW(VERSION_INFO.szCSDVersionW, 
sizeof(VERSION_INFO.szCSDVersionW),
+hr = StringCbPrintfW(VERSION_INFO.szCSDVersionW, 
sizeof(VERSION_INFO.szCSDVersionW),
 szServicePack, VERSION_INFO.wServicePackMajor);
 if (FAILED(hr))
 return FALSE;




[ros-diffs] [mjansen] 71933: [RAPPS_NEW] Use the actual buffer size instead of hardcoding a random number. CID 1363551

2016-07-13 Thread mjansen
Author: mjansen
Date: Wed Jul 13 18:33:42 2016
New Revision: 71933

URL: http://svn.reactos.org/svn/reactos?rev=71933=rev
Log:
[RAPPS_NEW] Use the actual buffer size instead of hardcoding a random number. 
CID 1363551

Modified:
trunk/reactos/base/applications/rapps_new/available.cpp

Modified: trunk/reactos/base/applications/rapps_new/available.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps_new/available.cpp?rev=71933=71932=71933=diff
==
--- trunk/reactos/base/applications/rapps_new/available.cpp [iso-8859-1] 
(original)
+++ trunk/reactos/base/applications/rapps_new/available.cpp [iso-8859-1] 
Wed Jul 13 18:33:42 2016
@@ -18,11 +18,11 @@
 } \
 
 #define GET_STRING1(a, b)  \
-if (!ParserGetString(a, b, MAX_PATH, FindFileData.cFileName)) \
+if (!ParserGetString(a, b, _countof(b), FindFileData.cFileName)) \
 continue;
 
 #define GET_STRING2(a, b)  \
-if (!ParserGetString(a, b, MAX_PATH, FindFileData.cFileName)) \
+if (!ParserGetString(a, b, _countof(b), FindFileData.cFileName)) \
 b[0] = '\0';
 
 LIST_ENTRY CachedEntriesHead = { ,  };




[ros-diffs] [mjansen] 71934: [ACPPAGE] Remove unused var. CID 1363705

2016-07-13 Thread mjansen
Author: mjansen
Date: Wed Jul 13 18:44:51 2016
New Revision: 71934

URL: http://svn.reactos.org/svn/reactos?rev=71934=rev
Log:
[ACPPAGE] Remove unused var. CID 1363705

Modified:
trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.hpp

Modified: trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.hpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.hpp?rev=71934=71933=71934=diff
==
--- trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.hpp [iso-8859-1] 
(original)
+++ trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.hpp [iso-8859-1] 
Wed Jul 13 18:44:51 2016
@@ -53,7 +53,6 @@
 
 protected:
 CComBSTR m_Filename;
-HWND m_Wnd;
 BOOL m_IsSfcProtected;
 BOOL m_AllowPermLayer;
 DWORD m_LayerQueryFlags;




[ros-diffs] [mjansen] 71956: [EXPLORER] Fix the Explore all users/open all users menu items. Patch by Jared Smudde. CORE-11146 #resolve #comment Thanks!

2016-07-16 Thread mjansen
Author: mjansen
Date: Sat Jul 16 17:49:27 2016
New Revision: 71956

URL: http://svn.reactos.org/svn/reactos?rev=71956=rev
Log:
[EXPLORER] Fix the Explore all users/open all users menu items. Patch by Jared 
Smudde. CORE-11146 #resolve #comment Thanks!

Modified:
trunk/reactos/base/shell/explorer/traywnd.cpp

Modified: trunk/reactos/base/shell/explorer/traywnd.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/traywnd.cpp?rev=71956=71955=71956=diff
==
--- trunk/reactos/base/shell/explorer/traywnd.cpp   [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/traywnd.cpp   [iso-8859-1] Sat Jul 16 
17:49:27 2016
@@ -1704,9 +1704,9 @@
 {
 ShellExecute(hWndOwner,
  lpOperation,
+ szDir,
  NULL,
  NULL,
- szDir,
  SW_SHOWNORMAL);
 }
 }




[ros-diffs] [mjansen] 71896: [TRANSLATION] Russian translations by Nikolay Burshtyn (amber). CORE-11567 #resolve #comment Thanks!

2016-07-11 Thread mjansen
Author: mjansen
Date: Mon Jul 11 19:02:48 2016
New Revision: 71896

URL: http://svn.reactos.org/svn/reactos?rev=71896=rev
Log:
[TRANSLATION] Russian translations by Nikolay Burshtyn (amber). CORE-11567 
#resolve #comment Thanks!

Modified:
trunk/reactos/media/rapps/7zip.txt
trunk/reactos/media/rapps/CONTRIBUTORS
trunk/reactos/media/rapps/abiword.txt
trunk/reactos/media/rapps/abiword26.txt
trunk/reactos/media/rapps/abyss.txt
trunk/reactos/media/rapps/ac97forvirtualbox.txt
trunk/reactos/media/rapps/agatemulator.txt
trunk/reactos/media/rapps/air.txt
trunk/reactos/media/rapps/akelpad.txt
trunk/reactos/media/rapps/alreader.txt
trunk/reactos/media/rapps/audacity.txt
trunk/reactos/media/rapps/audiograbber.txt
trunk/reactos/media/rapps/bittorrent.txt
trunk/reactos/media/rapps/bochs.txt
trunk/reactos/media/rapps/boswars.txt
trunk/reactos/media/rapps/boundaround.txt
trunk/reactos/media/rapps/burnawarefree.txt
trunk/reactos/media/rapps/ccleaner.txt
trunk/reactos/media/rapps/christmasbound.txt
trunk/reactos/media/rapps/chromium.txt
trunk/reactos/media/rapps/cnt.txt
trunk/reactos/media/rapps/codeblocks.txt
trunk/reactos/media/rapps/codeblocks_gcc.txt
trunk/reactos/media/rapps/comctl32ocx.txt
trunk/reactos/media/rapps/cstalin.txt
trunk/reactos/media/rapps/devcpp_tdm_gcc_x64.txt
trunk/reactos/media/rapps/diablo2.txt
trunk/reactos/media/rapps/dilinuxreader.txt
trunk/reactos/media/rapps/dosblaster.txt
trunk/reactos/media/rapps/dosbox.txt
trunk/reactos/media/rapps/doublecommander.txt
trunk/reactos/media/rapps/dplus.txt
trunk/reactos/media/rapps/dvdwritenow.txt
trunk/reactos/media/rapps/efsearch.txt
trunk/reactos/media/rapps/everythingse.txt
trunk/reactos/media/rapps/excelview.txt
trunk/reactos/media/rapps/fall.txt
trunk/reactos/media/rapps/famitracker.txt
trunk/reactos/media/rapps/fap.txt
trunk/reactos/media/rapps/farmanager.txt
trunk/reactos/media/rapps/fira.txt
trunk/reactos/media/rapps/firefox.txt
trunk/reactos/media/rapps/firefox28.txt
trunk/reactos/media/rapps/firefox36.txt
trunk/reactos/media/rapps/foxit.txt
trunk/reactos/media/rapps/freebasic.txt
trunk/reactos/media/rapps/freemat.txt
trunk/reactos/media/rapps/freestopwatch.txt
trunk/reactos/media/rapps/gensemulator.txt
trunk/reactos/media/rapps/ghostscript.txt
trunk/reactos/media/rapps/ghostview.txt
trunk/reactos/media/rapps/gimp.txt
trunk/reactos/media/rapps/glidewrapzbag.txt
trunk/reactos/media/rapps/globulation2.txt
trunk/reactos/media/rapps/gnucash.txt
trunk/reactos/media/rapps/hexedit.txt
trunk/reactos/media/rapps/hiawatha.txt
trunk/reactos/media/rapps/hover.txt
trunk/reactos/media/rapps/hxd.txt
trunk/reactos/media/rapps/indiftpd.txt
trunk/reactos/media/rapps/inkscape.txt
trunk/reactos/media/rapps/irfanview.txt
trunk/reactos/media/rapps/irfanviewplugins.txt
trunk/reactos/media/rapps/jre.txt
trunk/reactos/media/rapps/kdewin.txt
trunk/reactos/media/rapps/kindlepc.txt
trunk/reactos/media/rapps/kmeleon.txt
trunk/reactos/media/rapps/kompozer.txt
trunk/reactos/media/rapps/kyodai.txt
trunk/reactos/media/rapps/lazaruside.txt
trunk/reactos/media/rapps/lbreakout2.txt
trunk/reactos/media/rapps/lgeneral.txt
trunk/reactos/media/rapps/librecad.txt
trunk/reactos/media/rapps/libreoffice.txt
trunk/reactos/media/rapps/libreofficehelp.txt
trunk/reactos/media/rapps/libreofficestill.txt
trunk/reactos/media/rapps/lmarbles.txt
trunk/reactos/media/rapps/mcwin32.txt
trunk/reactos/media/rapps/md5summer.txt
trunk/reactos/media/rapps/mfc40.txt
trunk/reactos/media/rapps/miktex.txt
trunk/reactos/media/rapps/mirandaim.txt
trunk/reactos/media/rapps/mirc.txt
trunk/reactos/media/rapps/mirc6.txt
trunk/reactos/media/rapps/mkvtoolnix.txt
trunk/reactos/media/rapps/mono2.txt
trunk/reactos/media/rapps/mpc.txt
trunk/reactos/media/rapps/mpxplay.txt
trunk/reactos/media/rapps/msxml3.txt
trunk/reactos/media/rapps/msxml6.txt
trunk/reactos/media/rapps/net11.txt
trunk/reactos/media/rapps/net20.txt
trunk/reactos/media/rapps/net20sp2.txt
trunk/reactos/media/rapps/neverball.txt
trunk/reactos/media/rapps/nginx.txt
trunk/reactos/media/rapps/nirlauncher.txt
trunk/reactos/media/rapps/npp.txt
trunk/reactos/media/rapps/nvdisp.txt
trunk/reactos/media/rapps/officeformatpack.txt
trunk/reactos/media/rapps/openarena.txt
trunk/reactos/media/rapps/opencodecs.txt
trunk/reactos/media/rapps/openoffice.txt
trunk/reactos/media/rapps/openttd.txt
trunk/reactos/media/rapps/opera.txt
trunk/reactos/media/rapps/opera9.txt
trunk/reactos/media/rapps/pdfsam.txt
trunk/reactos/media/rapps/peazip.txt
trunk/reactos/media/rapps/pengupop.txt
trunk/reactos/media/rapps/photofiltre.txt
trunk/reactos/media/rapps

[ros-diffs] [mjansen] 71949: [EXPLORER] HACK: ignore unimplemented SetBandSiteInfo. Patch by Wim Hueskes. CORE-9809 #resolve #comment Thanks!

2016-07-15 Thread mjansen
Author: mjansen
Date: Fri Jul 15 23:33:53 2016
New Revision: 71949

URL: http://svn.reactos.org/svn/reactos?rev=71949=rev
Log:
[EXPLORER] HACK: ignore unimplemented SetBandSiteInfo. Patch by Wim Hueskes. 
CORE-9809 #resolve #comment Thanks!

Modified:
trunk/reactos/base/shell/explorer/tbsite.cpp

Modified: trunk/reactos/base/shell/explorer/tbsite.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/tbsite.cpp?rev=71949=71948=71949=diff
==
--- trunk/reactos/base/shell/explorer/tbsite.cpp[iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/tbsite.cpp[iso-8859-1] Fri Jul 15 
23:33:53 2016
@@ -334,6 +334,13 @@
 bsi.dwStyle = (Locked ? BSIS_LOCKED | BSIS_NOGRIPPER : 
BSIS_AUTOGRIPPER);
 
 hRet = m_BandSite->SetBandSiteInfo();
+
+/* HACK for CORE-9809 ! */
+if (hRet == E_NOTIMPL)
+hRet = S_OK;
+else
+ERR("HACK for CORE-9809 no longer needed!\n");
+
 if (SUCCEEDED(hRet))
 {
 hRet = Update();




[ros-diffs] [mjansen] 71834: [SHELL32] Disable Paste menu items when no items are in the clipboard. Patch by Jared Smudde. CORE-11492 #resolve #comment Thanks!

2016-07-06 Thread mjansen
Author: mjansen
Date: Wed Jul  6 19:30:59 2016
New Revision: 71834

URL: http://svn.reactos.org/svn/reactos?rev=71834=rev
Log:
[SHELL32] Disable Paste menu items when no items are in the clipboard. Patch by 
Jared Smudde. CORE-11492 #resolve #comment Thanks!

Modified:
trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp

Modified: trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp?rev=71834=71833=71834=diff
==
--- trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp [iso-8859-1] 
(original)
+++ trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp [iso-8859-1] 
Wed Jul  6 19:30:59 2016
@@ -366,8 +366,8 @@
 mii.fMask = MIIM_STATE;
 mii.fState = MFS_DISABLED;
 
-TRACE("result %d\n", SetMenuItemInfoW(hMenu, FCIDM_SHVIEW_INSERT, FALSE, 
));
-TRACE("result %d\n", SetMenuItemInfoW(hMenu, FCIDM_SHVIEW_INSERTLINK, 
FALSE, ));
+SetMenuItemInfoW(hMenu, FCIDM_SHVIEW_INSERT, FALSE, );
+SetMenuItemInfoW(hMenu, FCIDM_SHVIEW_INSERTLINK, FALSE, );
 }
 
 BOOL




[ros-diffs] [mjansen] 71881: [RAPPS] Fix some translated / misspelled tags.

2016-07-09 Thread mjansen
Author: mjansen
Date: Sun Jul 10 00:18:20 2016
New Revision: 71881

URL: http://svn.reactos.org/svn/reactos?rev=71881=rev
Log:
[RAPPS] Fix some translated / misspelled tags.

Modified:
trunk/reactos/media/rapps/ac97forvirtualbox.txt
trunk/reactos/media/rapps/cstalin.txt
trunk/reactos/media/rapps/efsearch.txt
trunk/reactos/media/rapps/mkvtoolnix.txt
trunk/reactos/media/rapps/nirlauncher.txt
trunk/reactos/media/rapps/pptview.txt
trunk/reactos/media/rapps/scratch.txt
trunk/reactos/media/rapps/tahoma.txt
trunk/reactos/media/rapps/windirstat.txt

Modified: trunk/reactos/media/rapps/ac97forvirtualbox.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/media/rapps/ac97forvirtualbox.txt?rev=71881=71880=71881=diff
==
--- trunk/reactos/media/rapps/ac97forvirtualbox.txt [iso-8859-1] (original)
+++ trunk/reactos/media/rapps/ac97forvirtualbox.txt [iso-8859-1] Sun Jul 10 
00:18:20 2016
@@ -11,7 +11,7 @@
 
 [Section.0405]
 Name = Ovladač AC97 pro VirtualBox
-Licence = Neznámá
+License = Neznámá
 Description = Rozbalte do složky "ReactOS" a pak ReactOS dvakrát restartujte.
 
 [Section.0407]
@@ -28,7 +28,7 @@
 [Section.0410]
 Name = Driver AC97 per VirtualBox
 License = Sconosciuta
-Descrizione = Estrarre nella cartella "ReactOS" e poi riavviare ReactOS due 
volte.
+Description = Estrarre nella cartella "ReactOS" e poi riavviare ReactOS due 
volte.
 
 [Section.040c]
 Name = Pilote AC97 pour VirtualBox
@@ -43,18 +43,18 @@
 
 [Section.0415]
 Name = Sterownik AC97 dla VirtualBox
-Licence = Nieznana
+License = Nieznana
 Description = Rozpakuj zawartość w folderze "ReactOS" i dwukrotnie 
zrestartuj system.
 
 [Section.0418]
 Name = Modul pilot AC97 pentru VirtualBox
-Licence = Nespecificată
+License = Nespecificată
 Description = Dezarhivați în dosarul ReactOS apoi reporniți ReactOS de 
două ori.
 Size = 185,5 Kio
 
 [Section.0419]
 Name = Драйвер AC97 для VirtualBox
-Licence = Не указано
+License = Не указано
 Description = Pазархивируйте содержимое в папку 
"ReactOS", затем дважды перезагрузите систему.
 
 [Section.041f]
@@ -65,7 +65,7 @@
 
 [Section.0422]
 Name = Драйвер AC97 для VirtualBox
-Licence = Невідома
+License = Невідома
 Description = Pозархівуйте вміст в теку "ReactOS" 
після чого двічі перезавантажте систему.
 
 [Section.0804]

Modified: trunk/reactos/media/rapps/cstalin.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/media/rapps/cstalin.txt?rev=71881=71880=71881=diff
==
--- trunk/reactos/media/rapps/cstalin.txt   [iso-8859-1] (original)
+++ trunk/reactos/media/rapps/cstalin.txt   [iso-8859-1] Sun Jul 10 
00:18:20 2016
@@ -1,7 +1,7 @@
 [Section]
 Name = Commander Stalin
 Version = 0.9.5
-Licence = GPL
+License = GPL
 Description = A Soviet-themed real time strategy game (RTS) based on Boswars. 
You will need a tool like 7-Zip to extract it.
 Size = 261.0 MiB
 Category = 4

Modified: trunk/reactos/media/rapps/efsearch.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/media/rapps/efsearch.txt?rev=71881=71880=71881=diff
==
--- trunk/reactos/media/rapps/efsearch.txt  [iso-8859-1] (original)
+++ trunk/reactos/media/rapps/efsearch.txt  [iso-8859-1] Sun Jul 10 
00:18:20 2016
@@ -1,7 +1,7 @@
 [Section]
 Name = Effective File search
 Version = 6.8.1
-Licence = Freeware
+License = Freeware
 Description = File search utility compatible with ReactOS.
 Size = 944.4 KiB
 Category = 12
@@ -18,13 +18,13 @@
 Size = 944,4 KiB
 
 [Section.0418]
-Licence = Gratuită
+License = Gratuită
 Description = Program de căutare a fișierelor, compatibil cu ReactOS.
 Size = 944,4 Kio
 
 [Section.041f]
 Name = Etkili Kütük Arama
-Licence = Ücretsiz
+License = Ücretsiz
 Description = ReactOS'la uyumlu kütük arama aracı.
 Size = 944,4 KiB
 

Modified: trunk/reactos/media/rapps/mkvtoolnix.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/media/rapps/mkvtoolnix.txt?rev=71881=71880=71881=diff
==
--- trunk/reactos/media/rapps/mkvtoolnix.txt[iso-8859-1] (original)
+++ trunk/reactos/media/rapps/mkvtoolnix.txt[iso-8859-1] Sun Jul 10 
00:18:20 2016
@@ -1,7 +1,7 @@
 [Section]
 Name = MkvToolnix
 Version = 3.1.0
-Licence = GPL
+License = GPL
 Description = Set of tools for working with files mkv format.
 Size = 5.3 MiB
 Category = 2

Modified: trunk/reactos/media/rapps/nirlauncher.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/re

[ros-diffs] [mjansen] 71882: [WIN32SS] Do not try to call DevModes when it is NULL (mirror drivers). Patch by Victor Matovykh. CORE-11441 #resolve #comment Thanks!

2016-07-10 Thread mjansen
Author: mjansen
Date: Sun Jul 10 14:23:58 2016
New Revision: 71882

URL: http://svn.reactos.org/svn/reactos?rev=71882=rev
Log:
[WIN32SS] Do not try to call DevModes when it is NULL (mirror drivers). Patch 
by Victor Matovykh. CORE-11441 #resolve #comment Thanks!

Modified:
trunk/reactos/win32ss/gdi/eng/ldevobj.c

Modified: trunk/reactos/win32ss/gdi/eng/ldevobj.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/ldevobj.c?rev=71882=71881=71882=diff
==
--- trunk/reactos/win32ss/gdi/eng/ldevobj.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/eng/ldevobj.c [iso-8859-1] Sun Jul 10 
14:23:58 2016
@@ -122,6 +122,12 @@
 
 TRACE("LDEVOBJ_pdmiGetModes(%p, %p)\n", pldev, hDriver);
 
+/* Mirror drivers may omit this function */
+if (!pldev->pfn.GetModes)
+{
+return NULL;
+}
+
 /* Call the driver to get the required size */
 cbSize = pldev->pfn.GetModes(hDriver, 0, NULL);
 if (!cbSize)




[ros-diffs] [mjansen] 71886: [SDK][XML2SDB] Introducing the xml2sdb host tool, used to convert xml files to appcompat Sdb files. CORE-11302 Uses tinyxml2 to parse the xml. Thanks to Thomas for reviewi

2016-07-10 Thread mjansen
Author: mjansen
Date: Sun Jul 10 16:14:39 2016
New Revision: 71886

URL: http://svn.reactos.org/svn/reactos?rev=71886=rev
Log:
[SDK][XML2SDB] Introducing the xml2sdb host tool, used to convert xml files to 
appcompat Sdb files. CORE-11302
Uses tinyxml2 to parse the xml.
Thanks to Thomas for reviewing / suggesting fixes!

Added:
trunk/reactos/sdk/tools/xml2sdb/
trunk/reactos/sdk/tools/xml2sdb/CMakeLists.txt   (with props)
trunk/reactos/sdk/tools/xml2sdb/main.cpp   (with props)
trunk/reactos/sdk/tools/xml2sdb/tinyxml2.cpp   (with props)
trunk/reactos/sdk/tools/xml2sdb/tinyxml2.h   (with props)
trunk/reactos/sdk/tools/xml2sdb/xml2sdb.cpp   (with props)
trunk/reactos/sdk/tools/xml2sdb/xml2sdb.h   (with props)
Modified:
trunk/reactos/CMakeLists.txt
trunk/reactos/sdk/cmake/host-tools.cmake
trunk/reactos/sdk/tools/CMakeLists.txt

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

Modified: trunk/reactos/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/CMakeLists.txt?rev=71886=71885=71886=diff

Modified: trunk/reactos/sdk/cmake/host-tools.cmake
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/cmake/host-tools.cmake?rev=71886=71885=71886=diff

Modified: trunk/reactos/sdk/tools/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/tools/CMakeLists.txt?rev=71886=71885=71886=diff

Added: trunk/reactos/sdk/tools/xml2sdb/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/tools/xml2sdb/CMakeLists.txt?rev=71886

Added: trunk/reactos/sdk/tools/xml2sdb/main.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/tools/xml2sdb/main.cpp?rev=71886

Added: trunk/reactos/sdk/tools/xml2sdb/tinyxml2.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/tools/xml2sdb/tinyxml2.cpp?rev=71886

Added: trunk/reactos/sdk/tools/xml2sdb/tinyxml2.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/tools/xml2sdb/tinyxml2.h?rev=71886

Added: trunk/reactos/sdk/tools/xml2sdb/xml2sdb.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/tools/xml2sdb/xml2sdb.cpp?rev=71886

Added: trunk/reactos/sdk/tools/xml2sdb/xml2sdb.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/tools/xml2sdb/xml2sdb.h?rev=71886




[ros-diffs] [mjansen] 71885: [APPHELP] Prepare sdbwrite related api for a new hosttool. CORE-11302 - Adding an extra argument to SdbReAlloc - Do not rely on platform wcs* functions.

2016-07-10 Thread mjansen
Author: mjansen
Date: Sun Jul 10 16:06:39 2016
New Revision: 71885

URL: http://svn.reactos.org/svn/reactos?rev=71885=rev
Log:
[APPHELP] Prepare sdbwrite related api for a new hosttool. CORE-11302
- Adding an extra argument to SdbReAlloc
- Do not rely on platform wcs* functions.

Added:
trunk/reactos/dll/appcompat/apphelp/sdbwrite.h   (with props)
Modified:
trunk/reactos/dll/appcompat/apphelp/apphelp.c
trunk/reactos/dll/appcompat/apphelp/sdbapi.c
trunk/reactos/dll/appcompat/apphelp/sdbpapi.h
trunk/reactos/dll/appcompat/apphelp/sdbstringtable.c
trunk/reactos/dll/appcompat/apphelp/sdbwrite.c

Modified: trunk/reactos/dll/appcompat/apphelp/apphelp.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/apphelp.c?rev=71885=71884=71885=diff
==
--- trunk/reactos/dll/appcompat/apphelp/apphelp.c   [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/apphelp.c   [iso-8859-1] Sun Jul 10 
16:06:39 2016
@@ -102,7 +102,8 @@
 {
 char Buffer[512];
 va_list ArgList;
-char* Current = Buffer, *LevelStr;
+char* Current = Buffer;
+const char* LevelStr;
 size_t Length = sizeof(Buffer);
 
 if (g_ShimDebugLevel == 0x)

Modified: trunk/reactos/dll/appcompat/apphelp/sdbapi.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdbapi.c?rev=71885=71884=71885=diff
==
--- trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/sdbapi.c[iso-8859-1] Sun Jul 10 
16:06:39 2016
@@ -178,7 +178,7 @@
 return mem;
 }
 
-LPVOID SdbpReAlloc(LPVOID mem, SIZE_T size
+LPVOID SdbpReAlloc(LPVOID mem, SIZE_T size, SIZE_T oldSize
 #if SDBAPI_DEBUG_ALLOC
 , int line, const char* file
 #endif

Modified: trunk/reactos/dll/appcompat/apphelp/sdbpapi.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdbpapi.h?rev=71885=71884=71885=diff
==
--- trunk/reactos/dll/appcompat/apphelp/sdbpapi.h   [iso-8859-1] (original)
+++ trunk/reactos/dll/appcompat/apphelp/sdbpapi.h   [iso-8859-1] Sun Jul 10 
16:06:39 2016
@@ -30,21 +30,21 @@
 #if SDBAPI_DEBUG_ALLOC
 
 LPVOID SdbpAlloc(SIZE_T size, int line, const char* file);
-LPVOID SdbpReAlloc(LPVOID mem, SIZE_T size, int line, const char* file);
+LPVOID SdbpReAlloc(LPVOID mem, SIZE_T size, SIZE_T oldSize, int line, const 
char* file);
 void SdbpFree(LPVOID mem, int line, const char* file);
 
 #define SdbAlloc(size) SdbpAlloc(size, __LINE__, __FILE__)
-#define SdbReAlloc(mem, size) SdbpReAlloc(mem, size, __LINE__, __FILE__)
+#define SdbReAlloc(mem, size, oldSize) SdbpReAlloc(mem, size, oldSize, 
__LINE__, __FILE__)
 #define SdbFree(mem) SdbpFree(mem, __LINE__, __FILE__)
 
 #else
 
 LPVOID SdbpAlloc(SIZE_T size);
-LPVOID SdbpReAlloc(LPVOID mem, SIZE_T size);
+LPVOID SdbpReAlloc(LPVOID mem, SIZE_T size, SIZE_T oldSize);
 void SdbpFree(LPVOID mem);
 
 #define SdbAlloc(size) SdbpAlloc(size)
-#define SdbReAlloc(mem, size) SdbpReAlloc(mem, size)
+#define SdbReAlloc(mem, size, oldSize) SdbpReAlloc(mem, size, oldSize)
 #define SdbFree(mem) SdbpFree(mem)
 
 #endif
@@ -71,6 +71,9 @@
 BOOL WINAPI SdbpCheckTagType(TAG tag, WORD type);
 BOOL WINAPI SdbpCheckTagIDType(PDB db, TAGID tagid, WORD type);
 
+#ifndef WINAPIV
+#define WINAPIV
+#endif
 
 typedef enum _SHIM_LOG_LEVEL {
 SHIM_ERR = 1,

Modified: trunk/reactos/dll/appcompat/apphelp/sdbstringtable.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdbstringtable.c?rev=71885=71884=71885=diff
==
--- trunk/reactos/dll/appcompat/apphelp/sdbstringtable.c[iso-8859-1] 
(original)
+++ trunk/reactos/dll/appcompat/apphelp/sdbstringtable.c[iso-8859-1] 
Sun Jul 10 16:06:39 2016
@@ -23,11 +23,20 @@
 #include "sdbpapi.h"
 #else /* !defined(SDBWRITE_HOSTTOOL) */
 #include 
+#include 
 #include "sdbtypes.h"
 #include "sdbpapi.h"
 #endif /* !defined(SDBWRITE_HOSTTOOL) */
 
 #include "sdbstringtable.h"
+
+#if !defined(offsetof)
+#if defined(__GNUC__)
+#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
+#else
+#define offsetof(TYPE, MEMBER) ((size_t)&(((TYPE *)0)->MEMBER))
+#endif
+#endif // !defined(offsetof)
 
 #define DEFAULT_TABLE_SIZE0x100
 
@@ -98,13 +107,48 @@
 return hash;
 }
 
+int Sdbwcscmp(const WCHAR* s1, const WCHAR* s2)
+{
+while (*s1 == *s2)
+{
+if (*s1 == 0)
+return 0;
+s1++;
+s2++;
+}
+return *s1 - *s2;
+}
+
+
+// implementation taken from reactos/sdk/lib/crt/string/wcs.c
+INT Sdbwcscpy(WCHAR* wcDest, size_t numElement, const WCHAR *wcSrc)
+{
+size_t size = 0;
+if(!wcDest

[ros-diffs] [mjansen] 71887: [SDK] Add the first appcompat database, containing references to version lie shims. CORE-11302 #resolve

2016-07-10 Thread mjansen
Author: mjansen
Date: Sun Jul 10 16:21:53 2016
New Revision: 71887

URL: http://svn.reactos.org/svn/reactos?rev=71887=rev
Log:
[SDK] Add the first appcompat database, containing references to version lie 
shims. CORE-11302 #resolve

Added:
trunk/reactos/media/sdb/
trunk/reactos/media/sdb/CMakeLists.txt   (with props)
trunk/reactos/media/sdb/sysmain.xml   (with props)
Modified:
trunk/reactos/media/CMakeLists.txt

Modified: trunk/reactos/media/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/media/CMakeLists.txt?rev=71887=71886=71887=diff
==
--- trunk/reactos/media/CMakeLists.txt  [iso-8859-1] (original)
+++ trunk/reactos/media/CMakeLists.txt  [iso-8859-1] Sun Jul 10 16:21:53 2016
@@ -2,6 +2,7 @@
 add_subdirectory(fonts)
 add_subdirectory(inf)
 add_subdirectory(nls)
+add_subdirectory(sdb)
 add_subdirectory(themes)
 add_subdirectory(vgafonts)
 

Added: trunk/reactos/media/sdb/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/media/sdb/CMakeLists.txt?rev=71887
==
--- trunk/reactos/media/sdb/CMakeLists.txt  (added)
+++ trunk/reactos/media/sdb/CMakeLists.txt  [iso-8859-1] Sun Jul 10 
16:21:53 2016
@@ -0,0 +1,7 @@
+
+add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sysmain.sdb
+   COMMAND native-xml2sdb -i 
${CMAKE_CURRENT_SOURCE_DIR}/sysmain.xml -o 
${CMAKE_CURRENT_BINARY_DIR}/sysmain.sdb
+   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/sysmain.xml 
native-xml2sdb)
+   
+add_custom_target(compatdb DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/sysmain.sdb)
+add_cd_file(TARGET compatdb FILE ${CMAKE_CURRENT_BINARY_DIR}/sysmain.sdb 
DESTINATION reactos/AppPatch FOR all)

Propchange: trunk/reactos/media/sdb/CMakeLists.txt
--
svn:eol-style = native

Added: trunk/reactos/media/sdb/sysmain.xml
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/media/sdb/sysmain.xml?rev=71887
==
--- trunk/reactos/media/sdb/sysmain.xml (added)
+++ trunk/reactos/media/sdb/sysmain.xml [iso-8859-1] Sun Jul 10 16:21:53 2016
@@ -0,0 +1,186 @@
+
+
+ReactOS compatibility fix database
+1
+{----}
+
+
+Win95VersionLie
+aclayers.dll
+
+
+Win98VersionLie
+aclayers.dll
+
+
+WinNT4SP5VersionLie
+aclayers.dll
+
+
+Win2000VersionLie
+aclayers.dll
+
+
+Win2000SP1VersionLie
+aclayers.dll
+
+
+Win2000SP2VersionLie
+aclayers.dll
+
+
+Win2000SP3VersionLie
+aclayers.dll
+
+
+WinXPVersionLie
+aclayers.dll
+
+
+WinXPSP1VersionLie
+aclayers.dll
+
+
+WinXPSP2VersionLie
+aclayers.dll
+
+
+WinXPSP3VersionLie
+aclayers.dll
+
+
+Win2k3RTMVersionLie
+aclayers.dll
+
+
+Win2k3SP1VersionLie
+aclayers.dll
+
+
+Win2k3SP2VersionLie
+aclayers.dll
+
+
+VistaRTMVersionLie
+aclayers.dll
+
+
+VistaSP1VersionLie
+aclayers.dll
+
+
+VistaSP2VersionLie
+aclayers.dll
+
+
+Win7RTMVersionLie
+aclayers.dll
+
+
+
+WIN95
+
+
+
+
+WIN98
+
+
+
+
+NT4SP5
+
+
+
+
+WIN2000
+
+
+
+
+WIN2000SP1
+
+
+
+
+WIN2000SP2
+
+
+
+
+WIN2000SP3
+
+
+
+
+WINXP
+
+
+
+
+WINXPSP1
+
+
+
+
+WINXPSP2
+
+
+
+
+WINXPSP3
+
+
+
+
+WINSRV03RTM

[ros-diffs] [mjansen] 72110: [ATL][ATL_APITEST] Add implementation + tests for most functions from CPoint, CSize, CRect. CORE-11747 #resolve Not all functions are implemented, the ones that are not im

2016-08-04 Thread mjansen
Author: mjansen
Date: Thu Aug  4 19:15:21 2016
New Revision: 72110

URL: http://svn.reactos.org/svn/reactos?rev=72110=rev
Log:
[ATL][ATL_APITEST] Add implementation + tests for most functions from CPoint, 
CSize, CRect. CORE-11747 #resolve
Not all functions are implemented, the ones that are not implemented are left 
in a comment in the header.

Added:
trunk/reactos/sdk/lib/atl/atltypes.h   (with props)
trunk/rostests/apitests/atl/atltypes.cpp   (with props)
Modified:
trunk/rostests/apitests/atl/CMakeLists.txt
trunk/rostests/apitests/atl/testlist.c

Added: trunk/reactos/sdk/lib/atl/atltypes.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/atl/atltypes.h?rev=72110
==
--- trunk/reactos/sdk/lib/atl/atltypes.h(added)
+++ trunk/reactos/sdk/lib/atl/atltypes.h[iso-8859-1] Thu Aug  4 
19:15:21 2016
@@ -0,0 +1,566 @@
+/*
+ * ReactOS ATL
+ *
+ * Copyright 2016 Mark Jansen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+ */
+
+#pragma once
+
+
+class CSize;
+class CRect;
+
+
+class CPoint : public tagPOINT
+{
+public:
+
+CPoint() throw()
+{
+x = y = 0;
+}
+
+CPoint(int initX, int initY) throw()
+{
+x = initX;
+y = initY;
+}
+
+CPoint(POINT initPt) throw()
+{
+*((POINT*)this) = initPt;
+}
+
+CPoint(SIZE initSize) throw()
+{
+*((SIZE*)this) = initSize;
+}
+
+CPoint(LPARAM dwPoint) throw()
+{
+x = LOWORD(dwPoint);
+y = HIWORD(dwPoint);
+}
+
+void Offset(int xOffset, int yOffset) throw()
+{
+x += xOffset;
+y += yOffset;
+}
+
+void Offset(POINT point) throw()
+{
+Offset(point.x, point.y);
+}
+
+void Offset(SIZE size) throw()
+{
+Offset(size.cx, size.cy);
+}
+
+BOOL operator==(POINT point) const throw()
+{
+return (x == point.x && y == point.y);
+}
+
+BOOL operator!=(POINT point) const throw()
+{
+return !(*this == point);
+}
+
+void operator+=(SIZE size) throw()
+{
+Offset(size);
+}
+
+void operator+=(POINT point) throw()
+{
+Offset(point);
+}
+
+void operator-=(SIZE size) throw()
+{
+Offset(-size.cx, -size.cy);
+}
+
+void operator-=(POINT point) throw()
+{
+Offset(-point.x, -point.y);
+}
+
+CPoint operator+(SIZE size) const throw()
+{
+return CPoint(x + size.cx, y + size.cy);
+}
+
+CPoint operator+(POINT point) const throw()
+{
+return CPoint(x + point.x, y + point.y);
+}
+
+CRect operator+(const RECT* lpRect) const throw();
+
+CSize operator-(POINT point) const throw();
+
+CPoint operator-(SIZE size) const throw()
+{
+return CPoint(x - size.cx, y - size.cy);
+}
+
+CRect operator-(const RECT* lpRect) const throw();
+
+CPoint operator-() const throw()
+{
+return CPoint(-x, -y);
+}
+};
+
+class CSize : public tagSIZE
+{
+public:
+CSize() throw()
+{
+cx = cy = 0;
+}
+
+CSize(int initCX, int initCY) throw()
+{
+cx = initCX;
+cy = initCY;
+}
+
+CSize(SIZE initSize) throw()
+{
+*((SIZE*)this) = initSize;
+}
+
+CSize(POINT initPt) throw()
+{
+*((POINT*)this) = initPt;
+}
+
+CSize(DWORD dwSize) throw()
+{
+cx = LOWORD(dwSize);
+cy = HIWORD(dwSize);
+}
+
+BOOL operator==(SIZE size) const throw()
+{
+return (size.cx == cx && size.cy == cy);
+}
+
+BOOL operator!=(SIZE size) const throw()
+{
+return !(*this == size);
+}
+
+void operator+=(SIZE size) throw()
+{
+cx += size.cx;
+cy += size.cy;
+}
+
+void operator-=(SIZE size) throw()
+{
+cx -= size.cx;
+cy -= size.cy;
+}
+
+CSize operator+(SIZE size) const throw()
+{
+return CSize(cx + size.cx, cy + size.cy);
+}
+
+CPoint operator+(POINT point) const throw()
+{
+return CPoint(cx + point.x, cy + point.y);
+}
+
+CRect operator+(const RECT* lpRect) const throw();
+
+CSize operator-(SIZE s

[ros-diffs] [mjansen] 72109: [INCLUDE/WINE] Update test.h with debug functions for POINT and SIZE.

2016-08-04 Thread mjansen
Author: mjansen
Date: Thu Aug  4 19:11:50 2016
New Revision: 72109

URL: http://svn.reactos.org/svn/reactos?rev=72109=rev
Log:
[INCLUDE/WINE] Update test.h with debug functions for POINT and SIZE.

Modified:
trunk/reactos/sdk/include/reactos/wine/test.h

Modified: trunk/reactos/sdk/include/reactos/wine/test.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/reactos/wine/test.h?rev=72109=72108=72109=diff
==
--- trunk/reactos/sdk/include/reactos/wine/test.h   [iso-8859-1] (original)
+++ trunk/reactos/sdk/include/reactos/wine/test.h   [iso-8859-1] Thu Aug  4 
19:11:50 2016
@@ -70,6 +70,8 @@
 
 extern const char *wine_dbgstr_wn( const WCHAR *str, intptr_t n );
 extern const char *wine_dbgstr_guid( const GUID *guid );
+extern const char *wine_dbgstr_point( const POINT *guid );
+extern const char *wine_dbgstr_size( const SIZE *guid );
 extern const char *wine_dbgstr_rect( const RECT *rect );
 static inline const char *wine_dbgstr_w( const WCHAR *s ) { return 
wine_dbgstr_wn( s, -1 ); }
 
@@ -575,6 +577,36 @@
 return res;
 }
 
+const char *wine_dbgstr_point( const POINT *point )
+{
+char *res;
+
+if (!point) return "(null)";
+res = get_temp_buffer( 60 );
+#ifdef __ROS_LONG64__
+sprintf( res, "(%d,%d)", point->x, point->y );
+#else
+sprintf( res, "(%ld,%ld)", point->x, point->y );
+#endif
+release_temp_buffer( res, strlen(res) + 1 );
+return res;
+}
+
+const char *wine_dbgstr_size( const SIZE *size )
+{
+char *res;
+
+if (!size) return "(null)";
+res = get_temp_buffer( 60 );
+#ifdef __ROS_LONG64__
+sprintf( res, "(%d,%d)", size->cx, size->cy );
+#else
+sprintf( res, "(%ld,%ld)", size->cx, size->cy );
+#endif
+release_temp_buffer( res, strlen(res) + 1 );
+return res;
+}
+
 const char *wine_dbgstr_rect( const RECT *rect )
 {
 char *res;




[ros-diffs] [mjansen] 71975: [ACPPAGE] Add windows ME to the Win98 selection item. Patch by Lee Schroeder. CORE-11606 #resolve #comment Thanks!

2016-07-21 Thread mjansen
Author: mjansen
Date: Thu Jul 21 17:29:41 2016
New Revision: 71975

URL: http://svn.reactos.org/svn/reactos?rev=71975=rev
Log:
[ACPPAGE] Add windows ME to the Win98 selection item. Patch by Lee Schroeder. 
CORE-11606 #resolve #comment Thanks!

Modified:
trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp

Modified: trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp?rev=71975=71974=71975=diff
==
--- trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp [iso-8859-1] 
(original)
+++ trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp [iso-8859-1] 
Thu Jul 21 17:29:41 2016
@@ -72,7 +72,7 @@
 const PCWSTR Name;
 } g_CompatModes[] = {
 { L"Windows 95", L"WIN95" },
-{ L"Windows 98", L"WIN98" },
+{ L"Windows 98/ME", L"WIN98" },
 { L"Windows NT 4.0 (SP5)", L"NT4SP5" },
 { L"Windows 2000", L"WIN2000" },
 { L"Windows XP (SP2)", L"WINXPSP2" },




[ros-diffs] [mjansen] 71981: [SHELL32] Addendum to r71980, RegSetValueEx expects a size in bytes, not chars. CORE-10439

2016-07-23 Thread mjansen
Author: mjansen
Date: Sat Jul 23 13:15:19 2016
New Revision: 71981

URL: http://svn.reactos.org/svn/reactos?rev=71981=rev
Log:
[SHELL32] Addendum to r71980, RegSetValueEx expects a size in bytes, not chars. 
CORE-10439

Modified:
trunk/reactos/dll/win32/shell32/CNewMenu.cpp

Modified: trunk/reactos/dll/win32/shell32/CNewMenu.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CNewMenu.cpp?rev=71981=71980=71981=diff
==
--- trunk/reactos/dll/win32/shell32/CNewMenu.cpp[iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CNewMenu.cpp[iso-8859-1] Sat Jul 23 
13:15:19 2016
@@ -224,7 +224,7 @@
 return FALSE;
 }
 
-if (RegSetValueExW(hKey, L"Classes", NULL, REG_MULTI_SZ, (LPBYTE)lpValues, 
dwSize) != ERROR_SUCCESS)
+if (RegSetValueExW(hKey, L"Classes", NULL, REG_MULTI_SZ, (LPBYTE)lpValues, 
dwSize * sizeof(WCHAR)) != ERROR_SUCCESS)
 {
 HeapFree(GetProcessHeap(), 0, lpValues);
 return FALSE;




[ros-diffs] [mjansen] 72248: [DBGPRINT] --wintest mode: Improve readability of output.

2016-08-17 Thread mjansen
Author: mjansen
Date: Wed Aug 17 21:02:49 2016
New Revision: 72248

URL: http://svn.reactos.org/svn/reactos?rev=72248=rev
Log:
[DBGPRINT] --wintest mode: Improve readability of output.

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

Modified: trunk/reactos/base/applications/cmdutils/dbgprint/dbgprint.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils/dbgprint/dbgprint.c?rev=72248=72247=72248=diff
==
--- trunk/reactos/base/applications/cmdutils/dbgprint/dbgprint.c
[iso-8859-1] (original)
+++ trunk/reactos/base/applications/cmdutils/dbgprint/dbgprint.c
[iso-8859-1] Wed Aug 17 21:02:49 2016
@@ -44,7 +44,7 @@
 
 /* get available tests */
 strcpy(cmd, argv[2]);
-strcat(cmd, " --list");
+strcat(cmd, " --list");
 pPipe = _tpopen(cmd, "r");
 if (pPipe != NULL)
 {
@@ -68,6 +68,8 @@
 if (nlptr2)
 *nlptr2 = '\0';
 puts(psBuffer2);
+if (nlptr2)
+*nlptr2 = '\n';
 OutputDebugStringA(psBuffer2);
 }
 _pclose(pPipe2);




[ros-diffs] [mjansen] 73665: [TRANSLATIONS] Addendum to r73662, fix the build.

2017-02-01 Thread mjansen
Author: mjansen
Date: Wed Feb  1 22:45:04 2017
New Revision: 73665

URL: http://svn.reactos.org/svn/reactos?rev=73665=rev
Log:
[TRANSLATIONS] Addendum to r73662, fix the build.

Modified:
trunk/reactos/base/applications/screensavers/logon/lang/cs-CZ.rc

Modified: trunk/reactos/base/applications/screensavers/logon/lang/cs-CZ.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/screensavers/logon/lang/cs-CZ.rc?rev=73665=73664=73665=diff
==
--- trunk/reactos/base/applications/screensavers/logon/lang/cs-CZ.rc
[iso-8859-1] (original)
+++ trunk/reactos/base/applications/screensavers/logon/lang/cs-CZ.rc
[iso-8859-1] Wed Feb  1 22:45:04 2017
@@ -1,4 +1,4 @@
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
 
 STRINGTABLE
 BEGIN




[ros-diffs] [mjansen] 73743: [BOOTLIB] Additional EfiPrintf conversion like r73736 for MSVC 2013

2017-02-07 Thread mjansen
Author: mjansen
Date: Tue Feb  7 10:32:20 2017
New Revision: 73743

URL: http://svn.reactos.org/svn/reactos?rev=73743=rev
Log:
[BOOTLIB] Additional EfiPrintf conversion like r73736 for MSVC 2013

Modified:
trunk/reactos/boot/environ/lib/mm/i386/mmx86.c

Modified: trunk/reactos/boot/environ/lib/mm/i386/mmx86.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/mm/i386/mmx86.c?rev=73743=73742=73743=diff
==
--- trunk/reactos/boot/environ/lib/mm/i386/mmx86.c  [iso-8859-1] (original)
+++ trunk/reactos/boot/environ/lib/mm/i386/mmx86.c  [iso-8859-1] Tue Feb  7 
10:32:20 2017
@@ -507,10 +507,8 @@
 }
 
 /* We don't support virtual memory yet @TODO */
-#ifdef _MSC_VER // Fuck gcc.
-EfiPrintf(L"not yet implemented in " __FUNCTION__ "\r\n");
+EfiPrintf(L"not yet implemented in %S\r\n", __FUNCTION__);
 EfiStall(100);
-#endif
 return STATUS_NOT_IMPLEMENTED;
 }
 




[ros-diffs] [mjansen] 73744: [WIN32SS] Mute a major spammer in AHK tests.

2017-02-07 Thread mjansen
Author: mjansen
Date: Tue Feb  7 10:33:42 2017
New Revision: 73744

URL: http://svn.reactos.org/svn/reactos?rev=73744=rev
Log:
[WIN32SS] Mute a major spammer in AHK tests.

Modified:
trunk/reactos/win32ss/gdi/ntgdi/palette.c

Modified: trunk/reactos/win32ss/gdi/ntgdi/palette.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/palette.c?rev=73744=73743=73744=diff
==
--- trunk/reactos/win32ss/gdi/ntgdi/palette.c   [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/palette.c   [iso-8859-1] Tue Feb  7 
10:33:42 2017
@@ -745,7 +745,12 @@
 
 if (pdc->dctype == DCTYPE_DIRECT)
 {
-UNIMPLEMENTED;
+static BOOL g_WarnedOnce = FALSE;
+if (!g_WarnedOnce)
+{
+g_WarnedOnce = TRUE;
+UNIMPLEMENTED;
+}
 goto cleanup;
 }
 




[ros-diffs] [mjansen] 73745: [CRT_APITEST] Add additional test for __getmainargs

2017-02-07 Thread mjansen
Author: mjansen
Date: Tue Feb  7 10:35:35 2017
New Revision: 73745

URL: http://svn.reactos.org/svn/reactos?rev=73745=rev
Log:
[CRT_APITEST] Add additional test for __getmainargs

Modified:
trunk/rostests/apitests/crt/__getmainargs.c

Modified: trunk/rostests/apitests/crt/__getmainargs.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/crt/__getmainargs.c?rev=73745=73744=73745=diff
==
--- trunk/rostests/apitests/crt/__getmainargs.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/crt/__getmainargs.c [iso-8859-1] Tue Feb  7 
10:35:35 2017
@@ -28,6 +28,7 @@
 ok_argsA_imp(const char* input_args, const char* arg1, const char* arg2, const 
char* arg3)
 {
 int argc = 0, mode = 0;
+int expect_count = arg3 == NULL ? (arg2 == NULL ? 2 : 3) : 4;
 char** argv, **env;
 
 /* Remove cached argv, setup our input as program argument. */
@@ -37,20 +38,25 @@
 /* Process the commandline stored in _acmdln */
 __getmainargs(, , , 0, );
 
-winetest_ok(argc == 4, "Wrong value for argc, expected: 4, got: %d\n", 
argc);
-if(argc != 4)
+winetest_ok(argc == expect_count, "Wrong value for argc, expected: %d, 
got: %d\n", expect_count, argc);
+if(argc != expect_count)
 return;
 
 winetest_ok_str(argv[0], "test.exe");
 winetest_ok_str(argv[1], arg1);
-winetest_ok_str(argv[2], arg2);
-winetest_ok_str(argv[3], arg3);
+if (expect_count > 2)
+{
+winetest_ok_str(argv[2], arg2);
+if (expect_count > 3)
+winetest_ok_str(argv[3], arg3);
+}
 }
 
 void
 ok_argsW_imp(const wchar_t* input_args, const wchar_t* arg1, const wchar_t* 
arg2, const wchar_t* arg3)
 {
 int argc = 0, mode = 0;
+int expect_count = arg3 == NULL ? (arg2 == NULL ? 2 : 3) : 4;
 wchar_t** argv, **env;
 
 /* Remove cached wargv, setup our input as program argument. */
@@ -60,14 +66,18 @@
 /* Process the commandline stored in _wcmdln */
 __wgetmainargs(, , , 0, );
 
-winetest_ok(argc == 4, "Wrong value for argc, expected: 4, got: %d\n", 
argc);
-if(argc != 4)
+winetest_ok(argc == expect_count, "Wrong value for argc, expected: %d, 
got: %d\n", expect_count, argc);
+if(argc != expect_count)
 return;
 
 winetest_ok_wstr(argv[0], L"test.exe");
 winetest_ok_wstr(argv[1], arg1);
-winetest_ok_wstr(argv[2], arg2);
-winetest_ok_wstr(argv[3], arg3);
+if (expect_count > 2)
+{
+winetest_ok_wstr(argv[2], arg2);
+if (expect_count > 3)
+winetest_ok_wstr(argv[3], arg3);
+}
 }
 
 START_TEST(__getmainargs)
@@ -85,6 +95,7 @@
 ok_argsA("test.exe a  \"b\\  \"\"\"  c\" d", "a", "b\\  \"  c", "d");
 ok_argsA("test.exe a  \"b\\  \"\"\"  \"c  \"\"\"\" d", "a", "b\\  \"  c", 
"\" d");
 ok_argsA("test.exe a b c  ", "a", "b", "c");
+ok_argsA("test.exe \"a b c\"", "a b c", NULL, NULL);
 
 ok_argsW(L"test.exe \"a b c\" d e", L"a b c", L"d", L"e");
 ok_argsW(L"test.exe \"ab\\\"c\" \"\" d", L"ab\"c", L"\\", L"d");
@@ -99,4 +110,5 @@
 ok_argsW(L"test.exe a  \"b\\  \"\"\"  c\" d", L"a", L"b\\  \"  c", L"d");
 ok_argsW(L"test.exe a  \"b\\  \"\"\"  \"c  \"\"\"\" d", L"a", L"b\\  \"  
c", L"\" d");
 ok_argsW(L"test.exe a b c  ", L"a", L"b", L"c");
+ok_argsW(L"test.exe \"a b c\"", L"a b c", NULL, NULL);
 }




[ros-diffs] [mjansen] 73746: [GDI32_APITEST] Add tests for font creation. Patch by Katayama Hirofumi MZ. CORE-6621

2017-02-07 Thread mjansen
Author: mjansen
Date: Tue Feb  7 11:37:36 2017
New Revision: 73746

URL: http://svn.reactos.org/svn/reactos?rev=73746=rev
Log:
[GDI32_APITEST] Add tests for font creation. Patch by Katayama Hirofumi MZ. 
CORE-6621

Modified:
trunk/rostests/apitests/gdi32/CreateFontIndirect.c

Modified: trunk/rostests/apitests/gdi32/CreateFontIndirect.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/CreateFontIndirect.c?rev=73746=73745=73746=diff
==
--- trunk/rostests/apitests/gdi32/CreateFontIndirect.c  [iso-8859-1] (original)
+++ trunk/rostests/apitests/gdi32/CreateFontIndirect.c  [iso-8859-1] Tue Feb  7 
11:37:36 2017
@@ -3,11 +3,13 @@
  * LICENSE: GPL - See COPYING in the top level directory
  * PURPOSE: Test for CreateFontIndirect
  * PROGRAMMERS: Timo Kreuzer
+ *  Katayama Hirofumi MZ
  */
 
 #include 
-
 #include 
+
+#define trace_if(val, msg) do { if (!(val)) trace(msg); } while (0)
 
 void
 Test_CreateFontIndirectA(void)
@@ -167,6 +169,588 @@
 ok(elfedva.elfEnumLogfontEx.elfFullName[LF_FULLFACESIZE-1] == 0, "\n");
 }
 
+static INT CALLBACK
+is_truetype_font_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm,
+  DWORD type, LPARAM lParam)
+{
+if (type != TRUETYPE_FONTTYPE) return 1;
+
+return 0;
+}
+
+static BOOL is_truetype_font_installed(HDC hDC, const char *name)
+{
+if (!EnumFontFamiliesA(hDC, name, is_truetype_font_proc, 0))
+return TRUE;
+return FALSE;
+}
+
+static INT CALLBACK
+is_charset_font_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm,
+   DWORD type, LPARAM lParam)
+{
+if (ntm->tmCharSet == (BYTE)lParam)
+return 0;
+return 1;
+}
+
+static BOOL is_charset_font_installed(HDC hDC, BYTE CharSet)
+{
+if (!EnumFontFamiliesA(hDC, NULL, is_charset_font_proc, CharSet))
+return TRUE;
+return FALSE;
+}
+
+/* TMPF_FIXED_PITCH is confusing. brain-damaged api */
+#define _TMPF_VAR_PITCH TMPF_FIXED_PITCH
+
+static INT CALLBACK
+is_fixed_charset_font_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm,
+ DWORD type, LPARAM lParam)
+{
+if (ntm->tmCharSet == (BYTE)lParam && !(ntm->tmPitchAndFamily & 
_TMPF_VAR_PITCH))
+return 0;
+return 1;
+}
+
+static BOOL
+is_fixed_charset_font_installed(HDC hDC, BYTE CharSet)
+{
+if (!EnumFontFamiliesA(hDC, NULL, is_fixed_charset_font_proc, CharSet))
+return TRUE;
+return FALSE;
+}
+
+static void
+Test_FontPresence(void)
+{
+HDC hDC;
+
+hDC = CreateCompatibleDC(NULL);
+
+ok(is_truetype_font_installed(hDC, "Arial"), "'Arial' is not found\n");
+ok(is_truetype_font_installed(hDC, "Courier New"), "'Courier New' is not 
found\n");
+ok(is_truetype_font_installed(hDC, "Marlett"), "'Marlett' is not found\n");
+ok(is_truetype_font_installed(hDC, "MS Shell Dlg"), "'MS Shell Dlg' is not 
found\n");
+ok(is_truetype_font_installed(hDC, "Tahoma"), "'Tahoma' is not found\n");
+ok(is_truetype_font_installed(hDC, "Times New Roman"), "'Times New Roman' 
is not found\n");
+
+ok(is_charset_font_installed(hDC, ANSI_CHARSET), "ANSI_CHARSET fonts are 
not found\n");
+ok(is_charset_font_installed(hDC, SYMBOL_CHARSET), "SYMBOL_CHARSET fonts 
are not found\n");
+trace_if(is_charset_font_installed(hDC, SHIFTJIS_CHARSET), 
"SHIFTJIS_CHARSET fonts are not found\n");
+trace_if(is_charset_font_installed(hDC, HANGUL_CHARSET), "HANGUL_CHARSET 
fonts are not found\n");
+trace_if(is_charset_font_installed(hDC, GB2312_CHARSET), "GB2312_CHARSET 
fonts are not found\n");
+trace_if(is_charset_font_installed(hDC, CHINESEBIG5_CHARSET), 
"CHINESEBIG5_CHARSET fonts are not found\n");
+ok(is_charset_font_installed(hDC, OEM_CHARSET), "OEM_CHARSET fonts are not 
found\n");
+trace_if(is_charset_font_installed(hDC, JOHAB_CHARSET), "JOHAB_CHARSET 
fonts are not found\n");
+trace_if(is_charset_font_installed(hDC, HEBREW_CHARSET), "HEBREW_CHARSET 
fonts are not found\n");
+trace_if(is_charset_font_installed(hDC, ARABIC_CHARSET), "ARABIC_CHARSET 
fonts are not found\n");
+trace_if(is_charset_font_installed(hDC, GREEK_CHARSET), "GREEK_CHARSET 
fonts are not found\n");
+trace_if(is_charset_font_installed(hDC, TURKISH_CHARSET), "TURKISH_CHARSET 
fonts are not found\n");
+trace_if(is_charset_font_installed(hDC, VIETNAMESE_CHARSET), 
"VIETNAMESE_CHARSET fonts are not found\n");
+trace_if(is_charset_font_installed(hDC, THAI_CHARSET), "THAI_CHARSET fonts 
are not found\n");
+trace_if(is_charset_font_installed(hDC, EASTEUROPE_CHARSET), 
"EASTEUROPE_

[ros-diffs] [mjansen] 73748: [KERNEL32] Silence some noise during process creation.

2017-02-07 Thread mjansen
Author: mjansen
Date: Tue Feb  7 16:45:50 2017
New Revision: 73748

URL: http://svn.reactos.org/svn/reactos?rev=73748=rev
Log:
[KERNEL32] Silence some noise during process creation.

Modified:
trunk/reactos/dll/win32/kernel32/client/appcache.c
trunk/reactos/dll/win32/kernel32/client/utils.c

Modified: trunk/reactos/dll/win32/kernel32/client/appcache.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/appcache.c?rev=73748=73747=73748=diff
==
--- trunk/reactos/dll/win32/kernel32/client/appcache.c  [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/appcache.c  [iso-8859-1] Tue Feb  7 
16:45:50 2017
@@ -133,7 +133,8 @@
 IN PWCHAR Environment,
 OUT PULONG Reason)
 {
-UNIMPLEMENTED;
+DPRINT("BaseCheckAppcompatCache is UNIMPLEMENTED\n");
+
 if (Reason) *Reason = 0;
 return TRUE;
 }

Modified: trunk/reactos/dll/win32/kernel32/client/utils.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/utils.c?rev=73748=73747=73748=diff
==
--- trunk/reactos/dll/win32/kernel32/client/utils.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/utils.c [iso-8859-1] Tue Feb  7 
16:45:50 2017
@@ -942,7 +942,7 @@
 if ((InJob) && (NewToken) && (JobHandle))
 {
 /* Do the work (one day...) */
-UNIMPLEMENTED;
+DPRINT("BasepCheckWinSaferRestrictions is UNIMPLEMENTED\n");
 Status = STATUS_SUCCESS;
 }
 else




[ros-diffs] [mjansen] 73755: [FONTVIEW] Add support for font collections + show some extra font properties. Patch by Katayama Hirofumi MZ. CORE-6621 Some minor changes by me

2017-02-08 Thread mjansen
Author: mjansen
Date: Wed Feb  8 17:56:22 2017
New Revision: 73755

URL: http://svn.reactos.org/svn/reactos?rev=73755=rev
Log:
[FONTVIEW] Add support for font collections + show some extra font properties. 
Patch by Katayama Hirofumi MZ. CORE-6621
Some minor changes by me

Modified:
trunk/reactos/base/applications/fontview/display.c
trunk/reactos/base/applications/fontview/fontview.c
trunk/reactos/base/applications/fontview/fontview.h
trunk/reactos/base/applications/fontview/lang/bg-BG.rc
trunk/reactos/base/applications/fontview/lang/cs-CZ.rc
trunk/reactos/base/applications/fontview/lang/de-DE.rc
trunk/reactos/base/applications/fontview/lang/en-US.rc
trunk/reactos/base/applications/fontview/lang/es-ES.rc
trunk/reactos/base/applications/fontview/lang/fr-FR.rc
trunk/reactos/base/applications/fontview/lang/he-IL.rc
trunk/reactos/base/applications/fontview/lang/it-IT.rc
trunk/reactos/base/applications/fontview/lang/lt-LT.rc
trunk/reactos/base/applications/fontview/lang/ms-MY.rc
trunk/reactos/base/applications/fontview/lang/no-NO.rc
trunk/reactos/base/applications/fontview/lang/pl-PL.rc
trunk/reactos/base/applications/fontview/lang/pt-BR.rc
trunk/reactos/base/applications/fontview/lang/ro-RO.rc
trunk/reactos/base/applications/fontview/lang/ru-RU.rc
trunk/reactos/base/applications/fontview/lang/sk-SK.rc
trunk/reactos/base/applications/fontview/lang/sq-AL.rc
trunk/reactos/base/applications/fontview/lang/sv-SE.rc
trunk/reactos/base/applications/fontview/lang/tr-TR.rc
trunk/reactos/base/applications/fontview/lang/uk-UA.rc
trunk/reactos/base/applications/fontview/lang/zh-CN.rc
trunk/reactos/base/applications/fontview/lang/zh-TW.rc
trunk/reactos/base/applications/fontview/resource.h

Modified: trunk/reactos/base/applications/fontview/display.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/fontview/display.c?rev=73755=73754=73755=diff
==
--- trunk/reactos/base/applications/fontview/display.c  [iso-8859-1] (original)
+++ trunk/reactos/base/applications/fontview/display.c  [iso-8859-1] Wed Feb  8 
17:56:22 2017
@@ -28,6 +28,9 @@
 #define SPACING1 8
 #define SPACING2 5
 
+extern INT g_NumFonts;
+extern WCHAR g_FontTitle[];
+
 const WCHAR g_szFontDisplayClassName[] = L"FontDisplayClass";
 LRESULT CALLBACK DisplayProc(HWND, UINT, WPARAM, LPARAM);
 
@@ -162,7 +165,7 @@
 }
 
 static LRESULT
-Display_SetTypeFace(HWND hwnd, PEXTLOGFONTW pExtLogFont)
+Display_SetTypeFace(HWND hwnd, PLOGFONTW pLogFont)
 {
DISPLAYDATA* pData;
TEXTMETRIC tm;
@@ -171,16 +174,21 @@
SCROLLINFO si;
int i;
LOGFONTW logfont;
+   BOOL fOpenType;
+   BYTE Buffer[512];
+   LPOUTLINETEXTMETRICW pOTM = (LPOUTLINETEXTMETRICW)Buffer;
+   LPWSTR pch;
 
/* Set the new type face name */
pData = (DISPLAYDATA*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
-   _snwprintf(pData->szTypeFaceName, LF_FULLFACESIZE, 
pExtLogFont->elfFullName);
+   lstrcpynW(pData->szTypeFaceName, pLogFont->lfFaceName,
+ ARRAYSIZE(pData->szTypeFaceName));
 
/* Create the new fonts */
hDC = GetDC(hwnd);
DeleteObject(pData->hCharSetFont);
 
-   logfont = pExtLogFont->elfLogFont;
+   logfont = *pLogFont;
logfont.lfHeight = -MulDiv(16, GetDeviceCaps(GetDC(NULL), LOGPIXELSY), 
72);
pData->hCharSetFont = CreateFontIndirectW();
 
@@ -189,8 +197,19 @@
GetTextMetrics(hDC, );
if (tm.tmPitchAndFamily & TMPF_TRUETYPE)
{
-   BOOL fOpenType = FALSE;
-
+   if (GetOutlineTextMetricsW(hDC, sizeof(Buffer), pOTM))
+   {
+   LPBYTE pb = Buffer;
+   pb += (WORD)(DWORD_PTR)pOTM->otmpStyleName;
+   pch = (LPWSTR)pb;
+   if (*pch)
+   {
+   lstrcatW(pData->szTypeFaceName, L" ");
+   lstrcatW(pData->szTypeFaceName, pch);
+   }
+   }
+
+   fOpenType = FALSE;
EnumFontFamiliesExW(hDC, ,
EnumFontFamProcW, (LPARAM), 0);
 
@@ -234,12 +253,12 @@
 }
 
 static LRESULT
-Display_SetString(HWND hwnd, LPARAM lParam)
+Display_SetString(HWND hwnd, LPCWSTR pszString)
 {
DISPLAYDATA* pData;
 
pData = (DISPLAYDATA*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
-   _snwprintf(pData->szString, MAX_STRING, (WCHAR*)lParam);
+   lstrcpynW(pData->szString, pszString, ARRAYSIZE(pData->szString));
 
InvalidateRect(hwnd, NULL, TRUE);
 
@@ -252,11 +271,10 @@
DISPLAYDATA* pData;
const int nSizes[MAX_SIZES] = {8, 12, 18, 24, 36, 48, 60, 72};
int i;
-   EXTL

[ros-diffs] [mjansen] 73758: [SHELL32] CDefaultContextMenu: Fix starting applications with just one 'static' menu item.

2017-02-08 Thread mjansen
Author: mjansen
Date: Wed Feb  8 22:24:47 2017
New Revision: 73758

URL: http://svn.reactos.org/svn/reactos?rev=73758=rev
Log:
[SHELL32] CDefaultContextMenu: Fix starting applications with just one 'static' 
menu item.

Modified:
trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp

Modified: trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp?rev=73758=73757=73758=diff
==
--- trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp [iso-8859-1] 
(original)
+++ trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp [iso-8859-1] 
Wed Feb  8 22:24:47 2017
@@ -675,7 +675,9 @@
 
 /* Add static context menu handlers */
 IndexMenu = AddStaticContextMenusToMenu(hMenu, IndexMenu, idCmdNext, 
idCmdLast);
-if (m_iIdSCMLast && m_iIdSCMFirst != m_iIdSCMLast) 
+if (m_iIdSCMLast && m_iIdSCMFirst > m_iIdSCMLast)
+m_iIdSCMLast = m_iIdSCMFirst = 0;
+else if (m_iIdSCMLast)
 idCmdNext = m_iIdSCMLast + 1;
 
 /* Add dynamic context menu handlers */




[ros-diffs] [mjansen] 73759: [HIVECLS|FONTVIEW] Fix fontview registration and add additional extensions. Patch by Katayama Hirofumi MZ. CORE-6621

2017-02-08 Thread mjansen
Author: mjansen
Date: Wed Feb  8 22:41:10 2017
New Revision: 73759

URL: http://svn.reactos.org/svn/reactos?rev=73759=rev
Log:
[HIVECLS|FONTVIEW] Fix fontview registration and add additional extensions. 
Patch by Katayama Hirofumi MZ. CORE-6621

Modified:
trunk/reactos/boot/bootdata/hivecls.inf

Modified: trunk/reactos/boot/bootdata/hivecls.inf
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivecls.inf?rev=73759=73758=73759=diff
==
--- trunk/reactos/boot/bootdata/hivecls.inf [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/hivecls.inf [iso-8859-1] Wed Feb  8 
22:41:10 2017
@@ -121,19 +121,37 @@
 HKCR,"fonfile","",0x,"Font file"
 
HKCR,"fonfile","FriendlyTypeName",0x0002,"@%SystemRoot%\system32\shell32.dll,-209"
 
HKCR,"fonfile\DefaultIcon","",0x0002,"%SystemRoot%\system32\shell32.dll,-155"
-HKCR,"fonfile\shell\open\command","",0x0002,"%SystemRoot%\system32\fontview.exe
 %1"
+HKCR,"fonfile\shell\open\command","",0x0002,"%SystemRoot%\system32\fontview.exe
 ""%1"""
+
+HKCR,".fnt","",0x,"fntfile"
+HKCR,"fntfile","",0x,"Font file"
+HKCR,"fntfile","FriendlyTypeName",0x0002,"@%SystemRoot%\system32\shell32.dll,-209"
+HKCR,"fntfile\DefaultIcon","",0x0002,"%SystemRoot%\system32\shell32.dll,-155"
+HKCR,"fntfile\shell\open\command","",0x0002,"%SystemRoot%\system32\fontview.exe
 ""%1"""
 
 HKCR,".ttf","",0x,"ttffile"
 HKCR,"ttffile","",0x,"TrueType Font file"
 
HKCR,"ttffile","FriendlyTypeName",0x0002,"@%SystemRoot%\system32\shell32.dll,-210"
 
HKCR,"ttffile\DefaultIcon","",0x0002,"%SystemRoot%\system32\shell32.dll,-156"
-HKCR,"ttffile\shell\open\command","",0x0002,"%SystemRoot%\system32\fontview.exe
 %1"
+HKCR,"ttffile\shell\open\command","",0x0002,"%SystemRoot%\system32\fontview.exe
 ""%1"""
+
+HKCR,".ttc","",0x,"ttcfile"
+HKCR,"ttcfile","",0x,"TrueType Font Collection file"
+HKCR,"ttcfile","FriendlyTypeName",0x0002,"@%SystemRoot%\system32\shell32.dll,-210"
+HKCR,"ttcfile\DefaultIcon","",0x0002,"%SystemRoot%\system32\shell32.dll,-156"
+HKCR,"ttcfile\shell\open\command","",0x0002,"%SystemRoot%\system32\fontview.exe
 ""%1"""
 
 HKCR,".otf","",0x,"otffile"
 HKCR,"otffile","",0x,"OpenType Font file"
 
HKCR,"otffile","FriendlyTypeName",0x0002,"@%SystemRoot%\system32\shell32.dll,-211"
 
HKCR,"otffile\DefaultIcon","",0x0002,"%SystemRoot%\system32\shell32.dll,-156"
-HKCR,"otffile\shell\open\command","",0x0002,"%SystemRoot%\system32\fontview.exe
 %1"
+HKCR,"otffile\shell\open\command","",0x0002,"%SystemRoot%\system32\fontview.exe
 ""%1"""
+
+HKCR,".otc","",0x,"otcfile"
+HKCR,"otcfile","",0x,"OpenType Font file"
+HKCR,"otcfile","FriendlyTypeName",0x0002,"@%SystemRoot%\system32\shell32.dll,-211"
+HKCR,"otcfile\DefaultIcon","",0x0002,"%SystemRoot%\system32\shell32.dll,-156"
+HKCR,"otcfile\shell\open\command","",0x0002,"%SystemRoot%\system32\fontview.exe
 ""%1"""
 
 ; Help Files
 HKCR,".hlp","",0x,"hlpfile"




[ros-diffs] [mjansen] 73765: [NTOSKRNL] Fix some possible overruns in FsRtlIsNameInExpressionPrivate + add a test from Thomas. CORE-12121

2017-02-08 Thread mjansen
Author: mjansen
Date: Thu Feb  9 00:12:36 2017
New Revision: 73765

URL: http://svn.reactos.org/svn/reactos?rev=73765=rev
Log:
[NTOSKRNL] Fix some possible overruns in FsRtlIsNameInExpressionPrivate + add a 
test from Thomas. CORE-12121

Modified:
trunk/reactos/ntoskrnl/fsrtl/name.c
trunk/rostests/kmtests/ntos_fsrtl/FsRtlExpression.c

Modified: trunk/reactos/ntoskrnl/fsrtl/name.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/name.c?rev=73765=73764=73765=diff
==
--- trunk/reactos/ntoskrnl/fsrtl/name.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/fsrtl/name.c [iso-8859-1] Thu Feb  9 00:12:36 2017
@@ -113,7 +113,7 @@
 if (NamePosition >= Name->Length / sizeof(WCHAR))
 {
 EndOfName = TRUE;
-if (OldBackTracking[MatchingChars - 1] == Expression->Length * 2)
+if (MatchingChars && (OldBackTracking[MatchingChars - 1] == 
Expression->Length * 2))
 break;
 }
 
@@ -155,8 +155,8 @@
 }
 
 /* Basic check to test if chars are equal */
-CompareChar = IgnoreCase ? 
UpcaseTable[Name->Buffer[NamePosition]] :
-   Name->Buffer[NamePosition];
+CompareChar = (NamePosition >= Name->Length / sizeof(WCHAR)) ? 
UNICODE_NULL : (IgnoreCase ? UpcaseTable[Name->Buffer[NamePosition]] :
+   Name->Buffer[NamePosition]);
 if (Expression->Buffer[ExpressionPosition / sizeof(WCHAR)] == 
CompareChar && !EndOfName)
 {
 BackTracking[BackTrackingPosition++] = (ExpressionPosition 
+ sizeof(WCHAR)) * 2;
@@ -233,7 +233,7 @@
 }
 
 /* Store result value */
-Result = (OldBackTracking[MatchingChars - 1] == (Expression->Length * 2));
+Result = MatchingChars > 0 && (OldBackTracking[MatchingChars - 1] == 
(Expression->Length * 2));
 
 /* Frees the memory if necessary */
 if (BackTracking != BackTrackingBuffer && BackTracking != 
OldBackTrackingBuffer)

Modified: trunk/rostests/kmtests/ntos_fsrtl/FsRtlExpression.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_fsrtl/FsRtlExpression.c?rev=73765=73764=73765=diff
==
--- trunk/rostests/kmtests/ntos_fsrtl/FsRtlExpression.c [iso-8859-1] (original)
+++ trunk/rostests/kmtests/ntos_fsrtl/FsRtlExpression.c [iso-8859-1] Thu Feb  9 
00:12:36 2017
@@ -173,6 +173,9 @@
 { L"a>>>exe",   L"ac.exe",  FALSE,  FALSE, 
 FALSE },
 { L"<.exe", L"test.exe",FALSE,  FALSE, 
 TRUE },
 { L"<.EXE", L"test.exe",TRUE,   FALSE, 
 TRUE },
+{ 
L"*_MICROSOFT.WINDOWS.COMMON-CONTROLS_6595B64144CCF1DF_6.0.*.*_*_*.MANIFEST",
+
L"X86_MICROSOFT.VC90.ATL_1FC8B3B9A1E18E3B_9.0.30729.6161_X-WW_92453BB7.CAT",
+FALSE,  FALSE, 
 FALSE },
 };
 
 static VOID FsRtlIsNameInExpressionTest()




[ros-diffs] [mjansen] 73686: [HIVECLS|MSPAINT] Add Edit menu item for bitmaps. CORE-12679 #resolve

2017-02-04 Thread mjansen
Author: mjansen
Date: Sat Feb  4 21:26:59 2017
New Revision: 73686

URL: http://svn.reactos.org/svn/reactos?rev=73686=rev
Log:
[HIVECLS|MSPAINT] Add Edit menu item for bitmaps. CORE-12679 #resolve

Modified:
trunk/reactos/boot/bootdata/hivecls.inf

Modified: trunk/reactos/boot/bootdata/hivecls.inf
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivecls.inf?rev=73686=73685=73686=diff
==
--- trunk/reactos/boot/bootdata/hivecls.inf [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/hivecls.inf [iso-8859-1] Sat Feb  4 
21:26:59 2017
@@ -193,10 +193,17 @@
 HKCR,".jpeg","",0x,"jpegfile"
 HKCR,".jpeg","Content Type",0x,"image/jpeg"
 HKCR,".jpeg","PerceivedType",0x,"image"
+HKCR,".jpe","",0x,"jpegfile"
+HKCR,".jpe","Content Type",0x,"image/jpeg"
+HKCR,".jpe","PerceivedType",0x,"image"
+HKCR,".jfif","",0x,"jpegfile"
+HKCR,".jfif","Content Type",0x,"image/jpeg"
+HKCR,".jfif","PerceivedType",0x,"image"
 HKCR,"jpegfile","",0x,"JPEG Image"
 
HKCR,"jpegfile","FriendlyTypeName",0x0002,"@%SystemRoot%\system32\shimgvw.dll,-303"
 HKCR,"jpegfile\DefaultIcon","",0x0002,"%SystemRoot%\system32\shimgvw.dll,0"
 HKCR,"jpegfile\shell\open\command","",0x0002,"rundll32.exe 
%SystemRoot%\system32\shimgvw.dll,ImageView_Fullscreen %1"
+HKCR,"jpegfile\shell\edit\command","",0x0002,"%SystemRoot%\system32\mspaint.exe
 %1"
 
 ; Bitmap Images
 HKCR,".bmp","",0x,"bmpfile"
@@ -204,10 +211,14 @@
 HKCR,".bmp","PerceivedType",0x,"image"
 HKCR,".bmp\shellnew","",0x,""
 HKCR,".bmp\shellnew","NullFile",0x0002,""
+HKCR,".dib","",0x,"bmpfile"
+HKCR,".dib","Content Type",0x,"image/bmp"
+HKCR,".dib","PerceivedType",0x,"image"
 HKCR,"bmpfile","",0x,"Bitmap Image"
 
HKCR,"bmpfile","FriendlyTypeName",0x0002,"@%SystemRoot%\system32\shimgvw.dll,-304"
 HKCR,"bmpfile\DefaultIcon","",0x0002,"%SystemRoot%\system32\shimgvw.dll,1"
 HKCR,"bmpfile\shell\open\command","",0x0002,"rundll32.exe 
%SystemRoot%\system32\shimgvw.dll,ImageView_Fullscreen %1"
+HKCR,"bmpfile\shell\edit\command","",0x0002,"%SystemRoot%\system32\mspaint.exe
 %1"
 
 ; PNG Images
 HKCR,".png","",0x,"pngfile"
@@ -217,6 +228,7 @@
 
HKCR,"pngfile","FriendlyTypeName",0x0002,"@%SystemRoot%\system32\shimgvw.dll,-305"
 HKCR,"pngfile\DefaultIcon","",0x0002,"%SystemRoot%\system32\shimgvw.dll,2"
 HKCR,"pngfile\shell\open\command","",0x0002,"rundll32.exe 
%SystemRoot%\system32\shimgvw.dll,ImageView_Fullscreen %1"
+HKCR,"pngfile\shell\edit\command","",0x0002,"%SystemRoot%\system32\mspaint.exe
 %1"
 
 ; TIF Images
 HKCR,".tif","",0x,"TIFImage.Document"
@@ -229,6 +241,7 @@
 
HKCR,"TIFImage.Document","FriendlyTypeName",0x0002,"@%SystemRoot%\system32\shimgvw.dll,-306"
 
HKCR,"TIFImage.Document\DefaultIcon","",0x0002,"%SystemRoot%\system32\shimgvw.dll,0"
 HKCR,"TIFImage.Document\shell\open\command","",0x0002,"rundll32.exe 
%SystemRoot%\system32\shimgvw.dll,ImageView_Fullscreen %1"
+HKCR,"TIFImage.Document\shell\edit\command","",0x0002,"%SystemRoot%\system32\mspaint.exe
 %1"
 
 ; WMF Images
 HKCR,".wmf","",0x,"wmffile"




[ros-diffs] [mjansen] 73615: [EXPLORER] Re-save the start menu banner so that we can display it again (and touch the .rc so it will be used).

2017-01-28 Thread mjansen
Author: mjansen
Date: Sat Jan 28 23:05:04 2017
New Revision: 73615

URL: http://svn.reactos.org/svn/reactos?rev=73615=rev
Log:
[EXPLORER] Re-save the start menu banner so that we can display it again (and 
touch the .rc so it will be used).

Modified:
trunk/reactos/base/shell/explorer/explorer.rc
trunk/reactos/base/shell/explorer/res/bmp/158.bmp

Modified: trunk/reactos/base/shell/explorer/explorer.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/explorer.rc?rev=73615=73614=73615=diff
==
--- trunk/reactos/base/shell/explorer/explorer.rc   [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/explorer.rc   [iso-8859-1] Sat Jan 28 
23:05:04 2017
@@ -160,3 +160,4 @@
 #ifdef LANGUAGE_ZH_TW
 #include "lang/zh-TW.rc"
 #endif
+

Modified: trunk/reactos/base/shell/explorer/res/bmp/158.bmp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/res/bmp/158.bmp?rev=73615=73614=73615=diff
==
Binary files - no diff available.




[ros-diffs] [mjansen] 73832: [KS] Cleanup in the failure path of KsCreateDefaultClock. Patch by Sebastian Gasiorek. CID 1322124 CORE-12784 #resolve #comment Thanks!

2017-02-18 Thread mjansen
Author: mjansen
Date: Sat Feb 18 22:54:31 2017
New Revision: 73832

URL: http://svn.reactos.org/svn/reactos?rev=73832=rev
Log:
[KS] Cleanup in the failure path of KsCreateDefaultClock. Patch by Sebastian 
Gasiorek. CID 1322124 CORE-12784 #resolve #comment Thanks!

Modified:
trunk/reactos/drivers/ksfilter/ks/clocks.c

Modified: trunk/reactos/drivers/ksfilter/ks/clocks.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/clocks.c?rev=73832=73831=73832=diff
==
--- trunk/reactos/drivers/ksfilter/ks/clocks.c  [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/clocks.c  [iso-8859-1] Sat Feb 18 
22:54:31 2017
@@ -395,7 +395,10 @@
 /* let's allocate the clock struct */
 Clock = AllocateItem(NonPagedPool, sizeof(KSICLOCK));
 if (!Clock)
+{
+FreeItem(ClockCreate);
 return STATUS_INSUFFICIENT_RESOURCES;
+}
 
 /* now allocate the object header */
 Status = KsAllocateObjectHeader((PVOID*)>ObjectHeader, 0, NULL, 
Irp, );
@@ -404,6 +407,7 @@
 if (!NT_SUCCESS(Status))
 {
 /* failed */
+FreeItem(ClockCreate);
 FreeItem(Clock);
 return Status;
 }




[ros-diffs] [mjansen] 73815: [SDK][KERNEL32] Add defines for PEB.AppCompatFlags CORE-12768 #resolve

2017-02-17 Thread mjansen
Author: mjansen
Date: Fri Feb 17 16:12:19 2017
New Revision: 73815

URL: http://svn.reactos.org/svn/reactos?rev=73815=rev
Log:
[SDK][KERNEL32] Add defines for PEB.AppCompatFlags CORE-12768 #resolve

Modified:
trunk/reactos/dll/win32/kernel32/client/path.c
trunk/reactos/sdk/include/ndk/pstypes.h

Modified: trunk/reactos/dll/win32/kernel32/client/path.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/path.c?rev=73815=73814=73815=diff
==
--- trunk/reactos/dll/win32/kernel32/client/path.c  [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/path.c  [iso-8859-1] Fri Feb 17 
16:12:19 2017
@@ -1861,7 +1861,7 @@
 if (GetFileAttributesW(lpszLongPath) == INVALID_FILE_ATTRIBUTES)
 {
 /* Windows checks for an application compatibility flag to allow this 
*/
-if (!(NtCurrentPeb()) || !(NtCurrentPeb()->AppCompatFlags.LowPart & 1))
+if (!(NtCurrentPeb()) || !(NtCurrentPeb()->AppCompatFlags.LowPart & 
GetShortPathNameNT4))
 {
 /* It doesn't, so fail */
 ReturnLength = 0;

Modified: trunk/reactos/sdk/include/ndk/pstypes.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/ndk/pstypes.h?rev=73815=73814=73815=diff
==
--- trunk/reactos/sdk/include/ndk/pstypes.h [iso-8859-1] (original)
+++ trunk/reactos/sdk/include/ndk/pstypes.h [iso-8859-1] Fri Feb 17 
16:12:19 2017
@@ -735,6 +735,31 @@
 } Wx86ThreadState, *PWx86ThreadState;
 #endif
 
+//
+// PEB.AppCompatFlags
+// Tag FLAG_MASK_KERNEL
+//
+typedef enum _APPCOMPAT_FLAGS
+{
+GetShortPathNameNT4 = 0x1,
+GetDiskFreeSpace2GB = 0x8,
+FTMFromCurrentAPI = 0x20,
+DisallowCOMBindingNotifications = 0x40,
+Ole32ValidatePointers = 0x80,
+DisableCicero = 0x100,
+Ole32EnableAsyncDocFile = 0x200,
+EnableLegacyExceptionHandlinginOLE = 0x400,
+DisableAdvanceRPCClientHardening = 0x800,
+DisableMaybeNULLSizeisConsistencycheck = 0x1000,
+DisableAdvancedRPCrangeCheck = 0x4000,
+EnableLegacyExceptionHandlingInRPC = 0x8000,
+EnableLegacyNTFSFlagsForDocfileOpens = 0x1,
+DisableNDRIIDConsistencyCheck = 0x2,
+UserDisableForwarderPatch = 0x4,
+DisableNewWMPAINTDispatchInOLE = 0x10,
+DoNotAddToCache = 0x8000,
+} APPCOMPAT_FLAGS;
+
 
 //
 // Process Environment Block (PEB)




[ros-diffs] [mjansen] 73816: [DBGHELP_APITEST] Add tests for pdb and rsym parsing. CORE-12773

2017-02-17 Thread mjansen
Author: mjansen
Date: Fri Feb 17 16:15:49 2017
New Revision: 73816

URL: http://svn.reactos.org/svn/reactos?rev=73816=rev
Log:
[DBGHELP_APITEST] Add tests for pdb and rsym parsing. CORE-12773

Added:
trunk/rostests/apitests/dbghelp/
trunk/rostests/apitests/dbghelp/CMakeLists.txt   (with props)
trunk/rostests/apitests/dbghelp/data.c   (with props)
trunk/rostests/apitests/dbghelp/pdb.c   (with props)
trunk/rostests/apitests/dbghelp/resource.rc   (with props)
trunk/rostests/apitests/dbghelp/rsym.c   (with props)
trunk/rostests/apitests/dbghelp/testdata/
trunk/rostests/apitests/dbghelp/testdata/gcc_uffs.dll.compr   (with props)
trunk/rostests/apitests/dbghelp/testdata/msvc_uffs.dll.compr   (with props)
trunk/rostests/apitests/dbghelp/testdata/msvc_uffs.pdb.compr   (with props)
trunk/rostests/apitests/dbghelp/testlist.c   (with props)
Modified:
trunk/rostests/apitests/CMakeLists.txt

Modified: trunk/rostests/apitests/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/CMakeLists.txt?rev=73816=73815=73816=diff
==
--- trunk/rostests/apitests/CMakeLists.txt  [iso-8859-1] (original)
+++ trunk/rostests/apitests/CMakeLists.txt  [iso-8859-1] Fri Feb 17 
16:15:49 2017
@@ -7,6 +7,7 @@
 add_subdirectory(browseui)
 add_subdirectory(com)
 add_subdirectory(crt)
+add_subdirectory(dbghelp)
 add_subdirectory(dciman32)
 add_subdirectory(dnsapi)
 add_subdirectory(gdi32)

Added: trunk/rostests/apitests/dbghelp/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/dbghelp/CMakeLists.txt?rev=73816
==
--- trunk/rostests/apitests/dbghelp/CMakeLists.txt  (added)
+++ trunk/rostests/apitests/dbghelp/CMakeLists.txt  [iso-8859-1] Fri Feb 17 
16:15:49 2017
@@ -0,0 +1,20 @@
+
+add_definitions(-D__ROS_LONG64__ -DWINETEST_USE_DBGSTR_LONGLONG)
+
+include_directories(
+${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/zlib
+${REACTOS_SOURCE_DIR}/sdk/tools/rsym
+)
+
+list(APPEND SOURCE
+pdb.c
+rsym.c
+data.c
+testlist.c)
+
+add_executable(dbghelp_apitest ${SOURCE} resource.rc)
+set_module_type(dbghelp_apitest win32cui)
+target_link_libraries(dbghelp_apitest zlib)
+add_delay_importlibs(dbghelp_apitest dbghelp)
+add_importlibs(dbghelp_apitest msvcrt kernel32 ntdll)
+add_rostests_file(TARGET dbghelp_apitest)

Propchange: trunk/rostests/apitests/dbghelp/CMakeLists.txt
--
svn:eol-style = native

Added: trunk/rostests/apitests/dbghelp/data.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/dbghelp/data.c?rev=73816
==
--- trunk/rostests/apitests/dbghelp/data.c  (added)
+++ trunk/rostests/apitests/dbghelp/data.c  [iso-8859-1] Fri Feb 17 
16:15:49 2017
@@ -0,0 +1,277 @@
+/*
+ * PROJECT: ReactOS api tests
+ * LICENSE: GPLv2+ - See COPYING in the top level directory
+ * PURPOSE: Support functions for dbghelp api test
+ * PROGRAMMER:  Mark Jansen
+ */
+
+#include 
+#include 
+#include 
+
+#include "wine/test.h"
+
+extern IMAGE_DOS_HEADER __ImageBase;
+
+static char szTempPath[MAX_PATH];
+
+static const char* tmpdir()
+{
+if (szTempPath[0] == '\0')
+{
+GetTempPathA(MAX_PATH, szTempPath);
+lstrcatA(szTempPath, "dbghelp_tst");
+}
+return szTempPath;
+}
+
+static int extract_one(const char* filename, const char* resid)
+{
+HMODULE mod = (HMODULE)&__ImageBase;
+HGLOBAL glob;
+PVOID data, decompressed;
+uLongf size, dstsize;
+DWORD gccSize, dwErr;
+HANDLE file;
+int ret;
+HRSRC rsrc = FindResourceA(mod, resid, MAKEINTRESOURCEA(RT_RCDATA));
+ok(rsrc != 0, "Failed finding '%s' res\n", resid);
+if (!rsrc)
+return 0;
+
+size = SizeofResource(mod, rsrc);
+glob = LoadResource(mod, rsrc);
+ok(glob != NULL, "Failed loading '%s' res\n", resid);
+if (!glob)
+return 0;
+
+data = LockResource(glob);
+
+dstsize = 1024 * 256;
+decompressed = malloc(dstsize);
+
+if (uncompress(decompressed, , data, size) != Z_OK)
+{
+ok(0, "uncompress failed for %s\n", resid);
+free(decompressed);
+return 0;
+}
+
+
+file = CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 
FILE_ATTRIBUTE_NORMAL, NULL);
+gccSize = size;
+ret = WriteFile(file, decompressed, dstsize, , NULL);
+dwErr = GetLastError();
+CloseHandle(file);
+free(decompressed);
+ok(ret, "WriteFile failed (%d)\n", dwErr);
+return ret && dstsize == gccSize;
+}
+
+
+int extract_msvc_exe(char szFile[MAX_PATH])
+{
+const char* dir = tmpdir();
+BOOL ret = CreateDirectory

[ros-diffs] [mjansen] 73817: [DBGHELP] Add experimental rsym support. CORE-12773

2017-02-17 Thread mjansen
Author: mjansen
Date: Fri Feb 17 16:18:15 2017
New Revision: 73817

URL: http://svn.reactos.org/svn/reactos?rev=73817=rev
Log:
[DBGHELP] Add experimental rsym support. CORE-12773

Added:
trunk/reactos/dll/win32/dbghelp/rsym.c   (with props)
Modified:
trunk/reactos/dll/win32/dbghelp/CMakeLists.txt
trunk/reactos/dll/win32/dbghelp/dbghelp_private.h
trunk/reactos/dll/win32/dbghelp/pe_module.c

Modified: trunk/reactos/dll/win32/dbghelp/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dbghelp/CMakeLists.txt?rev=73817=73816=73817=diff
==
--- trunk/reactos/dll/win32/dbghelp/CMakeLists.txt  [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/dbghelp/CMakeLists.txt  [iso-8859-1] Fri Feb 17 
16:18:15 2017
@@ -63,6 +63,7 @@
 path.c
 pe_module.c
 rosstubs.c
+rsym.c
 source.c
 stabs.c
 stack.c

Modified: trunk/reactos/dll/win32/dbghelp/dbghelp_private.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dbghelp/dbghelp_private.h?rev=73817=73816=73817=diff
==
--- trunk/reactos/dll/win32/dbghelp/dbghelp_private.h   [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/dbghelp/dbghelp_private.h   [iso-8859-1] Fri Feb 17 
16:18:15 2017
@@ -713,6 +713,12 @@
  struct image_file_map* fmap) DECLSPEC_HIDDEN;
 extern BOOL dwarf2_virtual_unwind(struct cpu_stack_walk* csw, 
DWORD_PTR ip,
   CONTEXT* context, ULONG_PTR* cfa) 
DECLSPEC_HIDDEN;
+
+/* rsym.c */
+extern BOOL rsym_parse(struct module* module, unsigned long 
load_offset,
+const void* rsym, int rsymlen) DECLSPEC_HIDDEN;
+
+
 
 /* stack.c */
 #ifndef DBGHELP_STATIC_LIB

Modified: trunk/reactos/dll/win32/dbghelp/pe_module.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dbghelp/pe_module.c?rev=73817=73816=73817=diff
==
--- trunk/reactos/dll/win32/dbghelp/pe_module.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/dbghelp/pe_module.c [iso-8859-1] Fri Feb 17 
16:18:15 2017
@@ -507,6 +507,32 @@
 
 #ifndef DBGHELP_STATIC_LIB
 /**
+ * pe_load_rsym
+ *
+ * look for ReactOS's own rsym format
+ */
+static BOOL pe_load_rsym(struct module* module)
+{
+struct image_file_map*  fmap = 
>format_info[DFI_PE]->u.pe_info->fmap;
+struct image_section_mapsect_rsym;
+BOOLret = FALSE;
+
+if (pe_find_section(fmap, ".rossym", _rsym))
+{
+const char* rsym = image_map_section(_rsym);
+if (rsym != IMAGE_NO_MAP)
+{
+ret = rsym_parse(module, module->module.BaseOfImage,
+ rsym, image_get_map_size(_rsym));
+}
+image_unmap_section(_rsym);
+}
+TRACE("%s the RSYM debug info\n", ret ? "successfully loaded" : "failed to 
load");
+
+return ret;
+}
+
+/**
  * pe_load_dbg_file
  *
  * loads a .dbg file
@@ -704,7 +730,9 @@
 ret = pe_load_dwarf(module) || ret;
 #ifndef DBGHELP_STATIC_LIB
 ret = pe_load_msc_debug_info(pcs, module) || ret;
+ret = pe_load_rsym(module) || ret;
 #endif
+
 ret = ret || pe_load_coff_symbol_table(module); /* FIXME */
 /* if we still have no debug info (we could only get SymExport at this
  * point), then do the SymExport except if we have an ELF container,

Added: trunk/reactos/dll/win32/dbghelp/rsym.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dbghelp/rsym.c?rev=73817
==
--- trunk/reactos/dll/win32/dbghelp/rsym.c  (added)
+++ trunk/reactos/dll/win32/dbghelp/rsym.c  [iso-8859-1] Fri Feb 17 
16:18:15 2017
@@ -0,0 +1,181 @@
+/*
+ * PROJECT: ReactOS dbghelp extension
+ * LICENSE: GPLv2+ - See COPYING in the top level directory
+ * PURPOSE: Parse rsym information for use with dbghelp
+ * PROGRAMMER:  Mark Jansen
+ */
+
+#include "dbghelp_private.h"
+#include 
+
+WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_rsym);
+
+
+typedef struct rsym_file_entry_s
+{
+const char* File;
+unsigned Source;
+} rsym_file_entry_t;
+
+typedef struct rsym_func_entry_s
+{
+ULONG_PTR Address;
+struct symt_function* func;
+struct rsym_func_entry_s* next;
+} rsym_func_entry_t;
+
+
+
+/**
+ * rsym_finalize_function (copied from stabs_finalize_function)
+ *
+ * Ends function creation: mainly:
+ * - cleans 

[ros-diffs] [mjansen] 73825: [GDI32_APITEST] Add tests for GetFontResourceInfoW. Patch by Katayama Hirofumi MZ. CORE-6621

2017-02-18 Thread mjansen
Author: mjansen
Date: Sat Feb 18 11:25:31 2017
New Revision: 73825

URL: http://svn.reactos.org/svn/reactos?rev=73825=rev
Log:
[GDI32_APITEST] Add tests for GetFontResourceInfoW. Patch by Katayama Hirofumi 
MZ. CORE-6621

Added:
trunk/rostests/apitests/gdi32/GetFontResourceInfoW.c   (with props)
Modified:
trunk/rostests/apitests/gdi32/CMakeLists.txt
trunk/rostests/apitests/gdi32/testlist.c

Modified: trunk/rostests/apitests/gdi32/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/CMakeLists.txt?rev=73825=73824=73825=diff
==
--- trunk/rostests/apitests/gdi32/CMakeLists.txt[iso-8859-1] (original)
+++ trunk/rostests/apitests/gdi32/CMakeLists.txt[iso-8859-1] Sat Feb 18 
11:25:31 2017
@@ -44,6 +44,7 @@
 GetCurrentObject.c
 GetDIBColorTable.c
 GetDIBits.c
+GetFontResourceInfoW.c
 GetGlyphIndices.c
 GetObject.c
 GetRandomRgn.c

Added: trunk/rostests/apitests/gdi32/GetFontResourceInfoW.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/GetFontResourceInfoW.c?rev=73825
==
--- trunk/rostests/apitests/gdi32/GetFontResourceInfoW.c(added)
+++ trunk/rostests/apitests/gdi32/GetFontResourceInfoW.c[iso-8859-1] 
Sat Feb 18 11:25:31 2017
@@ -0,0 +1,433 @@
+/*
+ * PROJECT: ReactOS api tests
+ * LICENSE: GPL - See COPYING in the top level directory
+ * PURPOSE: Test for GetFontResourceInfoW
+ * PROGRAMMERS: Katayama Hirofumi MZ <katayama.hirofumi...@gmail.com>
+ */
+#include 
+#include 
+#include 
+#include 
+
+/* GetFontResourceInfoW is undocumented */
+BOOL WINAPI GetFontResourceInfoW(LPCWSTR lpFileName, DWORD *pdwBufSize, void* 
lpBuffer, DWORD dwType);
+
+/* structure of test entry */
+typedef struct GFRI_ENTRY
+{
+LPCWSTR File;
+WCHAR   FontInfo[64];
+INT FontCount;
+WCHAR   FaceNames[10][64];
+} GFRI_ENTRY;
+
+/* test entries */
+static const GFRI_ENTRY TestEntries[] =
+{
+{ L"symbol.ttf", L"Symbol|", 1, { L"Symbol" } },
+{ L"tahoma.ttf", L"Tahoma|", 1, { L"Tahoma" } },
+{ L"tahomabd.ttf", L"Tahoma Bold|", 1, { L"Tahoma" } }
+};
+
+/* Japanese */
+static const GFRI_ENTRY AdditionalTestEntriesJapanese[] =
+{
+{
+/* MS Gothic & MS UI Gothic & MS PGothic */
+L"msgothic.ttc",
+{
+0xFF2D, 0xFF33, 0x0020, 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0x0020,
+0x0026, 0x0020, 0x004D, 0x0053, 0x0020, 0x0055, 0x0049, 0x0020,
+0x0047, 0x006F, 0x0074, 0x0068, 0x0069, 0x0063, 0x0020, 0x0026,
+0x0020, 0xFF2D, 0xFF33, 0x0020, 0xFF30, 0x30B4, 0x30B7, 0x30C3,
+0x30AF, L'|', 0
+},
+6,
+{
+{ 0xFF2D, 0xFF33, 0x0020, 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 },
+{ L'@', 0xFF2D, 0xFF33, 0x0020, 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 
},
+L"MS UI Gothic",
+L"@MS UI Gothic",
+{ 0xFF2D, 0xFF33, 0x0020, 0xFF30, 0x30B4, 0x30B7, 0x30C3, 0x30AF, 
0 },
+{ L'@', 0xFF2D, 0xFF33, 0x0020, 0xFF30, 0x30B4, 0x30B7, 0x30C3, 
0x30AF, 0 }
+}
+}
+};
+
+/* English */
+static const GFRI_ENTRY AdditionalTestEntriesEnglish[] =
+{
+{
+/* MS Gothic & MS UI Gothic & MS PGothic */
+L"msgothic.ttc",
+L"MS Gothic & MS UI Gothic & MS PGothic|",
+6,
+{
+L"MS Gothic",
+L"@MS Gothic",
+L"MS UI Gothic",
+L"@MS UI Gothic",
+L"MS PGothic",
+L"@MS PGothic"
+}
+}
+};
+
+static void
+GetSystemFontDirectory(LPWSTR pszDir)
+{
+GetWindowsDirectoryW(pszDir, MAX_PATH);
+lstrcatW(pszDir, L"\\Fonts");
+}
+
+static void
+GetSystemFontPath(LPWSTR pszPath, LPCWSTR pszFile)
+{
+GetSystemFontDirectory(pszPath);
+lstrcatW(pszPath, L"\\");
+lstrcatW(pszPath, pszFile);
+}
+
+static INT
+GetMultiSzLength(const WCHAR *pszz)
+{
+INT Len, TotalLen = 0;
+for (;;)
+{
+Len = lstrlenW(pszz);
+TotalLen += Len + 1;
+pszz += Len + 1;
+if (*pszz == 0)
+break;
+}
+++TotalLen;
+return TotalLen;
+}
+
+static void
+ReplaceChars(WCHAR *pch, INT Len, WCHAR From, WCHAR To)
+{
+while (Len > 0)
+{
+if (*pch == From)
+{
+*pch = To;
+}
+//printf("0x%04X, ", *pch);
+++pch;
+--Len;
+}
+}
+
+static void
+SzFromMultiSz(WCHAR *pszz)
+{
+INT Length = GetMultiSzLength(pszz);
+//printf("Length: %d\n", Length);
+if (Length > 0)
+{
+ 

[ros-diffs] [mjansen] 73900: [WIN32SS] Rewrite font selection code. Patch by Katayama Hirofumi MZ. CORE-6621 - Adding support for multiple font formats (including collections) - Choosing a font based

2017-02-25 Thread mjansen
Author: mjansen
Date: Sat Feb 25 10:10:25 2017
New Revision: 73900

URL: http://svn.reactos.org/svn/reactos?rev=73900=rev
Log:
[WIN32SS] Rewrite font selection code. Patch by Katayama Hirofumi MZ. CORE-6621
- Adding support for multiple font formats (including collections)
- Choosing a font based on weights as documented
- Adding support for loading fonts from memory
- Share font faces
- Emulation of Italic and Bold
- Support for Underline and Strike-out
- Localized font names
- Fix GetFontResourceInfoW
- Fix Registry settings
- Fix multiple font properties

Modified:
trunk/reactos/win32ss/gdi/eng/engobjects.h
trunk/reactos/win32ss/gdi/gdi32/objects/font.c
trunk/reactos/win32ss/gdi/gdi32/objects/text.c
trunk/reactos/win32ss/gdi/ntgdi/font.c
trunk/reactos/win32ss/gdi/ntgdi/freetype.c
trunk/reactos/win32ss/gdi/ntgdi/text.h

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

Modified: trunk/reactos/win32ss/gdi/eng/engobjects.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/engobjects.h?rev=73900=73899=73900=diff

Modified: trunk/reactos/win32ss/gdi/gdi32/objects/font.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/font.c?rev=73900=73899=73900=diff

Modified: trunk/reactos/win32ss/gdi/gdi32/objects/text.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/text.c?rev=73900=73899=73900=diff

Modified: trunk/reactos/win32ss/gdi/ntgdi/font.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/font.c?rev=73900=73899=73900=diff

Modified: trunk/reactos/win32ss/gdi/ntgdi/freetype.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/freetype.c?rev=73900=73899=73900=diff

Modified: trunk/reactos/win32ss/gdi/ntgdi/text.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/text.h?rev=73900=73899=73900=diff




[ros-diffs] [mjansen] 73906: [OLE32] Fix a crash when executing zz_winrar_3.80_test.exe 4.drag_and_drop CORE-12590 #resolve

2017-02-25 Thread mjansen
Author: mjansen
Date: Sat Feb 25 14:52:16 2017
New Revision: 73906

URL: http://svn.reactos.org/svn/reactos?rev=73906=rev
Log:
[OLE32] Fix a crash when executing zz_winrar_3.80_test.exe 4.drag_and_drop 
CORE-12590 #resolve

Modified:
trunk/reactos/dll/win32/ole32/clipboard.c

Modified: trunk/reactos/dll/win32/ole32/clipboard.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/clipboard.c?rev=73906=73905=73906=diff
==
--- trunk/reactos/dll/win32/ole32/clipboard.c   [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/clipboard.c   [iso-8859-1] Sat Feb 25 
14:52:16 2017
@@ -807,6 +807,9 @@
 
 mem_fmt = *fmt;
 mem_fmt.tymed = TYMED_HGLOBAL;
+#ifdef __REACTOS__
+med.pUnkForRelease = NULL;
+#endif
 
 hr = IDataObject_GetData(data, _fmt, );
 if(FAILED(hr)) return hr;




[ros-diffs] [mjansen] 72418: Addendum to r72417. CORE-11858 #resolve

2016-08-21 Thread mjansen
Author: mjansen
Date: Sun Aug 21 20:07:05 2016
New Revision: 72418

URL: http://svn.reactos.org/svn/reactos?rev=72418=rev
Log:
Addendum to r72417. CORE-11858 #resolve

Modified:
trunk/reactos/win32ss/include/ntuser.h

Modified: trunk/reactos/win32ss/include/ntuser.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/include/ntuser.h?rev=72418=72417=72418=diff
==
--- trunk/reactos/win32ss/include/ntuser.h  [iso-8859-1] (original)
+++ trunk/reactos/win32ss/include/ntuser.h  [iso-8859-1] Sun Aug 21 
20:07:05 2016
@@ -2836,7 +2836,7 @@
 NtUserRegisterClassExWOW(
 WNDCLASSEXW* lpwcx,
 PUNICODE_STRING pustrClassName,
-PUNICODE_STRING pustrCNVersion,
+PUNICODE_STRING pustrCVersion,
 PCLSMENUNAME pClassMenuName,
 DWORD fnID,
 DWORD Flags,




[ros-diffs] [mjansen] 72416: [SHELL32] Partially implement CFolderItems. Thanks to Giannis for the advice :)

2016-08-21 Thread mjansen
Author: mjansen
Date: Sun Aug 21 19:58:32 2016
New Revision: 72416

URL: http://svn.reactos.org/svn/reactos?rev=72416=rev
Log:
[SHELL32] Partially implement CFolderItems. Thanks to Giannis for the advice :)

Modified:
trunk/reactos/dll/win32/shell32/CFolder.cpp
trunk/reactos/dll/win32/shell32/CFolderItems.cpp
trunk/reactos/dll/win32/shell32/CFolderItems.h

Modified: trunk/reactos/dll/win32/shell32/CFolder.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CFolder.cpp?rev=72416=72415=72416=diff
==
--- trunk/reactos/dll/win32/shell32/CFolder.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CFolder.cpp [iso-8859-1] Sun Aug 21 
19:58:32 2016
@@ -82,9 +82,17 @@
 
 HRESULT STDMETHODCALLTYPE CFolder::Items(FolderItems **ppid)
 {
-CFolderItems* item = new CComObject();
-item->AddRef();
-*ppid = item;
+CFolderItems* items = new CComObject();
+items->AddRef();
+
+HRESULT hr = items->Init(ILClone(m_idlist));
+if (FAILED_UNEXPECTEDLY(hr))
+{
+items->Release();
+return hr;
+}
+
+*ppid = items;
 return S_OK;
 }
 

Modified: trunk/reactos/dll/win32/shell32/CFolderItems.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CFolderItems.cpp?rev=72416=72415=72416=diff
==
--- trunk/reactos/dll/win32/shell32/CFolderItems.cpp[iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CFolderItems.cpp[iso-8859-1] Sun Aug 21 
19:58:32 2016
@@ -1,7 +1,7 @@
 /*
  * FolderItem(s) implementation
  *
- * Copyright 2015 Mark Jansen
+ * Copyright 2015,2016 Mark Jansen
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -162,18 +162,65 @@
 
 
 CFolderItems::CFolderItems()
+:m_Count(-1)
 {
 }
 
 CFolderItems::~CFolderItems()
 {
+}
+
+HRESULT CFolderItems::Init(LPITEMIDLIST idlist)
+{
+CComPtr psfDesktop, psfTarget;
+
+m_idlist.Attach(idlist);
+
+HRESULT hr = SHGetDesktopFolder();
+if (FAILED_UNEXPECTEDLY(hr))
+return hr;
+
+hr = psfDesktop->BindToObject(m_idlist, NULL, IID_PPV_ARG(IShellFolder, 
));
+if (FAILED_UNEXPECTEDLY(hr))
+return hr;
+
+hr = psfTarget->EnumObjects(NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, 
_EnumIDList);
+
+if (FAILED_UNEXPECTEDLY(hr))
+return hr;
+
+return S_OK;
 }
 
 // *** FolderItems methods ***
 HRESULT STDMETHODCALLTYPE CFolderItems::get_Count(long *plCount)
 {
-TRACE("(%p, %p)\n", this, plCount);
-return E_NOTIMPL;
+if (!m_EnumIDList)
+return E_FAIL;
+
+if (!plCount)
+return E_POINTER;
+
+if (m_Count == -1)
+{
+long count = 0;
+
+HRESULT hr = m_EnumIDList->Reset();
+if (FAILED_UNEXPECTEDLY(hr))
+return hr;
+
+CComHeapPtr Pidl;
+hr = m_EnumIDList->Next(1, , 0);
+while (hr != S_FALSE)
+{
+count++;
+Pidl.Free();
+}
+m_Count = count;
+}
+*plCount = m_Count;
+
+return S_OK;
 }
 
 HRESULT STDMETHODCALLTYPE CFolderItems::get_Application(IDispatch **ppid)
@@ -190,13 +237,43 @@
 
 HRESULT STDMETHODCALLTYPE CFolderItems::Item(VARIANT index, FolderItem **ppid)
 {
-TRACE("(%p, %s, %p)\n", this, wine_dbgstr_variant(), ppid);
-return E_NOTIMPL;
+if (!m_EnumIDList)
+return E_FAIL;
+
+if (V_VT() != VT_I4 && V_VT() != VT_UI4)
+return E_INVALIDARG;
+
+ULONG count = V_UI4();
+
+HRESULT hr = m_EnumIDList->Reset();
+if (FAILED_UNEXPECTEDLY(hr))
+return hr;
+
+hr = m_EnumIDList->Skip(count);
+
+if (FAILED_UNEXPECTEDLY(hr))
+return hr;
+
+CComHeapPtr spPidl;
+hr = m_EnumIDList->Next(1, , 0);
+if (hr == S_OK)
+{
+CFolderItem* item = new CComObject();
+item->AddRef();
+item->Init(spPidl.Detach());
+*ppid = item;
+return S_OK;
+}
+
+return hr;
 }
 
 HRESULT STDMETHODCALLTYPE CFolderItems::_NewEnum(IUnknown **ppunk)
 {
-TRACE("(%p, %p)\n", this, ppunk);
-return E_NOTIMPL;
-}
-
+CFolderItems* items = new CComObject();
+items->AddRef();
+items->Init(ILClone(m_idlist));
+*ppunk = items;
+return S_OK;
+}
+

Modified: trunk/reactos/dll/win32/shell32/CFolderItems.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CFolderItems.h?rev=72416=72415=72416=diff
==
--- trunk/reactos/dll/win32/shell32/CFolderItems.h  [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CFolderItems.h  [iso-8859-1] Sun Aug 21 
19:58:32 2016
@@ -34,6 +34,7 @@
 CFolderItem();
 ~CFolderItem();
 
+// Ple

[ros-diffs] [mjansen] 72414: [WIN32SS] Implement windows class versioning, by Sylvain Deverre. CORE-11858 #comment Committed, thanks!

2016-08-21 Thread mjansen
Author: mjansen
Date: Sun Aug 21 18:28:33 2016
New Revision: 72414

URL: http://svn.reactos.org/svn/reactos?rev=72414=rev
Log:
[WIN32SS] Implement windows class versioning, by Sylvain Deverre. CORE-11858 
#comment Committed, thanks!

Modified:
trunk/reactos/win32ss/user/ntuser/class.c
trunk/reactos/win32ss/user/ntuser/window.c
trunk/reactos/win32ss/user/user32/windows/class.c
trunk/reactos/win32ss/user/user32/windows/window.c

Modified: trunk/reactos/win32ss/user/ntuser/class.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/class.c?rev=72414=72413=72414=diff
==
--- trunk/reactos/win32ss/user/ntuser/class.c   [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/class.c   [iso-8859-1] Sun Aug 21 
18:28:33 2016
@@ -255,6 +255,9 @@
 // comparisons, remove registration of the atom if not zeroed.
 if (Class->atomClassName)
 IntDeregisterClassAtom(Class->atomClassName);
+// Dereference non-versioned class name
+if (Class->atomNVClassName)
+IntDeregisterClassAtom(Class->atomNVClassName);
 
 if (Class->pdce)
 {
@@ -423,22 +426,37 @@
 
 /* Update the base class first */
 Class = Class->pclsBase;
-
-if (!IntRegisterClassAtom(ClassName,
-  ))
-{
-return FALSE;
-}
-
-IntDeregisterClassAtom(Class->atomClassName);
-
-Class->atomClassName = Atom;
+if (ClassName->Length > 0)
+{
+if (!IntRegisterClassAtom(ClassName,
+  ))
+{
+ERR("RegisterClassAtom failed ! %x\n", EngGetLastError());
+return FALSE;
+}
+}
+else
+{
+if (IS_ATOM(ClassName->Buffer))
+{
+Atom = (ATOM)((ULONG_PTR)ClassName->Buffer & 0x); // XXX: are 
we missing refcount here ?
+}
+else
+{
+EngSetLastError(ERROR_INVALID_PARAMETER);
+return FALSE;
+}
+}
+
+IntDeregisterClassAtom(Class->atomNVClassName);
+
+Class->atomNVClassName = Atom;
 
 /* Update the clones */
 Class = Class->pclsClone;
 while (Class != NULL)
 {
-Class->atomClassName = Atom;
+Class->atomNVClassName = Atom;
 
 Class = Class->pclsNext;
 }
@@ -1000,6 +1018,7 @@
 FASTCALL
 IntCreateClass(IN CONST WNDCLASSEXW* lpwcx,
IN PUNICODE_STRING ClassName,
+   IN PUNICODE_STRING ClassVersion,
IN PUNICODE_STRING MenuName,
IN DWORD fnID,
IN DWORD dwFlags,
@@ -1008,7 +1027,7 @@
 {
 SIZE_T ClassSize;
 PCLS Class = NULL;
-RTL_ATOM Atom;
+RTL_ATOM Atom, verAtom;
 WNDPROC WndProc;
 PWSTR pszMenuName = NULL;
 NTSTATUS Status = STATUS_SUCCESS;
@@ -1020,6 +1039,14 @@
   ))
 {
 ERR("Failed to register class atom!\n");
+return NULL;
+}
+
+if (!IntRegisterClassAtom(ClassVersion,
+  ))
+{
+ERR("Failed to register version class atom!\n");
+IntDeregisterClassAtom(Atom);
 return NULL;
 }
 
@@ -1054,7 +1081,8 @@
 
 Class->rpdeskParent = Desktop;
 Class->pclsBase = Class;
-Class->atomClassName = Atom;
+Class->atomClassName = verAtom;
+Class->atomNVClassName = Atom;
 Class->fnid = fnID;
 Class->CSF_flags = dwFlags;
 
@@ -1181,6 +1209,7 @@
 Class);
 Class = NULL;
 
+IntDeregisterClassAtom(verAtom);
 IntDeregisterClassAtom(Atom);
 }
 }
@@ -1193,12 +1222,13 @@
 UserHeapFree(pszMenuName);
 
 IntDeregisterClassAtom(Atom);
+IntDeregisterClassAtom(verAtom);
 
 EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
 }
 
-TRACE("Created class 0x%p with name %wZ and proc 0x%p for atom 0x%x and 
hInstance 0x%p, global %u\n",
-Class, ClassName, Class->lpfnWndProc, Atom, Class->hModule, 
Class->Global);
+TRACE("Created class 0x%p with name %wZ and proc 0x%p for atom 0x%x and 
version atom 0x%x and hInstance 0x%p, global %u\n",
+Class, ClassName, Class->lpfnWndProc, Atom, verAtom, 
Class->hModule, Class->Global);
 
 return Class;
 }
@@ -1429,6 +1459,7 @@
 RTL_ATOM
 UserRegisterClass(IN CONST WNDCLASSEXW* lpwcx,
   IN PUNICODE_STRING ClassName,
+  IN PUNICODE_STRING ClassVersion,
   IN PUNICODE_STRING MenuName,
   IN DWORD fnID,
   IN DWORD dwFlags)
@@ -1446,7 +1477,7 @@
 pi = pti->ppi;
 
 // Need only to test for two conditions not four... Fix more whine 
tests
-if ( IntGetAtomFro

[ros-diffs] [mjansen] 72415: [SHELL32] Fix a crash in shell32:shelldispatch by returning an empty CFolderItems object instead of nothing.

2016-08-21 Thread mjansen
Author: mjansen
Date: Sun Aug 21 18:48:48 2016
New Revision: 72415

URL: http://svn.reactos.org/svn/reactos?rev=72415=rev
Log:
[SHELL32] Fix a crash in shell32:shelldispatch by returning an empty 
CFolderItems object instead of nothing.

Modified:
trunk/reactos/dll/win32/shell32/CFolder.cpp

Modified: trunk/reactos/dll/win32/shell32/CFolder.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CFolder.cpp?rev=72415=72414=72415=diff
==
--- trunk/reactos/dll/win32/shell32/CFolder.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CFolder.cpp [iso-8859-1] Sun Aug 21 
18:48:48 2016
@@ -82,8 +82,10 @@
 
 HRESULT STDMETHODCALLTYPE CFolder::Items(FolderItems **ppid)
 {
-TRACE("(%p, %p)\n", this, ppid);
-return E_NOTIMPL;
+CFolderItems* item = new CComObject();
+item->AddRef();
+*ppid = item;
+return S_OK;
 }
 
 HRESULT STDMETHODCALLTYPE CFolder::ParseName(BSTR bName, FolderItem **ppid)




  1   2   3   4   >