[ros-diffs] [hbelusca] 71452: [DESK.CPL] - Remove redundant UI elements in the "Advanced appearance" dialog. - Add the possibility to modify the colors of inactive caption bar text and flat menu highl

2016-05-28 Thread hbelusca
Author: hbelusca
Date: Sun May 29 00:57:31 2016
New Revision: 71452

URL: http://svn.reactos.org/svn/reactos?rev=71452&view=rev
Log:
[DESK.CPL]
- Remove redundant UI elements in the "Advanced appearance" dialog.
- Add the possibility to modify the colors of inactive caption bar text and 
flat menu highlight (for XP/2k3+ only).

Modified:
trunk/reactos/dll/cpl/desk/advappdlg.c
trunk/reactos/dll/cpl/desk/appearance.h
trunk/reactos/dll/cpl/desk/lang/bg-BG.rc
trunk/reactos/dll/cpl/desk/lang/cs-CZ.rc
trunk/reactos/dll/cpl/desk/lang/de-DE.rc
trunk/reactos/dll/cpl/desk/lang/el-GR.rc
trunk/reactos/dll/cpl/desk/lang/en-US.rc
trunk/reactos/dll/cpl/desk/lang/es-ES.rc
trunk/reactos/dll/cpl/desk/lang/fr-FR.rc
trunk/reactos/dll/cpl/desk/lang/he-IL.rc
trunk/reactos/dll/cpl/desk/lang/hu-HU.rc
trunk/reactos/dll/cpl/desk/lang/id-ID.rc
trunk/reactos/dll/cpl/desk/lang/it-IT.rc
trunk/reactos/dll/cpl/desk/lang/ja-JP.rc
trunk/reactos/dll/cpl/desk/lang/nl-NL.rc
trunk/reactos/dll/cpl/desk/lang/no-NO.rc
trunk/reactos/dll/cpl/desk/lang/pl-PL.rc
trunk/reactos/dll/cpl/desk/lang/pt-BR.rc
trunk/reactos/dll/cpl/desk/lang/ro-RO.rc
trunk/reactos/dll/cpl/desk/lang/ru-RU.rc
trunk/reactos/dll/cpl/desk/lang/sk-SK.rc
trunk/reactos/dll/cpl/desk/lang/sq-AL.rc
trunk/reactos/dll/cpl/desk/lang/sv-SE.rc
trunk/reactos/dll/cpl/desk/lang/tr-TR.rc
trunk/reactos/dll/cpl/desk/lang/uk-UA.rc
trunk/reactos/dll/cpl/desk/lang/zh-CN.rc
trunk/reactos/dll/cpl/desk/lang/zh-TW.rc
trunk/reactos/dll/cpl/desk/resource.h

Modified: trunk/reactos/dll/cpl/desk/advappdlg.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/advappdlg.c?rev=71452&r1=71451&r2=71452&view=diff
==
--- trunk/reactos/dll/cpl/desk/advappdlg.c  [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/advappdlg.c  [iso-8859-1] Sun May 29 
00:57:31 2016
@@ -28,27 +28,24 @@
 const ASSIGNMENT g_Assignment[NUM_ELEMENTS] =
 {
 {-1, -1, COLOR_DESKTOP,   -1,  
   -1,  -1}, /* Desktop */
-{SIZE_CAPTION_HEIGHT,-1, COLOR_INACTIVECAPTION,   
COLOR_GRADIENTINACTIVECAPTION,  FONT_CAPTION,-1}, /* 
inactive window caption */
+{SIZE_CAPTION_HEIGHT,-1, COLOR_INACTIVECAPTION,   
COLOR_GRADIENTINACTIVECAPTION,  FONT_CAPTION,COLOR_INACTIVECAPTIONTEXT},/* 
inactive window caption */
 {SIZE_BORDER_WIDTH,  -1, COLOR_INACTIVEBORDER,-1,  
   -1,  -1}, /* inactive 
window border */
 {SIZE_CAPTION_HEIGHT,-1, COLOR_ACTIVECAPTION, 
COLOR_GRADIENTACTIVECAPTION,FONT_CAPTION,COLOR_CAPTIONTEXT},  /* active 
window caption */
 {SIZE_BORDER_WIDTH,  -1, COLOR_ACTIVEBORDER,  -1,  
   -1,  -1}, /* active 
window border */
-{SIZE_MENU_HEIGHT,   SIZE_MENU_WIDTH,COLOR_MENU,  -1,  
   FONT_MENU,   COLOR_MENUTEXT}, /* menu */
+{SIZE_MENU_HEIGHT,   SIZE_MENU_WIDTH,COLOR_MENU,  
COLOR_MENUHILIGHT,  FONT_MENU,   COLOR_MENUTEXT}, /* menu */
 {SIZE_MENU_HEIGHT,   SIZE_MENU_WIDTH,COLOR_HIGHLIGHT, -1,  
   -1,  COLOR_HIGHLIGHTTEXT},/* marked 
element */
 {-1, -1, COLOR_WINDOW,-1 
/*COLOR_WINDOWFRAME*/,   -1,  COLOR_WINDOWTEXT},   /* window */
 {SIZE_SCROLL_WIDTH,  SIZE_SCROLL_HEIGHT, COLOR_SCROLLBAR, -1,  
   -1,  -1}, /* scroll bar 
*/
 {-1, -1, COLOR_3DFACE,-1,  
   -1,  COLOR_BTNTEXT},  /* 3d objects 
*/
-{SIZE_SM_CAPTION_HEIGHT, -1, -1,  -1,  
   FONT_SMCAPTION,  -1}, /* palette 
window caption */
-{-1, -1, -1,  -1,  
   -1,  -1}, /* symbol 
caption -- FIXME: Access? */
-{SIZE_CAPTION_HEIGHT,-1, -1,  -1,  
   -1,  -1}, /* caption bar 
*/
-{-1, -1, -1,  -1,  
   -1,  COLOR_GRAYTEXT}, /* inactive 
menu item -- FIXME: Access? */
+{SIZE_SM_CAPTION_HEIGHT, -1, -1,  -1,  
   FONT_SMCAPTION,  -1}, /* palette 
(small) window caption */
+{SIZE_CAP

[ros-diffs] [ekohl] 71451: [MSPAINT] Update russian translation Patch by BinaryTree CORE-10740 #resolve #comment Thanks a lot!

2016-05-28 Thread ekohl
Author: ekohl
Date: Sat May 28 22:40:34 2016
New Revision: 71451

URL: http://svn.reactos.org/svn/reactos?rev=71451&view=rev
Log:
[MSPAINT]
Update russian translation
Patch by BinaryTree
CORE-10740 #resolve #comment Thanks a lot!

Modified:
trunk/reactos/base/applications/mspaint/lang/ru-RU.rc

Modified: trunk/reactos/base/applications/mspaint/lang/ru-RU.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/lang/ru-RU.rc?rev=71451&r1=71450&r2=71451&view=diff
==
--- trunk/reactos/base/applications/mspaint/lang/ru-RU.rc   [iso-8859-1] 
(original)
+++ trunk/reactos/base/applications/mspaint/lang/ru-RU.rc   [iso-8859-1] 
Sat May 28 22:40:34 2016
@@ -210,5 +210,5 @@
 IDS_PERCENTAGE, "Процент должен быть в 
интервале от 1 до 500."
 IDS_ANGLE, "Угол должен быть в интервале от -89 
до 89."
 IDS_LOADERRORTEXT, "Невозможно загрузить файл %s."
-IDS_ENLARGEPROMPTTEXT "The image in the clipboard is larger than the 
bitmap.\nWould you like the bitmap enlarged?"
-END
+IDS_ENLARGEPROMPTTEXT "Изображения в буфере обмена 
больше растрового изображения.\nХотите 
увеличить точечный рисунок?"
+END




[ros-diffs] [hbelusca] 71450: [DESK.CPL] - Fix french translation; - Whitespace fix.

2016-05-28 Thread hbelusca
Author: hbelusca
Date: Sat May 28 22:05:48 2016
New Revision: 71450

URL: http://svn.reactos.org/svn/reactos?rev=71450&view=rev
Log:
[DESK.CPL]
- Fix french translation;
- Whitespace fix.

Modified:
trunk/reactos/dll/cpl/desk/advappdlg.c
trunk/reactos/dll/cpl/desk/lang/fr-FR.rc

Modified: trunk/reactos/dll/cpl/desk/advappdlg.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/advappdlg.c?rev=71450&r1=71449&r2=71450&view=diff
==
--- trunk/reactos/dll/cpl/desk/advappdlg.c  [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/advappdlg.c  [iso-8859-1] Sat May 28 
22:05:48 2016
@@ -24,30 +24,32 @@
 
 /* This const assigns the color and metric numbers to the elements from the 
elements list */
 
-/* Size 1 (width)  Size 2 (height) Color 1  Color 
2 Font Fontcolor */
+/*   Size 1 (width)  Size 2 (height) Color 1  
Color 2 Font Fontcolor */
 const ASSIGNMENT g_Assignment[NUM_ELEMENTS] =
-{ {-1, -1, COLOR_DESKTOP,   -1,
 -1,  -1},/* -Desktop */
-  {SIZE_CAPTION_HEIGHT,-1, COLOR_INACTIVECAPTION,   
COLOR_GRADIENTINACTIVECAPTION,  FONT_CAPTION,-1},/* 
inactive window caption */
-  {SIZE_BORDER_WIDTH,  -1, COLOR_INACTIVEBORDER,-1,
 -1,  -1},  /* inactive 
window border */
-  {SIZE_CAPTION_HEIGHT,-1, COLOR_ACTIVECAPTION, 
COLOR_GRADIENTACTIVECAPTION,FONT_CAPTION,COLOR_CAPTIONTEXT},/* 
-active window caption */
-  {SIZE_BORDER_WIDTH,  -1, COLOR_ACTIVEBORDER,  -1,
 -1,  -1},/* active window 
border */
-  {SIZE_MENU_HEIGHT,   SIZE_MENU_WIDTH,COLOR_MENU,  -1,
 FONT_MENU,   COLOR_MENUTEXT},/* menu */
-  {SIZE_MENU_HEIGHT,   SIZE_MENU_WIDTH,COLOR_HIGHLIGHT, -1,
 -1,  COLOR_HIGHLIGHTTEXT},/* marked 
element */
-  {-1, -1, COLOR_WINDOW,-1 
/*COLOR_WINDOWFRAME*/,   -1,  COLOR_WINDOWTEXT},/* window */
-  {SIZE_SCROLL_WIDTH,  SIZE_SCROLL_HEIGHT, COLOR_SCROLLBAR, -1,
 -1,  -1},/* scroll bar */
-  {-1, -1, COLOR_3DFACE,-1,
 -1,  COLOR_BTNTEXT},/* 3d objects 
*/
-  {SIZE_SM_CAPTION_HEIGHT, -1, -1,  -1,
 FONT_SMCAPTION,  -1},/* palette window 
caption */
-  {-1, -1, -1,  -1,
 -1,  -1},/* symbol caption 
FIXME: Access? */
-  {SIZE_CAPTION_HEIGHT,-1, -1,  -1,
 -1,  -1},/* caption bar */
-  {-1, -1, -1,  -1,
 -1,  COLOR_GRAYTEXT},/* inactive menu 
item FIXME: Access? */
-  {-1, -1, -1,  -1,
 FONT_MESSAGE,COLOR_WINDOWTEXT},/* dialog */
-  {-1, -1, -1,  -1,
 -1,  -1},/* scrollbar 
controls FIXME: Access? */
-  {-1, -1, COLOR_APPWORKSPACE,  -1,
 -1,  -1},/* application 
background */
-  {-1, -1, -1,  -1,
 -1,  -1},/* small caption 
bar FIXME: Access? */
-  {SIZE_ICON_SPACE_X,  -1, -1,  -1,
 -1,  -1},/* symbol 
distance horiz. */
-  {SIZE_ICON_SPACE_Y,  -1, -1,  -1,
 -1,  -1},/* symbol 
distance vert. */
-  {-1, -1, COLOR_INFOBK,-1,
 FONT_STATUS, COLOR_INFOTEXT},/* quickinfo */
-  {SIZE_ICON,  -1, -1,  -1,
 FONT_ICON,   -1}};/* symbol */
+{
+{-1, -1, COLOR_DESKTOP,   -1,  
   -1,  -1}, /* D

[ros-diffs] [ekohl] 71449: [SERVICES] Prepare service logon.

2016-05-28 Thread ekohl
Author: ekohl
Date: Sat May 28 21:56:56 2016
New Revision: 71449

URL: http://svn.reactos.org/svn/reactos?rev=71449&view=rev
Log:
[SERVICES]
Prepare service logon.

Modified:
trunk/reactos/base/system/services/database.c
trunk/reactos/base/system/services/rpcserver.c
trunk/reactos/base/system/services/services.h

Modified: trunk/reactos/base/system/services/database.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/database.c?rev=71449&r1=71448&r2=71449&view=diff
==
--- trunk/reactos/base/system/services/database.c   [iso-8859-1] (original)
+++ trunk/reactos/base/system/services/database.c   [iso-8859-1] Sat May 28 
21:56:56 2016
@@ -140,9 +140,9 @@
 CurrentImage = CONTAINING_RECORD(ImageEntry,
  SERVICE_IMAGE,
  ImageListEntry);
-if (_wcsicmp(CurrentImage->szImagePath, lpImagePath) == 0)
-{
-DPRINT("Found image: '%S'\n", CurrentImage->szImagePath);
+if (_wcsicmp(CurrentImage->pszImagePath, lpImagePath) == 0)
+{
+DPRINT("Found image: '%S'\n", CurrentImage->pszImagePath);
 return CurrentImage;
 }
 
@@ -153,21 +153,114 @@
 
 return NULL;
 
+}
+
+
+static
+BOOL
+ScmIsSameServiceAccount(
+IN PWSTR pszAccountName1,
+IN PWSTR pszAccountName2)
+{
+if ((pszAccountName1 == NULL && pszAccountName2 == NULL) ||
+(pszAccountName1 == NULL && wcscmp(pszAccountName2, L"LocalSystem") == 
0) ||
+(pszAccountName2 == NULL && wcscmp(pszAccountName1, L"LocalSystem") == 
0) ||
+(wcscmp(pszAccountName1, pszAccountName2) == 0))
+return TRUE;
+
+return FALSE;
+}
+
+
+static
+BOOL
+ScmIsLocalSystemAccount(
+IN PWSTR pszAccountName)
+{
+if (pszAccountName == NULL ||
+wcscmp(pszAccountName, L"LocalSystem") == 0)
+return TRUE;
+
+return FALSE;
+}
+
+
+static
+DWORD
+ScmLogonService(
+IN PSERVICE pService,
+IN PSERVICE_IMAGE pImage)
+{
+PWSTR pUserName = NULL;
+PWSTR pDomainName = NULL;
+PWSTR ptr;
+DWORD dwError = ERROR_SUCCESS;
+
+DPRINT("ScmLogonService()\n");
+
+DPRINT("Service %S\n", pService->lpServiceName);
+
+if (ScmIsLocalSystemAccount(pImage->pszAccountName))
+return ERROR_SUCCESS;
+
+ptr = wcschr(pImage->pszAccountName, L'\\');
+if (ptr != NULL)
+{
+*ptr = 0;
+
+pUserName = ptr + 1;
+pDomainName = pImage->pszAccountName;
+}
+else
+{
+pUserName = pImage->pszAccountName;
+pDomainName = NULL;
+}
+
+if (pDomainName == NULL || wcscmp(pDomainName, L".") == 0)
+{
+// pDomainName = computer name
+}
+
+DPRINT("Domain: %S  User: %S\n", pDomainName, pUserName);
+
+/* FIXME */
+#if 0
+if (!LogonUserW(pUserName,
+pDomainName,
+L"", // lpszPassword,
+LOGON32_LOGON_SERVICE,
+LOGON32_PROVIDER_DEFAULT,
+&pImage->hToken))
+{
+dwError = GetLastError();
+DPRINT1("LogonUserW() failed (Error %lu)\n", dwError);
+}
+#endif
+
+if (ptr != NULL)
+*ptr = L'\\';
+
+return dwError;
 }
 
 
 static DWORD
 ScmCreateOrReferenceServiceImage(PSERVICE pService)
 {
-RTL_QUERY_REGISTRY_TABLE QueryTable[2];
+RTL_QUERY_REGISTRY_TABLE QueryTable[3];
 UNICODE_STRING ImagePath;
+UNICODE_STRING ObjectName;
 PSERVICE_IMAGE pServiceImage = NULL;
 NTSTATUS Status;
 DWORD dwError = ERROR_SUCCESS;
+DWORD dwRecordSize;
+LPWSTR pString;
 
 DPRINT("ScmCreateOrReferenceServiceImage(%p)\n", pService);
 
 RtlInitUnicodeString(&ImagePath, NULL);
+RtlInitUnicodeString(&ObjectName, NULL);
 
 /* Get service data */
 RtlZeroMemory(&QueryTable,
@@ -176,6 +269,9 @@
 QueryTable[0].Name = L"ImagePath";
 QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT | 
RTL_QUERY_REGISTRY_REQUIRED;
 QueryTable[0].EntryContext = &ImagePath;
+QueryTable[1].Name = L"ObjectName";
+QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT;
+QueryTable[1].EntryContext = &ObjectName;
 
 Status = RtlQueryRegistryValues(RTL_REGISTRY_SERVICES,
 pService->lpServiceName,
@@ -189,14 +285,19 @@
 }
 
 DPRINT("ImagePath: '%wZ'\n", &ImagePath);
+DPRINT("ObjectName: '%wZ'\n", &ObjectName);
 
 pServiceImage = ScmGetServiceImageByImagePath(ImagePath.Buffer);
 if (pServiceImage == NULL)
 {
+dwRecordSize = sizeof(SERVICE_IMAGE) +
+   ImagePath.Length + sizeof(WCHAR) +
+   ((ObjectName.Length != 0) ? (ObjectName.Length + 
sizeof(WCHAR)) : 0);
+
 /* Create a new service image */
 pServiceImage = HeapAlloc(GetProcessHeap(),
   HEAP_ZERO_MEMORY,
-

[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&view=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&r1=71447&r2=71448&view=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&r1=71447&r2=71448&view=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, 

[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&view=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&r1=71446&r2=71447&view=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&r1=71446&r2=71447&view=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&r1=71446&r2=71447&view=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 == 0, "Expected Libraray

[ros-diffs] [hbelusca] 71446: [FREELDR]: Usability fix: When pressing F8 (Advanced boot options menu), select "Start ReactOS normally" by default.

2016-05-28 Thread hbelusca
Author: hbelusca
Date: Sat May 28 20:21:11 2016
New Revision: 71446

URL: http://svn.reactos.org/svn/reactos?rev=71446&view=rev
Log:
[FREELDR]: Usability fix: When pressing F8 (Advanced boot options menu), select 
"Start ReactOS normally" by default.

Modified:
trunk/reactos/boot/freeldr/freeldr/options.c

Modified: trunk/reactos/boot/freeldr/freeldr/options.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/options.c?rev=71446&r1=71445&r2=71446&view=diff
==
--- trunk/reactos/boot/freeldr/freeldr/options.c[iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/options.c[iso-8859-1] Sat May 28 
20:21:11 2016
@@ -96,7 +96,8 @@
TRUE,
OptionsMenuList,
OptionsMenuItemCount,
-   0, -1,
+   11, // Use "Start ReactOS normally" as default; see the 
switch below.
+   -1,
&SelectedMenuItem,
TRUE,
NULL))




[ros-diffs] [pschweitzer] 71445: [KMTESTS:CC] Introduce tests for Cc :-) Currently, we only test CcCopyRead for specific alignment matters. It shows that under certain conditions, our Cc doesn't align

2016-05-28 Thread pschweitzer
Author: pschweitzer
Date: Sat May 28 19:59:10 2016
New Revision: 71445

URL: http://svn.reactos.org/svn/reactos?rev=71445&view=rev
Log:
[KMTESTS:CC]
Introduce tests for Cc :-)
Currently, we only test CcCopyRead for specific alignment matters. It shows 
that under certain conditions, our Cc doesn't align reads it does, leading to 
later failure in disk.sys.
This reproduces an error observed with MS FastFAT in ReactOS.

CORE-11003

Added:
trunk/rostests/kmtests/ntos_cc/
trunk/rostests/kmtests/ntos_cc/CMakeLists.txt   (with props)
trunk/rostests/kmtests/ntos_cc/CcCopyRead_drv.c   (with props)
trunk/rostests/kmtests/ntos_cc/CcCopyRead_user.c   (with props)
Modified:
trunk/rostests/kmtests/CMakeLists.txt
trunk/rostests/kmtests/kmtest/testlist.c

Modified: trunk/rostests/kmtests/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/CMakeLists.txt?rev=71445&r1=71444&r2=71445&view=diff
==
--- trunk/rostests/kmtests/CMakeLists.txt   [iso-8859-1] (original)
+++ trunk/rostests/kmtests/CMakeLists.txt   [iso-8859-1] Sat May 28 
19:59:10 2016
@@ -6,6 +6,7 @@
 #
 add_subdirectory(example)
 add_subdirectory(kernel32)
+add_subdirectory(ntos_cc)
 add_subdirectory(ntos_io)
 add_subdirectory(ntos_po)
 add_subdirectory(tcpip)
@@ -118,6 +119,7 @@
 
 example/Example_user.c
 kernel32/FindFile_user.c
+ntos_cc/CcCopyRead_user.c
 ntos_io/IoCreateFile_user.c
 ntos_io/IoDeviceObject_user.c
 ntos_io/IoReadWrite_user.c

Modified: trunk/rostests/kmtests/kmtest/testlist.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/kmtest/testlist.c?rev=71445&r1=71444&r2=71445&view=diff
==
--- trunk/rostests/kmtests/kmtest/testlist.c[iso-8859-1] (original)
+++ trunk/rostests/kmtests/kmtest/testlist.c[iso-8859-1] Sat May 28 
19:59:10 2016
@@ -7,6 +7,7 @@
 
 #include 
 
+KMT_TESTFUNC Test_CcCopyRead;
 KMT_TESTFUNC Test_Example;
 KMT_TESTFUNC Test_FindFile;
 KMT_TESTFUNC Test_IoCreateFile;
@@ -27,6 +28,7 @@
 /* tests with a leading '-' will not be listed */
 const KMT_TEST TestList[] =
 {
+{ "CcCopyRead", Test_CcCopyRead },
 { "-Example",   Test_Example },
 { "FindFile",   Test_FindFile },
 { "IoCreateFile",   Test_IoCreateFile },

Added: trunk/rostests/kmtests/ntos_cc/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_cc/CMakeLists.txt?rev=71445
==
--- trunk/rostests/kmtests/ntos_cc/CMakeLists.txt   (added)
+++ trunk/rostests/kmtests/ntos_cc/CMakeLists.txt   [iso-8859-1] Sat May 28 
19:59:10 2016
@@ -0,0 +1,17 @@
+
+include_directories(../include)
+
+#
+# IoCreateFile
+#
+list(APPEND CCCOPYREAD_DRV_SOURCE
+../kmtest_drv/kmtest_standalone.c
+CcCopyRead_drv.c)
+
+add_library(cccopyread_drv SHARED ${CCCOPYREAD_DRV_SOURCE})
+set_module_type(cccopyread_drv kernelmodedriver)
+target_link_libraries(cccopyread_drv kmtest_printf ${PSEH_LIB})
+add_importlibs(cccopyread_drv ntoskrnl hal)
+add_target_compile_definitions(cccopyread_drv KMT_STANDALONE_DRIVER)
+#add_pch(cccopyread_drv ../include/kmt_test.h)
+add_cd_file(TARGET cccopyread_drv DESTINATION reactos/bin FOR all)

Propchange: trunk/rostests/kmtests/ntos_cc/CMakeLists.txt
--
svn:eol-style = native

Added: trunk/rostests/kmtests/ntos_cc/CcCopyRead_drv.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_cc/CcCopyRead_drv.c?rev=71445
==
--- trunk/rostests/kmtests/ntos_cc/CcCopyRead_drv.c (added)
+++ trunk/rostests/kmtests/ntos_cc/CcCopyRead_drv.c [iso-8859-1] Sat May 28 
19:59:10 2016
@@ -0,0 +1,272 @@
+/*
+ * PROJECT: ReactOS kernel-mode tests
+ * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
+ * PURPOSE: Test driver for CcCopyRead function
+ * PROGRAMMER:  Pierre Schweitzer 
+ */
+
+#include 
+
+#define NDEBUG
+#include 
+
+typedef struct _TEST_FCB
+{
+FSRTL_ADVANCED_FCB_HEADER Header;
+SECTION_OBJECT_POINTERS SectionObjectPointers;
+FAST_MUTEX HeaderMutex;
+} TEST_FCB, *PTEST_FCB;
+
+static PFILE_OBJECT TestFileObject;
+static PDEVICE_OBJECT TestDeviceObject;
+static KMT_IRP_HANDLER TestIrpHandler;
+static FAST_IO_DISPATCH TestFastIoDispatch;
+
+static
+BOOLEAN
+NTAPI
+FastIoRead(
+_In_ PFILE_OBJECT FileObject,
+_In_ PLARGE_INTEGER FileOffset,
+_In_ ULONG Length,
+_In_ BOOLEAN Wait,
+_In_ ULONG LockKey,
+_Out_ PVOID Buffer,
+_Out_ PIO_STATUS_BLOCK IoStatus,
+_In_ PDEVICE_OBJECT DeviceObject)
+{
+IoStatus->Status = STATUS_NOT_SUPPORTED;
+return FALSE;
+}
+
+NTSTATUS
+TestEntry(
+_In_ PDRIVER_OBJECT DriverObject,

[ros-diffs] [hbelusca] 71444: [WIN32K]: Whitespace fix only.

2016-05-28 Thread hbelusca
Author: hbelusca
Date: Sat May 28 19:48:44 2016
New Revision: 71444

URL: http://svn.reactos.org/svn/reactos?rev=71444&view=rev
Log:
[WIN32K]: Whitespace fix only.

Modified:
trunk/reactos/win32ss/user/ntuser/desktop.c

Modified: trunk/reactos/win32ss/user/ntuser/desktop.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/desktop.c?rev=71444&r1=71443&r2=71444&view=diff
==
--- trunk/reactos/win32ss/user/ntuser/desktop.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/desktop.c [iso-8859-1] Sat May 28 
19:48:44 2016
@@ -60,7 +60,7 @@
 UNICODE_STRING DesktopName;
 PBOOLEAN pContext = (PBOOLEAN) Context;
 
-if(pContext)
+if (pContext)
 *pContext = FALSE;
 
 /* Set the list pointers and loop the window station */
@@ -111,7 +111,7 @@
 NextEntry = NextEntry->Flink;
 }
 
-/* If we got here but this isn't a create, then fail */
+/* If we got here but this isn't a create, just fail */
 if (!Context) return STATUS_OBJECT_NAME_NOT_FOUND;
 
 /* Create the desktop object */
@@ -180,14 +180,14 @@
 PWIN32_OKAYTOCLOSEMETHOD_PARAMETERS OkToCloseParameters = Parameters;
 PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
 
-if( pti == NULL)
+if (pti == NULL)
 {
 /* This happens when we leak desktop handles */
 return STATUS_SUCCESS;
 }
 
 /* Do not allow the current desktop or the initial desktop to be closed */
-if( OkToCloseParameters->Handle == pti->ppi->hdeskStartup ||
+if (OkToCloseParameters->Handle == pti->ppi->hdeskStartup ||
 OkToCloseParameters->Handle == pti->hdesk)
 {
 return STATUS_ACCESS_DENIED;
@@ -292,7 +292,7 @@
 *hWinSta = NULL;
 *hDesktop = NULL;
 
-if(DesktopPath->Buffer != NULL && DesktopPath->Length > sizeof(WCHAR))
+if (DesktopPath->Buffer != NULL && DesktopPath->Length > sizeof(WCHAR))
 {
 /*
  * Parse the desktop path string which can be in the form 
"WinSta\Desktop"
@@ -300,7 +300,7 @@
  */
 
 pwstrDesktop = wcschr(DesktopPath->Buffer, L'\\');
-if(pwstrDesktop != NULL)
+if (pwstrDesktop != NULL)
 {
 *pwstrDesktop = 0;
 pwstrDesktop++;
@@ -326,7 +326,7 @@
 #endif
 {
 /* We had no luck searching for opened handles, use WinSta0 now */
-if(!pwstrWinsta)
+if (!pwstrWinsta)
 pwstrWinsta = L"WinSta0";
 }
 
@@ -341,11 +341,11 @@
 #endif
 {
 /* We had no luck searching for opened handles, use Desktop now */
-if(!pwstrDesktop)
+if (!pwstrDesktop)
 pwstrDesktop = L"Default";
 }
 
-if(*hWinSta == NULL)
+if (*hWinSta == NULL)
 {
 swprintf(wstrWinstaFullName, L"%wZ\\%ws", &gustrWindowStationsDir, 
pwstrWinsta);
 RtlInitUnicodeString( &ObjectName, wstrWinstaFullName);
@@ -367,7 +367,7 @@
 NULL,
 (HANDLE*)hWinSta);
 
-if(!NT_SUCCESS(Status))
+if (!NT_SUCCESS(Status))
 {
 SetLastNtError(Status);
 ERR("Failed to reference window station %wZ PID: --!\n", 
&ObjectName );
@@ -375,7 +375,7 @@
 }
 }
 
-if(*hDesktop == NULL)
+if (*hDesktop == NULL)
 {
 RtlInitUnicodeString(&ObjectName, pwstrDesktop);
 
@@ -396,7 +396,7 @@
 NULL,
 (HANDLE*)hDesktop);
 
-if(!NT_SUCCESS(Status))
+if (!NT_SUCCESS(Status))
 {
 *hDesktop = NULL;
 NtClose(*hWinSta);
@@ -475,7 +475,7 @@
ExDesktopObjectType,
UserMode,
(PHANDLE)&Ret);
-if(!NT_SUCCESS(Status))
+if (!NT_SUCCESS(Status))
 {
 /* Unable to create a handle */
 ERR("Unable to create a desktop handle\n");
@@ -512,9 +512,9 @@
 TRACE("No active desktop\n");
 return;
 }
-if(NewQueue != NULL)
-{
-if(NewQueue->Desktop != NULL)
+if (NewQueue != NULL)
+{
+if (NewQueue->Desktop != NULL)
 {
 TRACE("Message Queue already attached to another desktop!\n");
 return;
@@ -523,7 +523,7 @@
 (void)InterlockedExchangePointer((PVOID*)&NewQueue->Desktop, pdo);
 }
 Old = 
(PUSER_MESSAGE_QUEUE)InterlockedExchangePointer((PVOID*)&pdo->ActiveMessageQueue,
 NewQueue);
-if(Old != NULL)
+if (Old != NULL)
 {
 (void)InterlockedExchangePointer((PVOID*)&Old->Desktop, 0);
 gpqForegroundPrev = Old;
@@ -692,7 +692,7 @@
 case WM_WINDOWPOSCHANGING:
 {
 PWINDOWPOS pWindowPos = (PWINDOWPOS)lParam;
-if((pWindowPos->flags & SWP_SHOWWINDOW) != 0)
+if ((pWindowPos->flags

[ros-diffs] [hbelusca] 71443: [DESK.CPL] - Only use the minimum required registry rights needed in RegOpenKeyEx and RegCreateKeyEx calls. - Fix SetDesktopBackColor function where we tried to save the

2016-05-28 Thread hbelusca
Author: hbelusca
Date: Sat May 28 19:12:14 2016
New Revision: 71443

URL: http://svn.reactos.org/svn/reactos?rev=71443&view=rev
Log:
[DESK.CPL]
- Only use the minimum required registry rights needed in RegOpenKeyEx and 
RegCreateKeyEx calls.
- Fix SetDesktopBackColor function where we tried to save the selected desktop 
background color in the registry only in the case where opening the 
corresponding registry key actually failed... >_>
  Now we do the right thing!

Modified:
trunk/reactos/dll/cpl/desk/background.c

Modified: trunk/reactos/dll/cpl/desk/background.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/background.c?rev=71443&r1=71442&r2=71443&view=diff
==
--- trunk/reactos/dll/cpl/desk/background.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/background.c [iso-8859-1] Sat May 28 
19:12:14 2016
@@ -179,7 +179,6 @@
 LV_ITEM listItem;
 HIMAGELIST himl;
 
-
 szFileTypes = GdipGetSupportedFileExtensions();
 if (!szFileTypes)
 {
@@ -216,7 +215,6 @@
 sizeof(sfi),
 SHGFI_SYSICONINDEX | 
SHGFI_SMALLICON |
 SHGFI_DISPLAYNAME);
-
 if (himl == NULL)
 break;
 
@@ -332,7 +330,7 @@
 pData->listViewItemCount++;
 
 /* Add current wallpaper if any */
-result = RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop"), 
0, KEY_ALL_ACCESS, ®Key);
+result = RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop"), 
0, KEY_QUERY_VALUE, ®Key);
 if (result == ERROR_SUCCESS)
 {
 result = RegQueryValueEx(regKey, TEXT("Wallpaper"), 0, &varType, 
(LPBYTE)wallpaperFilename, &bufferSize);
@@ -376,7 +374,6 @@
  sizeof(sfi),
  SHGFI_SYSICONINDEX | 
SHGFI_SMALLICON |
  SHGFI_DISPLAYNAME);
-
 if (himl != NULL)
 {
 if (i++ == 0)
@@ -513,8 +510,8 @@
 LONG res = ERROR_SUCCESS;
 CHOOSECOLOR cc;
 
-res = RegCreateKeyEx(HKEY_CURRENT_USER, TEXT("Control Panel\\Appearance"), 
0, NULL, 0,
-KEY_ALL_ACCESS, NULL, &hKey, NULL);
+res = RegCreateKeyEx(HKEY_CURRENT_USER, TEXT("Control Panel\\Appearance"), 
0, NULL,
+ REG_OPTION_NON_VOLATILE, KEY_QUERY_VALUE, NULL, 
&hKey, NULL);
 /* Now the key is either created or opened existing, if res == 
ERROR_SUCCESS */
 if (res == ERROR_SUCCESS)
 {
@@ -522,7 +519,7 @@
 DWORD dwType = REG_BINARY;
 DWORD cbData = sizeof(pData->custom_colors);
 res = RegQueryValueEx(hKey, TEXT("CustomColors"), NULL, &dwType,
-(LPBYTE)pData->custom_colors, &cbData);
+  (LPBYTE)pData->custom_colors, &cbData);
 RegCloseKey(hKey);
 hKey = NULL;
 }
@@ -554,12 +551,12 @@
 
 /* Save custom colors to reg. To this moment key must be created 
already. See above */
 res = RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Control 
Panel\\Appearance"), 0,
-KEY_WRITE, &hKey);
+   KEY_SET_VALUE, &hKey);
 if (res == ERROR_SUCCESS)
 {
 /* Key opened */
 RegSetValueEx(hKey, TEXT("CustomColors"), 0, REG_BINARY,
-(const BYTE *)pData->custom_colors, 
sizeof(pData->custom_colors));
+  (LPBYTE)pData->custom_colors, 
sizeof(pData->custom_colors));
 RegCloseKey(hKey);
 hKey = NULL;
 }
@@ -907,7 +904,6 @@
 size_t length = 0;
 GpStatus status;
 
-
 if (FAILED(SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA | CSIDL_FLAG_CREATE, 
NULL, 0, szWallpaper)))
 {
 return;
@@ -918,24 +914,28 @@
 return;
 }
 
-RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop"), 0, 
KEY_ALL_ACCESS, ®Key);
+if (RegCreateKeyEx(HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop"), 0, 
NULL,
+   REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, ®Key, 
NULL) != ERROR_SUCCESS)
+{
+return;
+}
 
 if (pData->placementSelection == PLACEMENT_TILE)
 {
-RegSetValueEx(regKey, TEXT("TileWallpaper"), 0, REG_SZ, (BYTE 
*)TEXT("1"), sizeof(TCHAR) * 2);
-RegSetValueEx(regKey, TEXT("WallpaperStyle"), 0, REG_SZ, (BYTE 
*)TEXT("0"), sizeof(TCHAR) * 2);
+RegSetValueEx(regKey, TEXT("TileWallpaper"), 0, REG_SZ, 
(LPBYTE)TEXT("1"), sizeof(TCHAR) * 2);
+RegSetValueEx(regKey, TEXT("WallpaperStyle"), 0, REG_SZ, 
(LPBYTE)TEXT("0"), sizeof(TCHAR) * 2);
 }
 
 if (pData->placementSelection == PLACEMENT_CENTER)
 {
-RegSetValueEx(regKey, TEXT("TileWallpaper"), 0, REG_SZ, (BYTE 
*)TEXT("0"), sizeof(TCHAR) * 2);
-RegSetValueEx(regKey, TEXT("WallpaperStyle"),

[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&view=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&r1=71441&r2=71442&view=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

[ros-diffs] [hbelusca] 71441: [SHELL32]: Always paint the desktop listview transparent. This allows explorer to display the default desktop background color set by win32k as well as the ReactOS versio

2016-05-28 Thread hbelusca
Author: hbelusca
Date: Sat May 28 16:59:55 2016
New Revision: 71441

URL: http://svn.reactos.org/svn/reactos?rev=71441&view=rev
Log:
[SHELL32]: Always paint the desktop listview transparent. This allows explorer 
to display the default desktop background color set by win32k as well as the 
ReactOS version on the desktop.
See also r66271 and r66752.

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=71441&r1=71440&r2=71441&view=diff
==
--- trunk/reactos/dll/win32/shell32/CDefView.cpp[iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CDefView.cpp[iso-8859-1] Sat May 28 
16:59:55 2016
@@ -582,20 +582,27 @@
 DWORD cbDropShadow = sizeof(bDropShadow);
 WCHAR wszBuf[16] = L"";
 
+/*
+ * The desktop ListView always take the default desktop colours, by
+ * remaining transparent and letting user32/win32k paint itself the
+ * desktop background color, if any.
+ */
+m_ListView.SetBkColor(CLR_NONE);
+
 RegGetValueW(HKEY_CURRENT_USER, 
L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
  L"ListviewShadow", RRF_RT_DWORD, NULL, &bDropShadow, 
&cbDropShadow);
 if (bDropShadow && SystemParametersInfoW(SPI_GETDESKWALLPAPER, 
_countof(wszBuf), wszBuf, 0) && wszBuf[0])
 {
+/* Set the icon background transparent */
 m_ListView.SetTextBkColor(CLR_NONE);
-m_ListView.SetBkColor(CLR_NONE);
 m_ListView.SetTextColor(RGB(255, 255, 255));
 m_ListView.SetExtendedListViewStyle(LVS_EX_TRANSPARENTSHADOWTEXT, 
LVS_EX_TRANSPARENTSHADOWTEXT);
 }
 else
 {
+/* Set the icon background as the same colour as the desktop */
 COLORREF crDesktop = GetSysColor(COLOR_DESKTOP);
 m_ListView.SetTextBkColor(crDesktop);
-m_ListView.SetBkColor(crDesktop);
 if (GetRValue(crDesktop) + GetGValue(crDesktop) + 
GetBValue(crDesktop) > 128 * 3)
 m_ListView.SetTextColor(RGB(0, 0, 0));
 else




[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&view=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&r1=71439&r2=71440&view=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&r1=71439&r2=71440&view=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&r1=71439&r2=71440&view=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&r1=71439&r2=71440&view=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**)&default_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&r1=71439&r2=71440&view=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)
+

[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&view=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&r1=71438&r2=71439&view=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_pAPIHooks);
+}
+
+
+PVOID SHIM_OBJ_NAME(FindShim)(PCWSTR

[ros-diffs] [hbelusca] 71438: [KDCOM]: Properly revert the commits.

2016-05-28 Thread hbelusca
Author: hbelusca
Date: Sat May 28 15:54:44 2016
New Revision: 71438

URL: http://svn.reactos.org/svn/reactos?rev=71438&view=rev
Log:
[KDCOM]: Properly revert the commits.

Modified:
trunk/reactos/drivers/base/kdcom/kddll.c

Modified: trunk/reactos/drivers/base/kdcom/kddll.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdcom/kddll.c?rev=71438&r1=71437&r2=71438&view=diff
==
--- trunk/reactos/drivers/base/kdcom/kddll.c[iso-8859-1] (original)
+++ trunk/reactos/drivers/base/kdcom/kddll.c[iso-8859-1] Sat May 28 
15:54:44 2016
@@ -11,7 +11,7 @@
 /* GLOBALS 
/
 
 ULONG CurrentPacketId = INITIAL_PACKET_ID | SYNC_PACKET_ID;
-ULONG RemotePacketId = INITIAL_PACKET_ID;
+ULONG RemotePacketId  = INITIAL_PACKET_ID;
 
 
 /* PRIVATE FUNCTIONS 
**/
@@ -90,7 +90,7 @@
 ULONG Checksum;
 
 /* Special handling for breakin packet */
-if(PacketType == PACKET_TYPE_KD_POLL_BREAKIN)
+if (PacketType == PACKET_TYPE_KD_POLL_BREAKIN)
 {
 return KdpPollBreakIn();
 }
@@ -175,9 +175,9 @@
 
 case PACKET_TYPE_KD_RESET:
 KDDBGPRINT("KdReceivePacket - got PACKET_TYPE_KD_RESET\n");
+CurrentPacketId = INITIAL_PACKET_ID;
+RemotePacketId  = INITIAL_PACKET_ID;
 KdpSendControlPacket(PACKET_TYPE_KD_RESET, 0);
-CurrentPacketId = INITIAL_PACKET_ID;
-RemotePacketId = INITIAL_PACKET_ID;
 /* Fall through */
 
 case PACKET_TYPE_KD_RESEND:
@@ -219,7 +219,7 @@
 
 /* Receive the message header data */
 KdStatus = KdpReceiveBuffer(MessageHeader->Buffer,
-   MessageHeader->Length);
+MessageHeader->Length);
 if (KdStatus != KDP_PACKET_RECEIVED)
 {
 /* Didn't receive data. Packet needs to be resent. */
@@ -278,7 +278,7 @@
 if (Packet.Checksum != Checksum)
 {
 KDDBGPRINT("KdReceivePacket - wrong cheksum, got %x, calculated 
%x\n",
-  Packet.Checksum, Checksum);
+   Packet.Checksum, Checksum);
 KdpSendControlPacket(PACKET_TYPE_KD_RESEND, 0);
 continue;
 }




[ros-diffs] [tkreuzer] 71437: Revert a mistake commit...

2016-05-28 Thread tkreuzer
Author: tkreuzer
Date: Sat May 28 15:51:44 2016
New Revision: 71437

URL: http://svn.reactos.org/svn/reactos?rev=71437&view=rev
Log:
Revert a mistake commit...

Modified:
trunk/reactos/drivers/base/kdcom/kddll.c

Modified: trunk/reactos/drivers/base/kdcom/kddll.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdcom/kddll.c?rev=71437&r1=71436&r2=71437&view=diff
==
--- trunk/reactos/drivers/base/kdcom/kddll.c[iso-8859-1] (original)
+++ trunk/reactos/drivers/base/kdcom/kddll.c[iso-8859-1] Sat May 28 
15:51:44 2016
@@ -8,19 +8,11 @@
 
 #include "kddll.h"
 
-#define _FULL_ 1
-#define _WORKS_ 0
-#define _WORKS2_ 0
-
 /* GLOBALS 
/
 
 ULONG CurrentPacketId = INITIAL_PACKET_ID | SYNC_PACKET_ID;
-ULONG RemotePacketId  = INITIAL_PACKET_ID;
-
-#if _FULL_
-ULONG KdCompNumberRetries = 5;
-ULONG KdCompRetryCount = 5;
-#endif
+ULONG RemotePacketId = INITIAL_PACKET_ID;
+
 
 /* PRIVATE FUNCTIONS 
**/
 
@@ -38,13 +30,13 @@
 IN PVOID Buffer,
 IN ULONG Length)
 {
-ULONG i, Checksum = 0;
-
-for (i = 0; i < Length; i++)
+PUCHAR ByteBuffer = Buffer;
+ULONG Checksum = 0;
+
+while (Length-- > 0)
 {
-Checksum += ((PUCHAR)Buffer)[i];
+Checksum += (ULONG)*ByteBuffer++;
 }
-
 return Checksum;
 }
 
@@ -67,36 +59,6 @@
 
 
 /* PUBLIC FUNCTIONS 
***/
-
-NTSTATUS
-NTAPI
-KdD0Transition(VOID)
-{
-return STATUS_SUCCESS;
-}
-
-NTSTATUS
-NTAPI
-KdD3Transition(VOID)
-{
-return STATUS_SUCCESS;
-}
-
-
-/**
- * \name KdDebuggerInitialize1
- * \brief Phase 1 initialization.
- * \param [opt] LoaderBlock Pointer to the Loader parameter block. Can be NULL.
- * \return Status
- */
-NTSTATUS
-NTAPI
-KdDebuggerInitialize1(
-IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL)
-{
-return STATUS_SUCCESS;
-}
-
 
 /**
  * \name KdReceivePacket
@@ -128,36 +90,21 @@
 ULONG Checksum;
 
 /* Special handling for breakin packet */
-if (PacketType == PACKET_TYPE_KD_POLL_BREAKIN)
+if(PacketType == PACKET_TYPE_KD_POLL_BREAKIN)
 {
 return KdpPollBreakIn();
 }
 
 for (;;)
 {
-#if _FULL_ || _WORKS2_
-if (KdContext)
-{
-KdContext->KdpControlCPending = FALSE;
-}
-#endif
 /* Step 1 - Read PacketLeader */
 KdStatus = KdpReceivePacketLeader(&Packet.PacketLeader);
-#if _FULL_
-if (KdStatus != KDP_PACKET_TIMEOUT)
-{
-//KdCompNumberRetries = KdCompRetryCount;
-}
-#endif
 if (KdStatus != KDP_PACKET_RECEIVED)
 {
 /* Check if we got a breakin  */
 if (KdStatus == KDP_PACKET_RESEND)
 {
-#if _FULL_ || _WORKS2_ || _PATCH_
-if (KdContext)
-#endif
-KdContext->KdpControlCPending = TRUE;
+KdContext->KdpControlCPending = TRUE;
 }
 return KdStatus;
 }
@@ -167,37 +114,22 @@
 if (KdStatus != KDP_PACKET_RECEIVED)
 {
 /* Didn't receive a PacketType. */
-KDDBGPRINT("KdReceivePacket - Didn't receive a PacketType.\n");
-#if _WORKS_
-continue;
-#else
 return KdStatus;
-#endif
 }
 
 /* Check if we got a resend packet */
 if (Packet.PacketLeader == CONTROL_PACKET_LEADER &&
 Packet.PacketType == PACKET_TYPE_KD_RESEND)
 {
-KDDBGPRINT("KdReceivePacket - PACKET_TYPE_KD_RESEND.\n");
 return KDP_PACKET_RESEND;
 }
 
 /* Step 3 - Read ByteCount */
 KdStatus = KdpReceiveBuffer(&Packet.ByteCount, sizeof(USHORT));
-#if _WORKS_
-if (KdStatus != KDP_PACKET_RECEIVED || Packet.ByteCount > 
PACKET_MAX_SIZE)
-#else
-if (KdStatus != KDP_PACKET_RECEIVED)
-#endif
-{
-/* Didn't receive ByteCount _WORKS_: or it's too big. Start over. 
*/
-KDDBGPRINT("KdReceivePacket - Didn't receive ByteCount.\n");
-#if _WORKS_
-continue;
-#else
+if (KdStatus != KDP_PACKET_RECEIVED)
+{
+/* Didn't receive ByteCount. */
 return KdStatus;
-#endif
 }
 
 /* Step 4 - Read PacketId */
@@ -205,12 +137,7 @@
 if (KdStatus != KDP_PACKET_RECEIVED)
 {
 /* Didn't receive PacketId. */
-KDDBGPRINT("KdReceivePacket - Didn't receive PacketId.\n");
-#if _WORKS_
-continue;
-#else
 return KdStatus;
-#endif
 }
 
 /*
@@ -226,12 +153,7 @@
 if (KdStatus != KDP_PACKET_RECEIVED)
 {
 /* Didn't receive Checksum. */
-KDDBGPRINT("KdR

[ros-diffs] [tkreuzer] 71436: Patch "works": continue vs return stuff

2016-05-28 Thread tkreuzer
Author: tkreuzer
Date: Sat May 28 15:46:49 2016
New Revision: 71436

URL: http://svn.reactos.org/svn/reactos?rev=71436&view=rev
Log:
Patch "works": continue vs return stuff

Modified:
trunk/reactos/drivers/base/kdcom/kddll.c

Modified: trunk/reactos/drivers/base/kdcom/kddll.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdcom/kddll.c?rev=71436&r1=71435&r2=71436&view=diff
==
--- trunk/reactos/drivers/base/kdcom/kddll.c[iso-8859-1] (original)
+++ trunk/reactos/drivers/base/kdcom/kddll.c[iso-8859-1] Sat May 28 
15:46:49 2016
@@ -8,11 +8,19 @@
 
 #include "kddll.h"
 
+#define _FULL_ 1
+#define _WORKS_ 0
+#define _WORKS2_ 0
+
 /* GLOBALS 
/
 
 ULONG CurrentPacketId = INITIAL_PACKET_ID | SYNC_PACKET_ID;
 ULONG RemotePacketId  = INITIAL_PACKET_ID;
 
+#if _FULL_
+ULONG KdCompNumberRetries = 5;
+ULONG KdCompRetryCount = 5;
+#endif
 
 /* PRIVATE FUNCTIONS 
**/
 
@@ -30,13 +38,13 @@
 IN PVOID Buffer,
 IN ULONG Length)
 {
-PUCHAR ByteBuffer = Buffer;
-ULONG Checksum = 0;
-
-while (Length-- > 0)
+ULONG i, Checksum = 0;
+
+for (i = 0; i < Length; i++)
 {
-Checksum += (ULONG)*ByteBuffer++;
+Checksum += ((PUCHAR)Buffer)[i];
 }
+
 return Checksum;
 }
 
@@ -59,6 +67,36 @@
 
 
 /* PUBLIC FUNCTIONS 
***/
+
+NTSTATUS
+NTAPI
+KdD0Transition(VOID)
+{
+return STATUS_SUCCESS;
+}
+
+NTSTATUS
+NTAPI
+KdD3Transition(VOID)
+{
+return STATUS_SUCCESS;
+}
+
+
+/**
+ * \name KdDebuggerInitialize1
+ * \brief Phase 1 initialization.
+ * \param [opt] LoaderBlock Pointer to the Loader parameter block. Can be NULL.
+ * \return Status
+ */
+NTSTATUS
+NTAPI
+KdDebuggerInitialize1(
+IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL)
+{
+return STATUS_SUCCESS;
+}
+
 
 /**
  * \name KdReceivePacket
@@ -97,14 +135,29 @@
 
 for (;;)
 {
+#if _FULL_ || _WORKS2_
+if (KdContext)
+{
+KdContext->KdpControlCPending = FALSE;
+}
+#endif
 /* Step 1 - Read PacketLeader */
 KdStatus = KdpReceivePacketLeader(&Packet.PacketLeader);
+#if _FULL_
+if (KdStatus != KDP_PACKET_TIMEOUT)
+{
+//KdCompNumberRetries = KdCompRetryCount;
+}
+#endif
 if (KdStatus != KDP_PACKET_RECEIVED)
 {
 /* Check if we got a breakin  */
 if (KdStatus == KDP_PACKET_RESEND)
 {
-KdContext->KdpControlCPending = TRUE;
+#if _FULL_ || _WORKS2_ || _PATCH_
+if (KdContext)
+#endif
+KdContext->KdpControlCPending = TRUE;
 }
 return KdStatus;
 }
@@ -114,22 +167,37 @@
 if (KdStatus != KDP_PACKET_RECEIVED)
 {
 /* Didn't receive a PacketType. */
+KDDBGPRINT("KdReceivePacket - Didn't receive a PacketType.\n");
+#if _WORKS_
+continue;
+#else
 return KdStatus;
+#endif
 }
 
 /* Check if we got a resend packet */
 if (Packet.PacketLeader == CONTROL_PACKET_LEADER &&
 Packet.PacketType == PACKET_TYPE_KD_RESEND)
 {
+KDDBGPRINT("KdReceivePacket - PACKET_TYPE_KD_RESEND.\n");
 return KDP_PACKET_RESEND;
 }
 
 /* Step 3 - Read ByteCount */
 KdStatus = KdpReceiveBuffer(&Packet.ByteCount, sizeof(USHORT));
+#if _WORKS_
+if (KdStatus != KDP_PACKET_RECEIVED || Packet.ByteCount > 
PACKET_MAX_SIZE)
+#else
 if (KdStatus != KDP_PACKET_RECEIVED)
-{
-/* Didn't receive ByteCount. */
+#endif
+{
+/* Didn't receive ByteCount _WORKS_: or it's too big. Start over. 
*/
+KDDBGPRINT("KdReceivePacket - Didn't receive ByteCount.\n");
+#if _WORKS_
+continue;
+#else
 return KdStatus;
+#endif
 }
 
 /* Step 4 - Read PacketId */
@@ -137,7 +205,12 @@
 if (KdStatus != KDP_PACKET_RECEIVED)
 {
 /* Didn't receive PacketId. */
+KDDBGPRINT("KdReceivePacket - Didn't receive PacketId.\n");
+#if _WORKS_
+continue;
+#else
 return KdStatus;
+#endif
 }
 
 /*
@@ -153,7 +226,12 @@
 if (KdStatus != KDP_PACKET_RECEIVED)
 {
 /* Didn't receive Checksum. */
+KDDBGPRINT("KdReceivePacket - Didn't receive Checksum.\n");
+#if _WORKS_
+continue;
+#else
 return KdStatus;
+#endif
 }
 
 /* Step 6 - Handle control packets */
@@ -187,8 +265,11 @@
 
 default:
 KDDBGPRINT("KdReceivePacket - got unknown c

[ros-diffs] [hbelusca] 71435: [TIMEDATE.CPL]: Do not hardcode some of the buffer lengths. CORE-11284

2016-05-28 Thread hbelusca
Author: hbelusca
Date: Sat May 28 15:23:00 2016
New Revision: 71435

URL: http://svn.reactos.org/svn/reactos?rev=71435&view=rev
Log:
[TIMEDATE.CPL]: Do not hardcode some of the buffer lengths.
CORE-11284

Modified:
trunk/reactos/dll/cpl/timedate/timezone.c

Modified: trunk/reactos/dll/cpl/timedate/timezone.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/timedate/timezone.c?rev=71435&r1=71434&r2=71435&view=diff
==
--- trunk/reactos/dll/cpl/timedate/timezone.c   [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/timedate/timezone.c   [iso-8859-1] Sat May 28 
15:23:00 2016
@@ -73,7 +73,7 @@
 DWORD dwValueSize;
 LONG lError;
 
-dwValueSize = 128 * sizeof(WCHAR);
+dwValueSize = sizeof(Entry->Description);
 lError = RegQueryValueExW(hZoneKey,
   L"Display",
   NULL,
@@ -83,7 +83,7 @@
 if (lError != ERROR_SUCCESS)
 return lError;
 
-dwValueSize = 33 * sizeof(WCHAR);
+dwValueSize = sizeof(Entry->StandardName);
 lError = RegQueryValueExW(hZoneKey,
   L"Std",
   NULL,
@@ -93,7 +93,7 @@
 if (lError != ERROR_SUCCESS)
 return lError;
 
-dwValueSize = 33 * sizeof(WCHAR);
+dwValueSize = sizeof(Entry->DaylightName);
 lError = RegQueryValueExW(hZoneKey,
   L"Dlt",
   NULL,
@@ -103,7 +103,7 @@
 if (lError != ERROR_SUCCESS)
 return lError;
 
-dwValueSize = sizeof(TZ_INFO);
+dwValueSize = sizeof(Entry->TimezoneInfo);
 lError = RegQueryValueExW(hZoneKey,
   L"TZI",
   NULL,
@@ -371,7 +371,7 @@
0,
REG_DWORD,
(LPBYTE)&dwValue,
-   sizeof(DWORD));
+   sizeof(dwValue));
 }
 else
 {
@@ -401,7 +401,7 @@
 hBitmap = LoadImageW(hApplet, MAKEINTRESOURCEW(IDC_WORLD), 
IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
 if (hBitmap != NULL)
 {
-GetObjectW(hBitmap, sizeof(BITMAP), &bitmap);
+GetObjectW(hBitmap, sizeof(bitmap), &bitmap);
 
 cxSource = bitmap.bmWidth;
 cySource = bitmap.bmHeight;