ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
July 2017
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
213 discussions
Start a n
N
ew thread
[mjansen] 75264: [SHIMDBG] Output both to the console and the debug output + fix a copypasta error.
by mjansen@svn.reactos.org
Author: mjansen Date: Sun Jul 2 11:56:01 2017 New Revision: 75264 URL:
http://svn.reactos.org/svn/reactos?rev=75264&view=rev
Log: [SHIMDBG] Output both to the console and the debug output + fix a copypasta error. Modified: trunk/rosapps/applications/devutils/shimdbg/shimdbg.c Modified: trunk/rosapps/applications/devutils/shimdbg/shimdbg.c URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/devutils/shim…
============================================================================== --- trunk/rosapps/applications/devutils/shimdbg/shimdbg.c [iso-8859-1] (original) +++ trunk/rosapps/applications/devutils/shimdbg/shimdbg.c [iso-8859-1] Sun Jul 2 11:56:01 2017 @@ -10,11 +10,31 @@ #include <ctype.h> #include <ntndk.h> +void __stdcall OutputDebugStringA(PCSTR); + +void xprintf(const char *fmt, ...) +{ + va_list ap; + int length; + char *buf; + + va_start(ap, fmt); + length = _vscprintf(fmt, ap); + buf = malloc(length + 1); + vsprintf(buf, fmt, ap); + buf[length] = '\0'; + va_end(ap); + + fputs(buf, stdout); + OutputDebugStringA(buf); +} + + void CallApphelp(APPHELPCACHESERVICECLASS Service, PAPPHELP_CACHE_SERVICE_LOOKUP CacheEntry) { NTSTATUS Status = NtApphelpCacheControl(Service, CacheEntry); - printf("NtApphelpCacheControl returned 0x%x\n", (unsigned int)Status); + xprintf("NtApphelpCacheControl returned 0x%x\n", (unsigned int)Status); } HANDLE MapFile(char* filename, UNICODE_STRING* PathName, int MapIt) @@ -35,7 +55,7 @@ FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE); if (!NT_SUCCESS(Status)) { - printf("Failed opening the file, using a NULL handle\n"); + xprintf("Failed opening the file, using a NULL handle\n"); FileHandle = NULL; } } @@ -50,7 +70,7 @@ HANDLE FileHandle = MapFile(filename, &PathName, MapIt); - printf("Calling %s %s mapping\n", ServiceName, (MapIt ? "with" : "without")); + xprintf("Calling %s %s mapping\n", ServiceName, (MapIt ? "with" : "without")); RtlInitUnicodeString(&CacheEntry.ImageName, PathName.Buffer); CacheEntry.ImageHandle = FileHandle ? FileHandle : (HANDLE)-1; @@ -82,7 +102,7 @@ (*pn) += 1; return 0; } - printf("Error: no image name specified\n"); + xprintf("Error: no image name specified\n"); return 1; } @@ -124,7 +144,7 @@ static ANSI_STRING SdbFreeFileAttributes = RTL_CONSTANT_STRING("SdbFreeFileAttributes"); if (!NT_SUCCESS(LdrLoadDll(NULL, NULL, &DllName, &hdll))) { - printf("Unable to load apphelp.dll\n"); + xprintf("Unable to load apphelp.dll\n"); return FALSE; } if (!NT_SUCCESS(LdrGetProcedureAddress(hdll, &SdbTagToString, 0, (PVOID)&pSdbTagToString)) || @@ -133,7 +153,7 @@ { LdrUnloadDll(hdll); hdll = NULL; - printf("Unable to resolve functions\n"); + xprintf("Unable to resolve functions\n"); return FALSE; } } @@ -158,7 +178,7 @@ } else if (argn+1 >= argc) { - printf("Error: no image name specified\n"); + xprintf("Error: no image name specified\n"); return 1; } else @@ -171,7 +191,7 @@ if (pSdbGetFileAttributes(FileName.Buffer, &attr, &num_attr)) { - printf("Dumping attributes for %s\n", arg); + xprintf("Dumping attributes for %s\n", arg); for (n = 0; n < num_attr; ++n) { TAG tagType; @@ -185,24 +205,24 @@ switch (tagType) { case TAG_TYPE_DWORD: - printf("<%ls>0x%lx</%ls><!-- %ld -->\n", tagName, attr[n].dwattr, tagName, attr[n].dwattr); + xprintf("<%ls>0x%lx</%ls>\n", tagName, attr[n].dwattr, tagName); break; case TAG_TYPE_STRINGREF: - printf("<%ls>0x%ls</%ls>\n", tagName, attr[n].lpattr, tagName); + xprintf("<%ls>%ls</%ls>\n", tagName, attr[n].lpattr, tagName); break; case TAG_TYPE_QWORD: - printf("<%ls>0x%I64x</%ls><!-- %I64d -->\n", tagName, attr[n].qwattr, tagName, attr[n].qwattr); + xprintf("<%ls>0x%I64x</%ls>\n", tagName, attr[n].qwattr, tagName); break; default: - printf("<!-- Unknown tag type: 0x%x (from 0x%x)\n", tagType, attr[n].type); + xprintf("<!-- Unknown tag type: 0x%x (from 0x%x)\n", tagType, attr[n].type); break; } } - printf("Done\n"); + xprintf("Done\n"); } else { - printf("Unable to get attributes from %s\n", arg); + xprintf("Unable to get attributes from %s\n", arg); } @@ -224,21 +244,21 @@ while (offset < len) { - printf("%04x ", offset); + xprintf("%04x ", offset); thisline = len - offset; if (thisline > 16) thisline = 16; for (i = 0; i < thisline; i++) - printf("%02x ", line[i]); + xprintf("%02x ", line[i]); for (; i < 16; i++) - printf(" "); + xprintf(" "); for (i = 0; i < thisline; i++) - printf("%c", (line[i] >= 0x20 && line[i] < 0x7f) ? line[i] : '.'); - - printf("\n"); + xprintf("%c", (line[i] >= 0x20 && line[i] < 0x7f) ? line[i] : '.'); + + xprintf("\n"); offset += thisline; line += thisline; } @@ -252,7 +272,7 @@ PKEY_VALUE_PARTIAL_INFORMATION KeyValueInformation = &KeyValueObject; ULONG KeyInfoSize, ResultSize; - printf("Dumping AppCompatCache registry key\n"); + xprintf("Dumping AppCompatCache registry key\n"); Status = NtOpenKey(&KeyHandle, KEY_QUERY_VALUE, &AppCompatKeyAttributes); @@ -278,11 +298,11 @@ if (IncludeDump) hexdump(KeyValueInformation->Data, KeyValueInformation->DataLength); crc = RtlComputeCrc32(0, KeyValueInformation->Data, KeyValueInformation->DataLength); - printf("Len: %lu, Crc: 0x%lx\n", KeyValueInformation->DataLength, crc); + xprintf("Len: %lu, Crc: 0x%lx\n", KeyValueInformation->DataLength, crc); } else { - printf("Failed reading AppCompatCache from registry (0x%lx)\n", Status); + xprintf("Failed reading AppCompatCache from registry (0x%lx)\n", Status); } if (KeyValueInformation != &KeyValueObject) @@ -303,7 +323,7 @@ char* arg = argv[n]; if (IsOpt(arg, "d")) { - printf("Calling ApphelpCacheServiceDump\n"); + xprintf("Calling ApphelpCacheServiceDump\n"); CallApphelp(ApphelpCacheServiceDump, NULL); unhandled = 0; } @@ -314,19 +334,19 @@ } else if (IsOpt(arg, "f")) { - printf("Calling ApphelpCacheServiceFlush\n"); + xprintf("Calling ApphelpCacheServiceFlush\n"); CallApphelp(ApphelpCacheServiceFlush, NULL); unhandled = 0; } else if (IsOpt(arg, "z")) { - printf("Calling ApphelpDBGReadRegistry\n"); + xprintf("Calling ApphelpDBGReadRegistry\n"); CallApphelp(ApphelpDBGReadRegistry, NULL); unhandled = 0; } else if (IsOpt(arg, "x")) { - printf("Calling ApphelpDBGWriteRegistry\n"); + xprintf("Calling ApphelpDBGWriteRegistry\n"); CallApphelp(ApphelpDBGWriteRegistry, NULL); unhandled = 0; } @@ -360,21 +380,21 @@ } if (unhandled || argc == 1) { - printf("Usage: %s [-d|-z|-x|-h|-H|-f|-[l|L] <image>|-[u|U] <image>|-[r|R] <image>|-k]\n", argv[0]); - printf(" -d: Dump shim cache over debug output\n"); - printf(" -z: DEBUG Read shim cache from registry\n"); - printf(" -x: DEBUG Write shim cache to registry\n"); - printf(" -h: Hexdump shim registry key\n"); - printf(" -H: Crc + Length from shim registry key only\n"); - printf(" -f: Flush (clear) the shim cache\n"); - printf(" -l: Lookup <image> in the shim cache\n"); - printf(" -L: Lookup <image> in the shim cache without mapping it\n"); - printf(" -u: Update (insert) <image> in the shim cache\n"); - printf(" -U: Update (insert) <image> in the shim cache without mapping it\n"); - printf(" -r: Remove <image> from the shim cache\n"); - printf(" -R: Remove <image> from the shim cache without mapping it\n"); - printf(" -a: Dump file attributes as used in the appcompat database\n"); - printf(" -k: Keep the console open\n"); + xprintf("Usage: %s [-d|-z|-x|-h|-H|-f|-[l|L] <image>|-[u|U] <image>|-[r|R] <image>|-k]\n", argv[0]); + xprintf(" -d: Dump shim cache over debug output\n"); + xprintf(" -z: DEBUG Read shim cache from registry\n"); + xprintf(" -x: DEBUG Write shim cache to registry\n"); + xprintf(" -h: Hexdump shim registry key\n"); + xprintf(" -H: Crc + Length from shim registry key only\n"); + xprintf(" -f: Flush (clear) the shim cache\n"); + xprintf(" -l: Lookup <image> in the shim cache\n"); + xprintf(" -L: Lookup <image> in the shim cache without mapping it\n"); + xprintf(" -u: Update (insert) <image> in the shim cache\n"); + xprintf(" -U: Update (insert) <image> in the shim cache without mapping it\n"); + xprintf(" -r: Remove <image> from the shim cache\n"); + xprintf(" -R: Remove <image> from the shim cache without mapping it\n"); + xprintf(" -a: Dump file attributes as used in the appcompat database\n"); + xprintf(" -k: Keep the console open\n"); } if (keepopen) {
7 years, 5 months
1
0
0
0
[mjansen] 75263: [REGEDIT] Pre-select the text in the edit dialog.
by mjansen@svn.reactos.org
Author: mjansen Date: Sun Jul 2 11:50:38 2017 New Revision: 75263 URL:
http://svn.reactos.org/svn/reactos?rev=75263&view=rev
Log: [REGEDIT] Pre-select the text in the edit dialog. Modified: trunk/reactos/base/applications/regedit/edit.c Modified: trunk/reactos/base/applications/regedit/edit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/edit.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/edit.c [iso-8859-1] Sun Jul 2 11:50:38 2017 @@ -115,6 +115,7 @@ SetDlgItemTextW(hwndDlg, IDC_VALUE_NAME, buffer); } SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, stringValueData); + SendMessage(GetDlgItem(hwndDlg, IDC_VALUE_DATA), EM_SETSEL, 0, -1); SetFocus(GetDlgItem(hwndDlg, IDC_VALUE_DATA)); return FALSE; case WM_COMMAND: @@ -305,6 +306,7 @@ CheckRadioButton (hwndDlg, IDC_FORMAT_HEX, IDC_FORMAT_DEC, IDC_FORMAT_HEX); swprintf(ValueString, L"%lx", dwordValueData); SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, ValueString); + SendMessage(GetDlgItem(hwndDlg, IDC_VALUE_DATA), EM_SETSEL, 0, -1); SetFocus(GetDlgItem(hwndDlg, IDC_VALUE_DATA)); return FALSE;
7 years, 5 months
1
0
0
0
[mjansen] 75262: [APPHELP] Propagate applied layers to child processes by setting the env var __COMPAT_LAYER. CORE-13284
by mjansen@svn.reactos.org
Author: mjansen Date: Sun Jul 2 11:43:54 2017 New Revision: 75262 URL:
http://svn.reactos.org/svn/reactos?rev=75262&view=rev
Log: [APPHELP] Propagate applied layers to child processes by setting the env var __COMPAT_LAYER. CORE-13284 Modified: trunk/reactos/dll/appcompat/apphelp/shimeng.c Modified: trunk/reactos/dll/appcompat/apphelp/shimeng.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/shim…
============================================================================== --- trunk/reactos/dll/appcompat/apphelp/shimeng.c [iso-8859-1] (original) +++ trunk/reactos/dll/appcompat/apphelp/shimeng.c [iso-8859-1] Sun Jul 2 11:43:54 2017 @@ -330,8 +330,7 @@ } - -VOID SeiAddShim(TAGREF trShimRef, PARRAY pShimRef) +static VOID SeiAddShim(TAGREF trShimRef, PARRAY pShimRef) { TAGREF* Data; if (!ARRAY_EnsureSize(pShimRef, sizeof(TAGREF), 10)) @@ -342,8 +341,26 @@ pShimRef->Size++; } -VOID SeiBuildShimRefArray(HSDB hsdb, SDBQUERYRESULT* pQuery, PARRAY pShimRef) -{ +static VOID SeiSetLayerEnvVar(LPCWSTR wszLayer) +{ + NTSTATUS Status; + UNICODE_STRING VarName = RTL_CONSTANT_STRING(L"__COMPAT_LAYER"); + UNICODE_STRING Value; + + RtlInitUnicodeString(&Value, wszLayer); + + Status = RtlSetEnvironmentVariable(NULL, &VarName, &Value); + if (NT_SUCCESS(Status)) + SHIMENG_INFO("Set env var %wZ=%wZ\n", &VarName, &Value); + else + SHIMENG_FAIL("Failed to set %wZ: 0x%x\n", &VarName, Status); +} + +#define MAX_LAYER_LENGTH 256 + +static VOID SeiBuildShimRefArray(HSDB hsdb, SDBQUERYRESULT* pQuery, PARRAY pShimRef) +{ + WCHAR wszLayerEnvVar[MAX_LAYER_LENGTH] = { 0 }; DWORD n; for (n = 0; n < pQuery->dwExeCount; ++n) @@ -382,7 +399,17 @@ LPCWSTR LayerName = SeiGetStringPtr(pdb, tag, TAG_NAME); TAGID ShimRef = SdbFindFirstTag(pdb, tag, TAG_SHIM_REF); if (LayerName) + { + HRESULT hr; SeiDbgPrint(SEI_MSG, NULL, "ShimInfo(Layer(%S))\n", LayerName); + if (wszLayerEnvVar[0]) + StringCchCatW(wszLayerEnvVar, _countof(wszLayerEnvVar), L" "); + hr = StringCchCatW(wszLayerEnvVar, _countof(wszLayerEnvVar), LayerName); + if (!SUCCEEDED(hr)) + { + SHIMENG_FAIL("Unable to append %S\n", LayerName); + } + } while (ShimRef != TAGID_NULL) { @@ -396,6 +423,8 @@ /* Handle FLAG_REF */ } } + if (wszLayerEnvVar[0]) + SeiSetLayerEnvVar(wszLayerEnvVar); }
7 years, 5 months
1
0
0
0
[ekohl] 75261: [NETAPI32] - Add DsEnumerateDomainTrustsA, DsEnumerateDomainTrustsW, DsRoleFreeMemory, DsGetDcNameA, DsGetDcNameW, DsGetSiteNameA and DsGetSiteNameW stubs to netlogon.c. - Remove the...
by ekohl@svn.reactos.org
Author: ekohl Date: Sat Jul 1 23:12:06 2017 New Revision: 75261 URL:
http://svn.reactos.org/svn/reactos?rev=75261&view=rev
Log: [NETAPI32] - Add DsEnumerateDomainTrustsA, DsEnumerateDomainTrustsW, DsRoleFreeMemory, DsGetDcNameA, DsGetDcNameW, DsGetSiteNameA and DsGetSiteNameW stubs to netlogon.c. - Remove the now obsolete file ds.c. - Implement DsGetSiteNameW and NetEnumerateTrustedDomains. These functions call their counterpart in the netlogon service. Removed: trunk/reactos/dll/win32/netapi32/ds.c Modified: trunk/reactos/dll/win32/netapi32/CMakeLists.txt trunk/reactos/dll/win32/netapi32/netapi32.spec trunk/reactos/dll/win32/netapi32/netlogon.c trunk/reactos/sdk/include/reactos/idl/netlogon.idl Modified: trunk/reactos/dll/win32/netapi32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/CMakeLi…
============================================================================== --- trunk/reactos/dll/win32/netapi32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/CMakeLists.txt [iso-8859-1] Sat Jul 1 23:12:06 2017 @@ -17,7 +17,6 @@ access.c apibuf.c browser.c - ds.c dssetup.c group.c local_group.c Removed: trunk/reactos/dll/win32/netapi32/ds.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/ds.c?re…
============================================================================== --- trunk/reactos/dll/win32/netapi32/ds.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/ds.c (removed) @@ -1,87 +0,0 @@ -/* - * Copyright 2005 Paul Vriens - * - * netapi32 directory service functions - * - * 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 "netapi32.h" - -#include <dsrole.h> -#include <dsgetdc.h> - -WINE_DEFAULT_DEBUG_CHANNEL(ds); - -DWORD WINAPI DsGetDcNameW(LPCWSTR ComputerName, LPCWSTR AvoidDCName, - GUID* DomainGuid, LPCWSTR SiteName, ULONG Flags, - PDOMAIN_CONTROLLER_INFOW *DomainControllerInfo) -{ - FIXME("(%s, %s, %s, %s, %08x, %p): stub\n", debugstr_w(ComputerName), - debugstr_w(AvoidDCName), debugstr_guid(DomainGuid), - debugstr_w(SiteName), Flags, DomainControllerInfo); - return ERROR_CALL_NOT_IMPLEMENTED; -} - -DWORD WINAPI DsGetDcNameA(LPCSTR ComputerName, LPCSTR AvoidDCName, - GUID* DomainGuid, LPCSTR SiteName, ULONG Flags, - PDOMAIN_CONTROLLER_INFOA *DomainControllerInfo) -{ - FIXME("(%s, %s, %s, %s, %08x, %p): stub\n", debugstr_a(ComputerName), - debugstr_a(AvoidDCName), debugstr_guid(DomainGuid), - debugstr_a(SiteName), Flags, DomainControllerInfo); - return ERROR_CALL_NOT_IMPLEMENTED; -} - -DWORD WINAPI DsGetSiteNameW(LPCWSTR ComputerName, LPWSTR *SiteName) -{ - FIXME("(%s, %p): stub\n", debugstr_w(ComputerName), SiteName); - return ERROR_CALL_NOT_IMPLEMENTED; -} - -/************************************************************ - * DsRoleFreeMemory (NETAPI32.@) - * - * PARAMS - * Buffer [I] Pointer to the to-be-freed buffer. - * - * RETURNS - * Nothing - */ -VOID WINAPI DsRoleFreeMemory(PVOID Buffer) -{ - TRACE("(%p)\n", Buffer); - HeapFree(GetProcessHeap(), 0, Buffer); -} - -/************************************************************ - * DsEnumerateDomainTrustsA (NETAPI32.@) - */ - -DWORD WINAPI DsEnumerateDomainTrustsA(LPSTR ServerName, ULONG Flags, PDS_DOMAIN_TRUSTSA* Domains, PULONG DomainCount) -{ - FIXME("(%s, %x, %p, %p): stub\n", ServerName, Flags, Domains, DomainCount); - return ERROR_NO_LOGON_SERVERS; -} - -/************************************************************ - * DsEnumerateDomainTrustsW (NETAPI32.@) - */ - -DWORD WINAPI DsEnumerateDomainTrustsW(LPWSTR ServerName, ULONG Flags, PDS_DOMAIN_TRUSTSW* Domains, PULONG DomainCount) -{ - FIXME("(%s, %x, %p, %p): stub\n", debugstr_w(ServerName), Flags, Domains, DomainCount); - return ERROR_NO_LOGON_SERVERS; -} Modified: trunk/reactos/dll/win32/netapi32/netapi32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/netapi3…
============================================================================== --- trunk/reactos/dll/win32/netapi32/netapi32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/netapi32.spec [iso-8859-1] Sat Jul 1 23:12:06 2017 @@ -19,7 +19,7 @@ @ stub DsGetDcSiteCoverageA @ stub DsGetDcSiteCoverageW @ stub DsGetForestTrustInformationW -@ stub DsGetSiteNameA +@ stdcall DsGetSiteNameA(str str) @ stdcall DsGetSiteNameW(wstr wstr) @ stub DsMergeForestTrustInformationW @ stub DsRoleAbortDownlevelServerUpgrade Modified: trunk/reactos/dll/win32/netapi32/netlogon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/netlogo…
============================================================================== --- trunk/reactos/dll/win32/netapi32/netlogon.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/netlogon.c [iso-8859-1] Sat Jul 1 23:12:06 2017 @@ -10,6 +10,8 @@ #include "netapi32.h" #include <rpc.h> +#include <dsrole.h> +#include <dsgetdc.h> #include "netlogon_c.h" WINE_DEFAULT_DEBUG_CHANNEL(netapi32); @@ -71,16 +73,147 @@ } +DWORD +WINAPI +DsEnumerateDomainTrustsA( + _In_opt_ LPSTR ServerName, + _In_ ULONG Flags, + _Out_ PDS_DOMAIN_TRUSTSA *Domains, + _Out_ PULONG DomainCount) +{ + FIXME("DsEnumerateDomainTrustsA(%s, %x, %p, %p)\n", + debugstr_a(ServerName), Flags, Domains, DomainCount); + + return ERROR_NO_LOGON_SERVERS; +} + + +DWORD +WINAPI +DsEnumerateDomainTrustsW( + _In_opt_ LPWSTR ServerName, + _In_ ULONG Flags, + _Out_ PDS_DOMAIN_TRUSTSW *Domains, + _Out_ PULONG DomainCount) +{ + FIXME("DsEnumerateDomainTrustsW(%s, %x, %p, %p)\n", + debugstr_w(ServerName), Flags, Domains, DomainCount); + + return ERROR_NO_LOGON_SERVERS; +} + + +VOID +WINAPI +DsRoleFreeMemory( + _In_ PVOID Buffer) +{ + TRACE("DsRoleFreeMemory(%p)\n", Buffer); + HeapFree(GetProcessHeap(), 0, Buffer); +} + + +DWORD +WINAPI +DsGetDcNameA( + _In_ LPCSTR ComputerName, + _In_ LPCSTR DomainName, + _In_ GUID *DomainGuid, + _In_ LPCSTR SiteName, + _In_ ULONG Flags, + _Out_ PDOMAIN_CONTROLLER_INFOA *DomainControllerInfo) +{ + FIXME("DsGetDcNameA(%s, %s, %s, %s, %08x, %p): stub\n", + debugstr_a(ComputerName), debugstr_a(DomainName), debugstr_guid(DomainGuid), + debugstr_a(SiteName), Flags, DomainControllerInfo); + + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +DWORD +WINAPI +DsGetDcNameW( + _In_ LPCWSTR ComputerName, + _In_ LPCWSTR DomainName, + _In_ GUID *DomainGuid, + _In_ LPCWSTR SiteName, + _In_ ULONG Flags, + _Out_ PDOMAIN_CONTROLLER_INFOW *DomainControllerInfo) +{ + FIXME("DsGetDcNameW(%s, %s, %s, %s, %08x, %p)\n", + debugstr_w(ComputerName), debugstr_w(DomainName), debugstr_guid(DomainGuid), + debugstr_w(SiteName), Flags, DomainControllerInfo); + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +DWORD +WINAPI +DsGetSiteNameA( + _In_ LPCSTR ComputerName, + _Out_ LPSTR *SiteName) +{ + FIXME("DsGetSiteNameA(%s, %p)\n", + debugstr_a(ComputerName), SiteName); + + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +DWORD +WINAPI +DsGetSiteNameW( + _In_ LPCWSTR ComputerName, + _Out_ LPWSTR *SiteName) +{ + NET_API_STATUS status; + + TRACE("DsGetSiteNameW(%s, %p)\n", + debugstr_w(ComputerName), SiteName); + + RpcTryExcept + { + status = DsrGetSiteName((PWSTR)ComputerName, + SiteName); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return status; +} + + NTSTATUS WINAPI NetEnumerateTrustedDomains( _In_ LPWSTR ServerName, _Out_ LPWSTR *DomainNames) { - FIXME("NetEnumerateTrustedDomains(%s, %p)\n", + DOMAIN_NAME_BUFFER DomainNameBuffer = {0, NULL}; + NTSTATUS Status = 0; + + TRACE("NetEnumerateTrustedDomains(%s, %p)\n", debugstr_w(ServerName), DomainNames); - return STATUS_NOT_IMPLEMENTED; + RpcTryExcept + { + Status = NetrEnumerateTrustedDomains(ServerName, + &DomainNameBuffer); + if (NT_SUCCESS(Status)) + { + *DomainNames = (LPWSTR)DomainNameBuffer.DomainNames; + } + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + Status = I_RpcMapWin32Status(RpcExceptionCode()); + } RpcEndExcept; + + return Status; } Modified: trunk/reactos/sdk/include/reactos/idl/netlogon.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/reactos/idl/ne…
============================================================================== --- trunk/reactos/sdk/include/reactos/idl/netlogon.idl [iso-8859-1] (original) +++ trunk/reactos/sdk/include/reactos/idl/netlogon.idl [iso-8859-1] Sat Jul 1 23:12:06 2017 @@ -811,6 +811,7 @@ [size_is(EntryCount)] PRPC_UNICODE_STRING SiteNames; } NL_SITE_NAME_ARRAY, *PNL_SITE_NAME_ARRAY; +cpp_quote("#ifndef _DSGETDC_H") typedef struct _DS_DOMAIN_TRUSTSW { [string] wchar_t *NetbiosDomainName; @@ -822,6 +823,7 @@ PRPC_SID DomainSid; GUID DomainGuid; } DS_DOMAIN_TRUSTSW, *PDS_DOMAIN_TRUSTSW; +cpp_quote("#endif") typedef struct _NETLOGON_TRUSTED_DOMAIN_ARRAY { @@ -905,6 +907,7 @@ ULONG SerialNumber; } UAS_INFO_0, *PUAS_INFO_0; +cpp_quote("#ifndef _DSGETDC_H") typedef struct _DOMAIN_CONTROLLER_INFOW { [string, unique] wchar_t *DomainControllerName; @@ -917,6 +920,7 @@ [string, unique] wchar_t *DcSiteName; [string, unique] wchar_t *ClientSiteName; } DOMAIN_CONTROLLER_INFOW, *PDOMAIN_CONTROLLER_INFOW; +cpp_quote("#endif") typedef struct _NL_TRUST_PASSWORD { @@ -1430,7 +1434,7 @@ /* Function 41 */ NET_API_STATUS __stdcall - DsrDeregisterDnsHostRecords ( + DsrDeregisterDnsHostRecords( [in, unique, string] LOGONSRV_HANDLE ServerName, [in, unique, string] wchar_t *DnsDomainName, [in, unique] GUID *DomainGuid,
7 years, 5 months
1
0
0
0
[ssawant] 75260: [QCKLNCH] -Whitespace fixes -Minor suggestions fixed. -Minor refactors and some code fixes. CR-122 (https://code.reactos.org/cru/CR-122#details)
by ssawant@svn.reactos.org
Author: ssawant Date: Sat Jul 1 20:22:13 2017 New Revision: 75260 URL:
http://svn.reactos.org/svn/reactos?rev=75260&view=rev
Log: [QCKLNCH] -Whitespace fixes -Minor suggestions fixed. -Minor refactors and some code fixes. CR-122 (
https://code.reactos.org/cru/CR-122#details
) Modified: branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CISFBand.cpp branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CISFBand.h branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CMakeLists.txt branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CQuickLaunchBand.cpp branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CQuickLaunchBand.h branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/qcklnch.cpp branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/qcklnch.rc branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/resource.h branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/rgs/qcklnch.rgs Modified: branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CISFBand.cpp URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/shellext/reactos/dll/…
============================================================================== --- branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CISFBand.cpp [iso-8859-1] (original) +++ branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CISFBand.cpp [iso-8859-1] Sat Jul 1 20:22:13 2017 @@ -33,7 +33,7 @@ } // *** CWindowImpl *** -//Subclassing +// Subclassing LRESULT CISFBand::OnLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { @@ -100,7 +100,7 @@ return 0; } -//ToolbarTest +// ToolbarTest HWND CISFBand::CreateSimpleToolbar(HWND hWndParent, HINSTANCE hInst) { // Declare and initialize local constants. @@ -120,7 +120,7 @@ return NULL; SendMessage(hWndToolbar, TB_SETIMAGELIST, 0, (LPARAM)piml); - //Enumerate objects + // Enumerate objects CComPtr<IEnumIDList> pedl; LPITEMIDLIST pidl = NULL; STRRET stret; @@ -150,7 +150,7 @@ /*****************************************************************************/ // *** IObjectWithSite *** - HRESULT STDMETHODCALLTYPE CISFBand::SetSite(IUnknown *pUnkSite) + STDMETHODIMP CISFBand::SetSite(IUnknown *pUnkSite) { HRESULT hr; HWND hwndParent; @@ -173,7 +173,7 @@ return S_OK; } - HRESULT STDMETHODCALLTYPE CISFBand::GetSite(IN REFIID riid, OUT VOID **ppvSite) + STDMETHODIMP CISFBand::GetSite(IN REFIID riid, OUT VOID **ppvSite) { TRACE("CISFBand::GetSite(0x%p,0x%p)\n", riid, ppvSite); @@ -190,7 +190,7 @@ /*****************************************************************************/ // *** IDeskBand *** - HRESULT STDMETHODCALLTYPE CISFBand::GetWindow(OUT HWND *phwnd) + STDMETHODIMP CISFBand::GetWindow(OUT HWND *phwnd) { if (!m_hWndTb) return E_FAIL; @@ -201,13 +201,13 @@ return S_OK; } - HRESULT STDMETHODCALLTYPE CISFBand::ContextSensitiveHelp(IN BOOL fEnterMode) + STDMETHODIMP CISFBand::ContextSensitiveHelp(IN BOOL fEnterMode) { /* FIXME: Implement */ return E_NOTIMPL; } - HRESULT STDMETHODCALLTYPE CISFBand::ShowDW(IN BOOL bShow) + STDMETHODIMP CISFBand::ShowDW(IN BOOL bShow) { if (m_hWndTb) { @@ -217,7 +217,7 @@ return S_OK; } - HRESULT STDMETHODCALLTYPE CISFBand::CloseDW(IN DWORD dwReserved) + STDMETHODIMP CISFBand::CloseDW(IN DWORD dwReserved) { if (m_hWndTb) { @@ -229,14 +229,14 @@ return S_OK; } - HRESULT STDMETHODCALLTYPE CISFBand::ResizeBorderDW(LPCRECT prcBorder, IUnknown *punkToolbarSite, BOOL fReserved) + STDMETHODIMP CISFBand::ResizeBorderDW(LPCRECT prcBorder, IUnknown *punkToolbarSite, BOOL fReserved) { /* No need to implement this method */ return E_NOTIMPL; } - HRESULT STDMETHODCALLTYPE CISFBand::GetBandInfo(IN DWORD dwBandID, IN DWORD dwViewMode, IN OUT DESKBANDINFO *pdbi) + STDMETHODIMP CISFBand::GetBandInfo(IN DWORD dwBandID, IN DWORD dwViewMode, IN OUT DESKBANDINFO *pdbi) { TRACE("CTaskBand::GetBandInfo(0x%x,0x%x,0x%p) hWnd=0x%p\n", dwBandID, dwViewMode, pdbi, m_hWndTb); @@ -298,21 +298,21 @@ /*****************************************************************************/ // *** IDeskBar *** - HRESULT STDMETHODCALLTYPE CISFBand::SetClient(IN IUnknown *punkClient) + STDMETHODIMP CISFBand::SetClient(IN IUnknown *punkClient) { TRACE("IDeskBar::SetClient(0x%p)\n", punkClient); return E_NOTIMPL; } - HRESULT STDMETHODCALLTYPE CISFBand::GetClient(OUT IUnknown **ppunkClient) + STDMETHODIMP CISFBand::GetClient(OUT IUnknown **ppunkClient) { TRACE("IDeskBar::GetClient(0x%p)\n", ppunkClient); return E_NOTIMPL; } - HRESULT STDMETHODCALLTYPE CISFBand::OnPosRectChangeDB(IN RECT *prc) + STDMETHODIMP CISFBand::OnPosRectChangeDB(IN RECT *prc) { TRACE("IDeskBar::OnPosRectChangeDB(0x%p=(%d,%d,%d,%d))\n", prc, prc->left, prc->top, prc->right, prc->bottom); @@ -321,7 +321,7 @@ /*****************************************************************************/ // *** IPersistStream *** - HRESULT STDMETHODCALLTYPE CISFBand::GetClassID(OUT CLSID *pClassID) + STDMETHODIMP CISFBand::GetClassID(OUT CLSID *pClassID) { TRACE("CISFBand::GetClassID(0x%p)\n", pClassID); /* We're going to return the (internal!) CLSID of the quick launch band */ @@ -330,14 +330,14 @@ return S_OK; } - HRESULT STDMETHODCALLTYPE CISFBand::IsDirty() + STDMETHODIMP CISFBand::IsDirty() { /* The object hasn't changed since the last save! */ return S_FALSE; } - HRESULT STDMETHODCALLTYPE CISFBand::Load(IN IStream *pStm) + STDMETHODIMP CISFBand::Load(IN IStream *pStm) { TRACE("CISFBand::Load called\n"); /* Nothing to do */ @@ -345,14 +345,14 @@ return S_OK; } - HRESULT STDMETHODCALLTYPE CISFBand::Save(IN IStream *pStm, IN BOOL fClearDirty) + STDMETHODIMP CISFBand::Save(IN IStream *pStm, IN BOOL fClearDirty) { /* Nothing to do */ return S_OK; } - HRESULT STDMETHODCALLTYPE CISFBand::GetSizeMax(OUT ULARGE_INTEGER *pcbSize) + STDMETHODIMP CISFBand::GetSizeMax(OUT ULARGE_INTEGER *pcbSize) { TRACE("CISFBand::GetSizeMax called\n"); @@ -361,14 +361,14 @@ /*****************************************************************************/ // *** IWinEventHandler *** - HRESULT STDMETHODCALLTYPE CISFBand::ProcessMessage(IN HWND hWnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam, OUT LRESULT *plrResult) + STDMETHODIMP CISFBand::ProcessMessage(IN HWND hWnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam, OUT LRESULT *plrResult) { TRACE("CISFBand: IWinEventHandler::ProcessMessage(0x%p, 0x%x, 0x%p, 0x%p, 0x%p)\n", hWnd, uMsg, wParam, lParam, plrResult); return E_NOTIMPL; } - HRESULT STDMETHODCALLTYPE CISFBand::ContainsWindow(IN HWND hWnd) + STDMETHODIMP CISFBand::ContainsWindow(IN HWND hWnd) { if (hWnd == m_hWndTb || ::IsChild(m_hWndTb, hWnd)) { @@ -379,28 +379,28 @@ return S_FALSE; } - HRESULT STDMETHODCALLTYPE CISFBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult) + STDMETHODIMP CISFBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult) { UNIMPLEMENTED; return E_NOTIMPL; } - HRESULT STDMETHODCALLTYPE CISFBand::IsWindowOwner(HWND hWnd) + STDMETHODIMP CISFBand::IsWindowOwner(HWND hWnd) { return (hWnd == m_hWndTb) ? S_OK : S_FALSE; } /*****************************************************************************/ // *** IOleCommandTarget methods *** - HRESULT STDMETHODCALLTYPE CISFBand::QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText) + STDMETHODIMP CISFBand::QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText) { UNIMPLEMENTED; return E_NOTIMPL; } - HRESULT STDMETHODCALLTYPE CISFBand::Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) + STDMETHODIMP CISFBand::Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) { if (IsEqualIID(*pguidCmdGroup, IID_IBandSite)) { @@ -419,12 +419,12 @@ /*****************************************************************************/ // *** IShellFolderBand *** - HRESULT STDMETHODCALLTYPE CISFBand::GetBandInfoSFB(PBANDINFOSFB pbi) - { - return E_NOTIMPL; - } - - HRESULT STDMETHODCALLTYPE CISFBand::InitializeSFB(IShellFolder *psf, PCIDLIST_ABSOLUTE pidl) + STDMETHODIMP CISFBand::GetBandInfoSFB(PBANDINFOSFB pbi) + { + return E_NOTIMPL; + } + + STDMETHODIMP CISFBand::InitializeSFB(IShellFolder *psf, PCIDLIST_ABSOLUTE pidl) { LPITEMIDLIST pidlRoot; SHGetSpecialFolderLocation(0, CSIDL_DESKTOP, &pidlRoot); @@ -443,14 +443,14 @@ return S_OK; } - HRESULT STDMETHODCALLTYPE CISFBand::SetBandInfoSFB( PBANDINFOSFB pbi) + STDMETHODIMP CISFBand::SetBandInfoSFB( PBANDINFOSFB pbi) { return E_NOTIMPL; } /*****************************************************************************/ // *** IContextMenu *** - HRESULT STDMETHODCALLTYPE CISFBand::GetCommandString(UINT_PTR idCmd, UINT uFlags, UINT *pwReserved, LPSTR pszName, UINT cchMax) + STDMETHODIMP CISFBand::GetCommandString(UINT_PTR idCmd, UINT uFlags, UINT *pwReserved, LPSTR pszName, UINT cchMax) { /*HRESULT hr = E_INVALIDARG; @@ -481,7 +481,7 @@ return S_OK; } - HRESULT STDMETHODCALLTYPE CISFBand::InvokeCommand(LPCMINVOKECOMMANDINFO pici) + STDMETHODIMP CISFBand::InvokeCommand(LPCMINVOKECOMMANDINFO pici) { if (!HIWORD(pici->lpVerb)) { @@ -537,9 +537,9 @@ return S_OK; } - HRESULT STDMETHODCALLTYPE CISFBand::QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) - { - HMENU qMenu = LoadMenu(_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCE(IDR_POPUPMENU)); + STDMETHODIMP CISFBand::QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) + { + HMENU qMenu = LoadMenu(_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCE(IDM_POPUPMENU)); UINT idMax = Shell_MergeMenus(hmenu, GetSubMenu(qMenu, 0), indexMenu, idCmdFirst, idCmdLast, MM_SUBMENUSHAVEIDS); if(m_textFlag) @@ -562,7 +562,7 @@ } /*****************************************************************************/ -//C Constructor +// C Constructor extern "C" HRESULT WINAPI CISFBand_CreateInstance(REFIID riid, void** ppv) { Modified: branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CISFBand.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/shellext/reactos/dll/…
============================================================================== --- branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CISFBand.h [iso-8859-1] (original) +++ branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CISFBand.h [iso-8859-1] Sat Jul 1 20:22:13 2017 @@ -7,7 +7,7 @@ */ #pragma once -//COM class for cisfband +// COM class for cisfband class CISFBand : public CWindowImpl<CISFBand>, public CComCoClass<CISFBand>, @@ -21,17 +21,17 @@ public IShellFolderBand, public IContextMenu { - //band + // band DWORD m_BandID; CComPtr<IUnknown> m_Site; - //Toolbar + // Toolbar HWND m_hWndTb; HINSTANCE m_hInstance; CComPtr<IShellFolder> m_pISF; PCIDLIST_ABSOLUTE m_pidl; - //Menu + // Menu BOOL m_textFlag; BOOL m_iconFlag; @@ -40,90 +40,90 @@ CISFBand(); virtual ~CISFBand(); -//Personal Methods +// Personal Methods HWND CreateSimpleToolbar(HWND hWndParent, HINSTANCE hInst); LRESULT OnLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnRButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); -//IObjectWithSite - - virtual HRESULT STDMETHODCALLTYPE GetSite( - /*[in]*/ REFIID riid, - /*[out]*/ void **ppvSite - ); - - virtual HRESULT STDMETHODCALLTYPE SetSite( - /*[in]*/ IUnknown *pUnkSite +// IObjectWithSite + + virtual STDMETHODIMP GetSite( + IN REFIID riid, + OUT void **ppvSite + ); + + virtual STDMETHODIMP SetSite( + IN IUnknown *pUnkSite ); -//IDeskBand - - virtual HRESULT STDMETHODCALLTYPE GetWindow( +// IDeskBand + + virtual STDMETHODIMP GetWindow( OUT HWND *phwnd ); - virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp( + virtual STDMETHODIMP ContextSensitiveHelp( IN BOOL fEnterMode ); - virtual HRESULT STDMETHODCALLTYPE ShowDW( + virtual STDMETHODIMP ShowDW( IN BOOL bShow ); - virtual HRESULT STDMETHODCALLTYPE CloseDW( + virtual STDMETHODIMP CloseDW( IN DWORD dwReserved ); - virtual HRESULT STDMETHODCALLTYPE ResizeBorderDW( + virtual STDMETHODIMP ResizeBorderDW( LPCRECT prcBorder, IUnknown *punkToolbarSite, BOOL fReserved ); - virtual HRESULT STDMETHODCALLTYPE GetBandInfo( + virtual STDMETHODIMP GetBandInfo( IN DWORD dwBandID, IN DWORD dwViewMode, IN OUT DESKBANDINFO *pdbi ); -//IDeskBar - - virtual HRESULT STDMETHODCALLTYPE GetClient( - /*[out]*/ IUnknown **ppunkClient - ); - - virtual HRESULT STDMETHODCALLTYPE OnPosRectChangeDB( - /*[in]*/ LPRECT prc - ); - - virtual HRESULT STDMETHODCALLTYPE SetClient( - /*[in, optional]*/ IUnknown *punkClient - ); - -//IPersistStream - - virtual HRESULT STDMETHODCALLTYPE GetClassID( - /*[out]*/ OUT CLSID *pClassID - ); - - virtual HRESULT STDMETHODCALLTYPE GetSizeMax( - /*[out]*/ ULARGE_INTEGER *pcbSize - ); - - virtual HRESULT STDMETHODCALLTYPE IsDirty(); - - virtual HRESULT STDMETHODCALLTYPE Load( - /*[in]*/ IStream *pStm - ); - - virtual HRESULT STDMETHODCALLTYPE Save( - /*[in]*/ IStream *pStm, - /*[in]*/ BOOL fClearDirty - ); - -//IWinEventHandler - - virtual HRESULT STDMETHODCALLTYPE ProcessMessage( +// IDeskBar + + virtual STDMETHODIMP GetClient( + OUT IUnknown **ppunkClient + ); + + virtual STDMETHODIMP OnPosRectChangeDB( + IN LPRECT prc + ); + + virtual STDMETHODIMP SetClient( + IN OPTIONAL IUnknown *punkClient + ); + +// IPersistStream + + virtual STDMETHODIMP GetClassID( + OUT CLSID *pClassID + ); + + virtual STDMETHODIMP GetSizeMax( + OUT ULARGE_INTEGER *pcbSize + ); + + virtual STDMETHODIMP IsDirty(); + + virtual STDMETHODIMP Load( + IN IStream *pStm + ); + + virtual STDMETHODIMP Save( + IN IStream *pStm, + IN BOOL fClearDirty + ); + +// IWinEventHandler + + virtual STDMETHODIMP ProcessMessage( IN HWND hWnd, IN UINT uMsg, IN WPARAM wParam, @@ -131,11 +131,11 @@ OUT LRESULT *plrResult ); - virtual HRESULT STDMETHODCALLTYPE ContainsWindow( + virtual STDMETHODIMP ContainsWindow( IN HWND hWnd ); - virtual HRESULT STDMETHODCALLTYPE OnWinEvent( + virtual STDMETHODIMP OnWinEvent( HWND hWnd, UINT uMsg, WPARAM wParam, @@ -143,43 +143,43 @@ LRESULT *theResult ); - virtual HRESULT STDMETHODCALLTYPE IsWindowOwner( + virtual STDMETHODIMP IsWindowOwner( HWND hWnd ); -//IOleCommandTarget - - virtual HRESULT STDMETHODCALLTYPE Exec( - /*[in]*/ const GUID *pguidCmdGroup, - /*[in]*/ DWORD nCmdID, - /*[in]*/ DWORD nCmdexecopt, - /*[in]*/ VARIANT *pvaIn, - /*[in, out]*/ VARIANT *pvaOut - ); - - virtual HRESULT STDMETHODCALLTYPE QueryStatus( - /*[in]*/ const GUID *pguidCmdGroup, - /*[in]*/ ULONG cCmds, - /*[in, out]*/ OLECMD prgCmds[], - /*[in, out]*/ OLECMDTEXT *pCmdText - ); - -//IShellFolderBand - virtual HRESULT STDMETHODCALLTYPE GetBandInfoSFB( +// IOleCommandTarget + + virtual STDMETHODIMP Exec( + IN const GUID *pguidCmdGroup, + IN DWORD nCmdID, + IN DWORD nCmdexecopt, + IN VARIANT *pvaIn, + IN OUT VARIANT *pvaOut + ); + + virtual STDMETHODIMP QueryStatus( + IN const GUID *pguidCmdGroup, + IN ULONG cCmds, + IN OUT OLECMD prgCmds[], + IN OUT OLECMDTEXT *pCmdText + ); + +// IShellFolderBand + virtual STDMETHODIMP GetBandInfoSFB( PBANDINFOSFB pbi ); - virtual HRESULT STDMETHODCALLTYPE InitializeSFB( + virtual STDMETHODIMP InitializeSFB( IShellFolder *psf, PCIDLIST_ABSOLUTE pidl ); - virtual HRESULT STDMETHODCALLTYPE SetBandInfoSFB( + virtual STDMETHODIMP SetBandInfoSFB( PBANDINFOSFB pbi ); -//IContextMenu - virtual HRESULT STDMETHODCALLTYPE GetCommandString( +// IContextMenu + virtual STDMETHODIMP GetCommandString( UINT_PTR idCmd, UINT uFlags, UINT *pwReserved, @@ -187,11 +187,11 @@ UINT cchMax ); - virtual HRESULT STDMETHODCALLTYPE InvokeCommand( + virtual STDMETHODIMP InvokeCommand( LPCMINVOKECOMMANDINFO pici ); - virtual HRESULT STDMETHODCALLTYPE QueryContextMenu( + virtual STDMETHODIMP QueryContextMenu( HMENU hmenu, UINT indexMenu, UINT idCmdFirst, @@ -221,6 +221,6 @@ END_COM_MAP() }; -//C Constructor +// C Constructor extern "C" HRESULT WINAPI CISFBand_CreateInstance(REFIID riid, void** ppv); Modified: branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/shellext/reactos/dll/…
============================================================================== --- branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CMakeLists.txt [iso-8859-1] Sat Jul 1 20:22:13 2017 @@ -14,11 +14,13 @@ spec2def(qcklnch.dll qcklnch.spec) -add_library(qcklnch SHARED - qcklnch.cpp - qcklnch.rc +add_library(qcklnch SHARED + qcklnch.rc + qcklnch.cpp CQuickLaunchBand.cpp - CISFBand.cpp + CISFBand.cpp + CQuickLaunchBand.h + CISFBand.h ${CMAKE_CURRENT_BINARY_DIR}/qcklnch.def) set_module_type(qcklnch win32dll UNICODE) Modified: branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CQuickLaunchBand.cpp URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/shellext/reactos/dll/…
============================================================================== --- branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CQuickLaunchBand.cpp [iso-8859-1] (original) +++ branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CQuickLaunchBand.cpp [iso-8859-1] Sat Jul 1 20:22:13 2017 @@ -13,7 +13,7 @@ // {260CB95D-4544-44F6-A079-575BAA60B72F} static const GUID CLSID_QuickLaunchBand = { 0x260cb95d, 0x4544, 0x44f6, { 0xa0, 0x79, 0x57, 0x5b, 0xaa, 0x60, 0xb7, 0x2f } }; -//Componenet Category Registration +// Componenet Category Registration HRESULT RegisterComCat() { CComPtr<ICatRegister> pcr; @@ -38,7 +38,7 @@ return hr; } -//Pidl Browser +// Pidl Browser LPITEMIDLIST PidlBrowse(HWND hwnd, int nCSIDL) { LPITEMIDLIST pidlRoot = NULL; @@ -61,14 +61,14 @@ return pidlSelected; } -//CQuickLaunchBand +// CQuickLaunchBand CQuickLaunchBand::CQuickLaunchBand() {} CQuickLaunchBand::~CQuickLaunchBand() {} /*****************************************************************************/ -//ATL Construct +// ATL Construct HRESULT CQuickLaunchBand::FinalConstruct() { @@ -90,12 +90,12 @@ return hr; } -//IObjectWithSite - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::SetSite(IUnknown *pUnkSite) +// IObjectWithSite + STDMETHODIMP CQuickLaunchBand::SetSite(IUnknown *pUnkSite) { TRACE("CQuickLaunchBand::SetSite(0x%p)\n", pUnkSite); - //Internal CISFBand Calls + // Internal CISFBand Calls CComPtr<IObjectWithSite> pIOWS; HRESULT hr = m_punkISFB->QueryInterface(IID_IObjectWithSite, (void**)&pIOWS); if (FAILED(hr)) return hr; @@ -103,11 +103,11 @@ return pIOWS->SetSite(pUnkSite); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetSite(IN REFIID riid, OUT VOID **ppvSite) + STDMETHODIMP CQuickLaunchBand::GetSite(IN REFIID riid, OUT VOID **ppvSite) { TRACE("CQuickLaunchBand::GetSite(0x%p,0x%p)\n", riid, ppvSite); - //Internal CISFBand Calls + // Internal CISFBand Calls CComPtr<IObjectWithSite> pIOWS; HRESULT hr = m_punkISFB->QueryInterface(IID_IObjectWithSite, (void**)&pIOWS); if (FAILED(hr)) return hr; @@ -116,10 +116,10 @@ } /*****************************************************************************/ -//IDeskBand - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetWindow(OUT HWND *phwnd) - { - //Internal CISFBand Calls +// IDeskBand + STDMETHODIMP CQuickLaunchBand::GetWindow(OUT HWND *phwnd) + { + // Internal CISFBand Calls CComPtr<IDeskBand> pIDB; HRESULT hr = m_punkISFB->QueryInterface(IID_IDeskBand, (void**)&pIDB); if (FAILED(hr)) return hr; @@ -127,9 +127,9 @@ return pIDB->GetWindow(phwnd); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::ContextSensitiveHelp(IN BOOL fEnterMode) - { - //Internal CISFBand Calls + STDMETHODIMP CQuickLaunchBand::ContextSensitiveHelp(IN BOOL fEnterMode) + { + // Internal CISFBand Calls CComPtr<IDeskBand> pIDB; HRESULT hr = m_punkISFB->QueryInterface(IID_IDeskBand, (void**)&pIDB); if (FAILED(hr)) return hr; @@ -137,9 +137,9 @@ return pIDB->ContextSensitiveHelp(fEnterMode); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::ShowDW(IN BOOL bShow) - { - //Internal CISFBand Calls + STDMETHODIMP CQuickLaunchBand::ShowDW(IN BOOL bShow) + { + // Internal CISFBand Calls CComPtr<IDeskBand> pIDB; HRESULT hr = m_punkISFB->QueryInterface(IID_IDeskBand, (void**)&pIDB); if (FAILED(hr)) return hr; @@ -147,9 +147,9 @@ return pIDB->ShowDW(bShow); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::CloseDW(IN DWORD dwReserved) - { - //Internal CISFBand Calls + STDMETHODIMP CQuickLaunchBand::CloseDW(IN DWORD dwReserved) + { + // Internal CISFBand Calls CComPtr<IDeskBand> pIDB; HRESULT hr = m_punkISFB->QueryInterface(IID_IDeskBand, (void**)&pIDB); if (FAILED(hr)) return hr; @@ -157,9 +157,9 @@ return pIDB->CloseDW(dwReserved); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::ResizeBorderDW(LPCRECT prcBorder, IUnknown *punkToolbarSite, BOOL fReserved) - { - //Internal CISFBand Calls + STDMETHODIMP CQuickLaunchBand::ResizeBorderDW(LPCRECT prcBorder, IUnknown *punkToolbarSite, BOOL fReserved) + { + // Internal CISFBand Calls CComPtr<IDeskBand> pIDB; HRESULT hr = m_punkISFB->QueryInterface(IID_IDeskBand, (void**)&pIDB); if (FAILED(hr)) return hr; @@ -167,11 +167,11 @@ return pIDB->ResizeBorderDW(prcBorder, punkToolbarSite, fReserved); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetBandInfo(IN DWORD dwBandID, IN DWORD dwViewMode, IN OUT DESKBANDINFO *pdbi) + STDMETHODIMP CQuickLaunchBand::GetBandInfo(IN DWORD dwBandID, IN DWORD dwViewMode, IN OUT DESKBANDINFO *pdbi) { TRACE("CQuickLaunchBand::GetBandInfo(0x%x,0x%x,0x%p)\n", dwBandID, dwViewMode, pdbi); - //Internal CISFBand Calls + // Internal CISFBand Calls CComPtr<IDeskBand> pIDB; HRESULT hr = m_punkISFB->QueryInterface(IID_IDeskBand, (void**)&pIDB); if (FAILED(hr)) return hr; @@ -180,12 +180,12 @@ } /*****************************************************************************/ - //IDeskBar - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::SetClient(IN IUnknown *punkClient) + // IDeskBar + STDMETHODIMP CQuickLaunchBand::SetClient(IN IUnknown *punkClient) { TRACE("IDeskBar::SetClient(0x%p)\n", punkClient); - //Internal CISFBand Calls + // Internal CISFBand Calls CComPtr<IDeskBar> pIDB; HRESULT hr = m_punkISFB->QueryInterface(IID_IDeskBar, (void**)&pIDB); if (FAILED(hr)) return hr; @@ -193,11 +193,11 @@ return pIDB->SetClient(punkClient); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetClient(OUT IUnknown **ppunkClient) + STDMETHODIMP CQuickLaunchBand::GetClient(OUT IUnknown **ppunkClient) { TRACE("IDeskBar::GetClient(0x%p)\n", ppunkClient); - //Internal CISFBand Calls + // Internal CISFBand Calls CComPtr<IDeskBar> pIDB; HRESULT hr = m_punkISFB->QueryInterface(IID_IDeskBar, (void**)&pIDB); if (FAILED(hr)) return hr; @@ -205,11 +205,11 @@ return pIDB->GetClient(ppunkClient); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::OnPosRectChangeDB(IN RECT *prc) + STDMETHODIMP CQuickLaunchBand::OnPosRectChangeDB(IN RECT *prc) { TRACE("IDeskBar::OnPosRectChangeDB(0x%p=(%d,%d,%d,%d))\n", prc, prc->left, prc->top, prc->right, prc->bottom); - //Internal CISFBand Calls + // Internal CISFBand Calls CComPtr<IDeskBar> pIDB; HRESULT hr = m_punkISFB->QueryInterface(IID_IDeskBar, (void**)&pIDB); if (FAILED(hr)) return hr; @@ -218,12 +218,12 @@ } /*****************************************************************************/ -//IPersistStream - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetClassID(OUT CLSID *pClassID) +// IPersistStream + STDMETHODIMP CQuickLaunchBand::GetClassID(OUT CLSID *pClassID) { TRACE("CQuickLaunchBand::GetClassID(0x%p)\n", pClassID); - //Internal CISFBand Calls + // Internal CISFBand Calls CComPtr<IPersistStream> pIPS; HRESULT hr = m_punkISFB->QueryInterface(IID_IPersistStream, (void**)&pIPS); if (FAILED(hr)) return hr; @@ -231,9 +231,9 @@ return pIPS->GetClassID(pClassID); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::IsDirty() - { - //Internal CISFBand Calls + STDMETHODIMP CQuickLaunchBand::IsDirty() + { + // Internal CISFBand Calls CComPtr<IPersistStream> pIPS; HRESULT hr = m_punkISFB->QueryInterface(IID_IPersistStream, (void**)&pIPS); if (FAILED(hr)) return hr; @@ -241,11 +241,11 @@ return pIPS->IsDirty(); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::Load(IN IStream *pStm) + STDMETHODIMP CQuickLaunchBand::Load(IN IStream *pStm) { TRACE("CQuickLaunchBand::Load called\n"); - //Internal CISFBand Calls + // Internal CISFBand Calls CComPtr<IPersistStream> pIPS; HRESULT hr = m_punkISFB->QueryInterface(IID_IPersistStream, (void**)&pIPS); if (FAILED(hr)) return hr; @@ -253,9 +253,9 @@ return pIPS->Load(pStm); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::Save(IN IStream *pStm, IN BOOL fClearDirty) + STDMETHODIMP CQuickLaunchBand::Save(IN IStream *pStm, IN BOOL fClearDirty) { - //Internal CISFBand Calls + // Internal CISFBand Calls CComPtr<IPersistStream> pIPS; HRESULT hr = m_punkISFB->QueryInterface(IID_IPersistStream, (void**)&pIPS); if (FAILED(hr)) return hr; @@ -263,11 +263,11 @@ return pIPS->Save(pStm, fClearDirty); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetSizeMax(OUT ULARGE_INTEGER *pcbSize) + STDMETHODIMP CQuickLaunchBand::GetSizeMax(OUT ULARGE_INTEGER *pcbSize) { TRACE("CQuickLaunchBand::GetSizeMax called\n"); - //Internal CISFBand Calls + // Internal CISFBand Calls CComPtr<IPersistStream> pIPS; HRESULT hr = m_punkISFB->QueryInterface(IID_IPersistStream, (void**)&pIPS); if (FAILED(hr)) return hr; @@ -277,22 +277,22 @@ /*****************************************************************************/ -//IWinEventHandler - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::ProcessMessage(IN HWND hWnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam, OUT LRESULT *plrResult) +// IWinEventHandler + STDMETHODIMP CQuickLaunchBand::ProcessMessage(IN HWND hWnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam, OUT LRESULT *plrResult) { TRACE("CQuickLaunchBand: IWinEventHandler::ProcessMessage(0x%p, 0x%x, 0x%p, 0x%p, 0x%p)\n", hWnd, uMsg, wParam, lParam, plrResult); return E_NOTIMPL; } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::ContainsWindow(IN HWND hWnd) + STDMETHODIMP CQuickLaunchBand::ContainsWindow(IN HWND hWnd) { return E_NOTIMPL; } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult) + STDMETHODIMP CQuickLaunchBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult) { - //Internal CISFBand Calls + // Internal CISFBand Calls CComPtr<IWinEventHandler> pWEH; HRESULT hr = m_punkISFB->QueryInterface(IID_IWinEventHandler, (void**)&pWEH); if (FAILED(hr)) return hr; @@ -300,9 +300,9 @@ return pWEH->OnWinEvent(hWnd, uMsg, wParam, lParam, theResult); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::IsWindowOwner(HWND hWnd) - { - //Internal CISFBand Calls + STDMETHODIMP CQuickLaunchBand::IsWindowOwner(HWND hWnd) + { + // Internal CISFBand Calls CComPtr<IWinEventHandler> pWEH; HRESULT hr = m_punkISFB->QueryInterface(IID_IWinEventHandler, (void**)&pWEH); if (FAILED(hr)) return hr; @@ -312,9 +312,9 @@ /*****************************************************************************/ // *** IOleCommandTarget methods *** - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText) - { - //Internal CISFBand Calls + STDMETHODIMP CQuickLaunchBand::QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText) + { + // Internal CISFBand Calls CComPtr<IOleCommandTarget> pOCT; HRESULT hr = m_punkISFB->QueryInterface(IID_IOleCommandTarget, (void**)&pOCT); if (FAILED(hr)) return hr; @@ -322,9 +322,9 @@ return pOCT->QueryStatus(pguidCmdGroup, cCmds, prgCmds, pCmdText); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) + STDMETHODIMP CQuickLaunchBand::Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) { - //Internal CISFBand Calls + // Internal CISFBand Calls CComPtr<IOleCommandTarget> pOCT; HRESULT hr = m_punkISFB->QueryInterface(IID_IOleCommandTarget, (void**)&pOCT); if (FAILED(hr)) return hr; @@ -334,9 +334,9 @@ /*****************************************************************************/ // *** IContextMenu *** - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetCommandString(UINT_PTR idCmd, UINT uFlags, UINT *pwReserved, LPSTR pszName, UINT cchMax) - { - //Internal CISFBand Calls + STDMETHODIMP CQuickLaunchBand::GetCommandString(UINT_PTR idCmd, UINT uFlags, UINT *pwReserved, LPSTR pszName, UINT cchMax) + { + // Internal CISFBand Calls CComPtr<IContextMenu> pICM; HRESULT hr = m_punkISFB->QueryInterface(IID_IContextMenu, (void**)&pICM); if (FAILED(hr)) return hr; @@ -344,9 +344,9 @@ return pICM->GetCommandString(idCmd, uFlags, pwReserved, pszName, cchMax); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::InvokeCommand(LPCMINVOKECOMMANDINFO pici) - { - //Internal CISFBand Calls + STDMETHODIMP CQuickLaunchBand::InvokeCommand(LPCMINVOKECOMMANDINFO pici) + { + // Internal CISFBand Calls CComPtr<IContextMenu> pICM; HRESULT hr = m_punkISFB->QueryInterface(IID_IContextMenu, (void**)&pICM); if (FAILED(hr)) return hr; @@ -354,9 +354,9 @@ return pICM->InvokeCommand(pici); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) - { - //Internal CISFBand Calls + STDMETHODIMP CQuickLaunchBand::QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) + { + // Internal CISFBand Calls CComPtr<IContextMenu> pICM; HRESULT hr = m_punkISFB->QueryInterface(IID_IContextMenu, (void**)&pICM); if (FAILED(hr)) return hr; Modified: branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CQuickLaunchBand.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/shellext/reactos/dll/…
============================================================================== --- branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CQuickLaunchBand.h [iso-8859-1] (original) +++ branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CQuickLaunchBand.h [iso-8859-1] Sat Jul 1 20:22:13 2017 @@ -9,11 +9,11 @@ extern const GUID CLSID_QuickLaunchBand; -//Component category registration +// Component category registration HRESULT RegisterComCat(); HRESULT UnregisterComCat(); -//COM class for quick launch +// COM class for quick launch class CQuickLaunchBand : public CComCoClass<CQuickLaunchBand, &CLSID_QuickLaunchBand>, public CComObjectRootEx<CComMultiThreadModelNoCS>, @@ -33,89 +33,89 @@ CQuickLaunchBand(); virtual ~CQuickLaunchBand(); -//ATL construct +// ATL construct HRESULT FinalConstruct(); -//IObjectWithSite +// IObjectWithSite - virtual HRESULT STDMETHODCALLTYPE GetSite( - /*[in]*/ REFIID riid, - /*[out]*/ void **ppvSite + virtual STDMETHODIMP GetSite( + IN REFIID riid, + OUT void **ppvSite ); - virtual HRESULT STDMETHODCALLTYPE SetSite( - /*[in]*/ IUnknown *pUnkSite + virtual STDMETHODIMP SetSite( + IN IUnknown *pUnkSite ); -//IDeskBand +// IDeskBand - virtual HRESULT STDMETHODCALLTYPE GetWindow( + virtual STDMETHODIMP GetWindow( OUT HWND *phwnd ); - virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp( + virtual STDMETHODIMP ContextSensitiveHelp( IN BOOL fEnterMode ); - virtual HRESULT STDMETHODCALLTYPE ShowDW( + virtual STDMETHODIMP ShowDW( IN BOOL bShow ); - virtual HRESULT STDMETHODCALLTYPE CloseDW( + virtual STDMETHODIMP CloseDW( IN DWORD dwReserved ); - virtual HRESULT STDMETHODCALLTYPE ResizeBorderDW( + virtual STDMETHODIMP ResizeBorderDW( LPCRECT prcBorder, IUnknown *punkToolbarSite, BOOL fReserved ); - virtual HRESULT STDMETHODCALLTYPE GetBandInfo( + virtual STDMETHODIMP GetBandInfo( IN DWORD dwBandID, IN DWORD dwViewMode, IN OUT DESKBANDINFO *pdbi ); -//IDeskBar +// IDeskBar - virtual HRESULT STDMETHODCALLTYPE GetClient( - /*[out]*/ IUnknown **ppunkClient + virtual STDMETHODIMP GetClient( + OUT IUnknown **ppunkClient ); - virtual HRESULT STDMETHODCALLTYPE OnPosRectChangeDB( - /*[in]*/ LPRECT prc + virtual STDMETHODIMP OnPosRectChangeDB( + IN LPRECT prc ); - virtual HRESULT STDMETHODCALLTYPE SetClient( - /*[in, optional]*/ IUnknown *punkClient + virtual STDMETHODIMP SetClient( + IN OPTIONAL IUnknown *punkClient ); -//IPersistStream +// IPersistStream - virtual HRESULT STDMETHODCALLTYPE GetClassID( - /*[out]*/ OUT CLSID *pClassID + virtual STDMETHODIMP GetClassID( + OUT CLSID *pClassID ); - virtual HRESULT STDMETHODCALLTYPE GetSizeMax( - /*[out]*/ ULARGE_INTEGER *pcbSize + virtual STDMETHODIMP GetSizeMax( + OUT ULARGE_INTEGER *pcbSize ); - virtual HRESULT STDMETHODCALLTYPE IsDirty(); + virtual STDMETHODIMP IsDirty(); - virtual HRESULT STDMETHODCALLTYPE Load( - /*[in]*/ IStream *pStm + virtual STDMETHODIMP Load( + IN IStream *pStm ); - virtual HRESULT STDMETHODCALLTYPE Save( - /*[in]*/ IStream *pStm, - /*[in]*/ BOOL fClearDirty + virtual STDMETHODIMP Save( + IN IStream *pStm, + IN BOOL fClearDirty ); -//IWinEventHandler +// IWinEventHandler - virtual HRESULT STDMETHODCALLTYPE ProcessMessage( + virtual STDMETHODIMP ProcessMessage( IN HWND hWnd, IN UINT uMsg, IN WPARAM wParam, @@ -123,11 +123,11 @@ OUT LRESULT *plrResult ); - virtual HRESULT STDMETHODCALLTYPE ContainsWindow( + virtual STDMETHODIMP ContainsWindow( IN HWND hWnd ); - virtual HRESULT STDMETHODCALLTYPE OnWinEvent( + virtual STDMETHODIMP OnWinEvent( HWND hWnd, UINT uMsg, WPARAM wParam, @@ -135,29 +135,29 @@ LRESULT *theResult ); - virtual HRESULT STDMETHODCALLTYPE IsWindowOwner( + virtual STDMETHODIMP IsWindowOwner( HWND hWnd ); -//IOleCommandTarget +// IOleCommandTarget - virtual HRESULT STDMETHODCALLTYPE Exec( - /*[in]*/ const GUID *pguidCmdGroup, - /*[in]*/ DWORD nCmdID, - /*[in]*/ DWORD nCmdexecopt, - /*[in]*/ VARIANT *pvaIn, - /*[in, out]*/ VARIANT *pvaOut + virtual STDMETHODIMP Exec( + IN const GUID *pguidCmdGroup, + IN DWORD nCmdID, + IN DWORD nCmdexecopt, + IN VARIANT *pvaIn, + IN OUT VARIANT *pvaOut ); - virtual HRESULT STDMETHODCALLTYPE QueryStatus( - /*[in]*/ const GUID *pguidCmdGroup, - /*[in]*/ ULONG cCmds, - /*[in, out]*/ OLECMD prgCmds[], - /*[in, out]*/ OLECMDTEXT *pCmdText + virtual STDMETHODIMP QueryStatus( + IN const GUID *pguidCmdGroup, + IN ULONG cCmds, + IN OUT OLECMD prgCmds[], + IN OUT OLECMDTEXT *pCmdText ); -//IContextMenu - virtual HRESULT STDMETHODCALLTYPE GetCommandString( +// IContextMenu + virtual STDMETHODIMP GetCommandString( UINT_PTR idCmd, UINT uFlags, UINT *pwReserved, @@ -165,11 +165,11 @@ UINT cchMax ); - virtual HRESULT STDMETHODCALLTYPE InvokeCommand( + virtual STDMETHODIMP InvokeCommand( LPCMINVOKECOMMANDINFO pici ); - virtual HRESULT STDMETHODCALLTYPE QueryContextMenu( + virtual STDMETHODIMP QueryContextMenu( HMENU hmenu, UINT indexMenu, UINT idCmdFirst, Modified: branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/qcklnch.cpp URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/shellext/reactos/dll/…
============================================================================== --- branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/qcklnch.cpp [iso-8859-1] (original) +++ branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/qcklnch.cpp [iso-8859-1] Sat Jul 1 20:22:13 2017 @@ -18,11 +18,6 @@ HINSTANCE g_hInstance; CComModule g_Module; - -void *operator new (size_t, void *buf) -{ - return buf; -} STDAPI_(BOOL) DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) @@ -46,22 +41,20 @@ DllRegisterServer(void) { HRESULT hr = g_Module.DllRegisterServer(FALSE); - if (FAILED(hr)) return hr; - else - return RegisterComCat(); + + return RegisterComCat(); } STDAPI DllUnregisterServer(void) { HRESULT hr = UnregisterComCat(); - if (FAILED(hr)) return hr; - else - return g_Module.DllUnregisterServer(FALSE); + + return g_Module.DllUnregisterServer(FALSE); } STDAPI Modified: branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/qcklnch.rc URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/shellext/reactos/dll/…
============================================================================== --- branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/qcklnch.rc [iso-8859-1] (original) +++ branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/qcklnch.rc [iso-8859-1] Sat Jul 1 20:22:13 2017 @@ -7,7 +7,7 @@ IDR_QCKLNCH REGISTRY "rgs/qcklnch.rgs" -IDR_POPUPMENU MENUEX DISCARDABLE +IDM_POPUPMENU MENUEX DISCARDABLE BEGIN POPUP "" BEGIN Modified: branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/resource.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/shellext/reactos/dll/…
============================================================================== --- branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/resource.h [iso-8859-1] (original) +++ branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/resource.h [iso-8859-1] Sat Jul 1 20:22:13 2017 @@ -1,8 +1,8 @@ #pragma once -#define IDR_QCKLNCH 1001 -#define IDR_POPUPMENU 2000 +#define IDR_QCKLNCH 1001 +#define IDM_POPUPMENU 2000 #define IDM_LARGE_ICONS 1 #define IDM_SMALL_ICONS 2 -#define IDM_SHOW_TEXT 3 -#define IDM_VIEW_MENU 4 +#define IDM_SHOW_TEXT 3 +#define IDM_VIEW_MENU 4 Modified: branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/rgs/qcklnch.rgs URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/shellext/reactos/dll/…
============================================================================== --- branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/rgs/qcklnch.rgs [iso-8859-1] (original) +++ branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/rgs/qcklnch.rgs [iso-8859-1] Sat Jul 1 20:22:13 2017 @@ -1,13 +1,13 @@ HKCR { - NoRemove CLSID + NoRemove CLSID { - ForceRemove {260CB95D-4544-44F6-A079-575BAA60B72F} = s 'Quick Launch' - { - InprocServer32 = s '%MODULE%' - { - val ThreadingModel = s 'Apartment' - } - } - } + ForceRemove {260CB95D-4544-44F6-A079-575BAA60B72F} = s 'Quick Launch' + { + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Apartment' + } + } + } }
7 years, 5 months
1
0
0
0
[sgasiorek] 75259: [WIN32K][DXG] DxDdReenableDirectDrawObject: update dhpdev. It is wrong after screen resolution change
by sgasiorek@svn.reactos.org
Author: sgasiorek Date: Sat Jul 1 20:12:37 2017 New Revision: 75259 URL:
http://svn.reactos.org/svn/reactos?rev=75259&view=rev
Log: [WIN32K][DXG] DxDdReenableDirectDrawObject: update dhpdev. It is wrong after screen resolution change Modified: trunk/reactos/win32ss/reactx/dxg/ddraw.c Modified: trunk/reactos/win32ss/reactx/dxg/ddraw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/reactx/dxg/ddraw.c…
============================================================================== --- trunk/reactos/win32ss/reactx/dxg/ddraw.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/reactx/dxg/ddraw.c [iso-8859-1] Sat Jul 1 20:12:37 2017 @@ -569,6 +569,7 @@ // reset acceleration and suspend flags peDdGl->fl &= 0xFFFFFFFD; peDdGl->bSuspended = 0; + peDdGl->dhpdev = (PVOID)gpEngFuncs.DxEngGetHdevData(peDdGl->hDev, DxEGShDevData_dhpdev); RetVal = TRUE; // FIXME AGP Stuff
7 years, 5 months
1
0
0
0
[mjansen] 75258: [APPHELP/SHIMENG] Begin implementing the core of the SHIM engine. With this, the basics of the app compat engine are implemented and should be functional. Currently it is disable w...
by mjansen@svn.reactos.org
Author: mjansen Date: Sat Jul 1 20:06:30 2017 New Revision: 75258 URL:
http://svn.reactos.org/svn/reactos?rev=75258&view=rev
Log: [APPHELP/SHIMENG] Begin implementing the core of the SHIM engine. With this, the basics of the app compat engine are implemented and should be functional. Currently it is disable with a policy, to be enabled soon. CORE-13284 CORE-11300 Added: trunk/reactos/dll/appcompat/apphelp/shimeng.h (with props) Modified: trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt trunk/reactos/dll/appcompat/apphelp/apphelp.h trunk/reactos/dll/appcompat/apphelp/shimeng.c Modified: trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/CMak…
============================================================================== --- trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt [iso-8859-1] Sat Jul 1 20:06:30 2017 @@ -2,7 +2,7 @@ include_directories(${SHIMLIB_DIR}) remove_definitions(-D_WIN32_WINNT=0x502 -DWINVER=0x502) -add_definitions(-D_WIN32_WINNT=0x600 -DWINVER=0x600) +add_definitions(-D_WIN32_WINNT=0x601 -DWINVER=0x601) spec2def(apphelp.dll apphelp.spec ADD_IMPORTLIB) Modified: trunk/reactos/dll/appcompat/apphelp/apphelp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/apph…
============================================================================== --- trunk/reactos/dll/appcompat/apphelp/apphelp.h [iso-8859-1] (original) +++ trunk/reactos/dll/appcompat/apphelp/apphelp.h [iso-8859-1] Sat Jul 1 20:06:30 2017 @@ -83,7 +83,9 @@ GUID rgGuidDB[SDB_MAX_SDBS]; } SDBQUERYRESULT, *PSDBQUERYRESULT; +#ifndef APPHELP_NOSDBPAPI #include "sdbpapi.h" +#endif /* sdbapi.c */ PWSTR SdbpStrDup(LPCWSTR string); @@ -122,7 +124,8 @@ /* hsdb.c */ BOOL WINAPI SdbGetMatchingExe(HSDB hsdb, LPCWSTR path, LPCWSTR module_name, LPCWSTR env, DWORD flags, PSDBQUERYRESULT result); BOOL WINAPI SdbTagIDToTagRef(HSDB hsdb, PDB pdb, TAGID tiWhich, TAGREF* ptrWhich); - +BOOL WINAPI SdbTagRefToTagID(HSDB hsdb, TAGREF trWhich, PDB* ppdb, TAGID* ptiWhich); +BOOL WINAPI SdbUnpackAppCompatData(HSDB hsdb, LPCWSTR pszImageName, PVOID pData, PSDBQUERYRESULT pQueryResult); #define ATTRIBUTE_AVAILABLE 0x1 #define ATTRIBUTE_FAILED 0x2 Modified: trunk/reactos/dll/appcompat/apphelp/shimeng.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/shim…
============================================================================== --- trunk/reactos/dll/appcompat/apphelp/shimeng.c [iso-8859-1] (original) +++ trunk/reactos/dll/appcompat/apphelp/shimeng.c [iso-8859-1] Sat Jul 1 20:06:30 2017 @@ -21,12 +21,69 @@ #include "ntndk.h" #include "shimlib.h" #include <strsafe.h> - -HANDLE g_pShimEngModHandle = 0; - - +/* Make sure we don't include apphelp logging */ +#define APPHELP_NOSDBPAPI +#include "apphelp.h" +#include "shimeng.h" + + +typedef FARPROC(WINAPI* GETPROCADDRESSPROC)(HINSTANCE, LPCSTR); + + +FARPROC WINAPI StubGetProcAddress(HINSTANCE hModule, LPCSTR lpProcName); +BOOL WINAPI SE_IsShimDll(PVOID BaseAddress); + + +extern HMODULE g_hInstance; ULONG g_ShimEngDebugLevel = 0xffffffff; - +BOOL g_bComPlusImage = FALSE; +BOOL g_bShimDuringInit = FALSE; +BOOL g_bInternalHooksUsed = FALSE; +static ARRAY g_pShimInfo; /* SHIMMODULE */ +static ARRAY g_pHookArray; /* HOOKMODULEINFO */ + +HOOKAPIEX g_IntHookEx[] = +{ + { + "kernel32.dll", /* LibraryName */ + "GetProcAddress", /* FunctionName */ + StubGetProcAddress, /* ReplacementFunction*/ + NULL, /* OriginalFunction */ + { NULL }, /* ModuleLink */ + { NULL } /* ApiLink */ + }, +}; + + + + +static BOOL ARRAY_EnsureSize(PARRAY Array, DWORD ItemSize, DWORD GrowWith) +{ + PVOID pNewData; + DWORD Count; + + if (Array->MaxSize > Array->Size) + return TRUE; + + Count = Array->Size + GrowWith; + pNewData = SeiAlloc(Count * ItemSize); + + if (!pNewData) + { + SHIMENG_FAIL("Failed to allocate %d bytes\n", Count * ItemSize); + return FALSE; + } + Array->MaxSize = Count; + + if (Array->Data) + { + memcpy(pNewData, Array->Data, Array->Size * ItemSize); + SeiFree(Array->Data); + } + Array->Data = pNewData; + + return TRUE; +} @@ -115,49 +172,782 @@ } - - - - +PVOID SeiGetModuleFromAddress(PVOID addr) +{ + PVOID hModule = NULL; + RtlPcToFileHeader(addr, &hModule); + return hModule; +} + + + +/* TODO: Guard against recursive calling / calling init multiple times! */ VOID NotifyShims(DWORD dwReason, PVOID Info) { - /* Enumerate all loaded shims */ -} + PSHIMMODULE Data; + DWORD n; + + Data = g_pShimInfo.Data; + for (n = 0; n < g_pShimInfo.Size; ++n) + { + if (!Data[n].pNotifyShims) + continue; + + Data[n].pNotifyShims(dwReason, Info); + } +} + + + +VOID SeiCheckComPlusImage(PVOID BaseAddress) +{ + ULONG ComSectionSize; + g_bComPlusImage = RtlImageDirectoryEntryToData(BaseAddress, TRUE, IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR, &ComSectionSize) != NULL; + + SHIMENG_INFO("COM+ executable %s\n", g_bComPlusImage ? "TRUE" : "FALSE"); +} + + +PSHIMMODULE SeiGetShimInfo(PVOID BaseAddress) +{ + PSHIMMODULE Data; + DWORD n; + + Data = g_pShimInfo.Data; + for (n = 0; n < g_pShimInfo.Size; ++n) + { + if (Data[n].BaseAddress == BaseAddress) + return &Data[n]; + } + return NULL; +} + +PSHIMMODULE SeiCreateShimInfo(PCWSTR DllName, PVOID BaseAddress) +{ + static const ANSI_STRING GetHookAPIs = RTL_CONSTANT_STRING("GetHookAPIs"); + static const ANSI_STRING NotifyShims = RTL_CONSTANT_STRING("NotifyShims"); + PSHIMMODULE Data; + PVOID pGetHookAPIs, pNotifyShims; + + if (!NT_SUCCESS(LdrGetProcedureAddress(BaseAddress, (PANSI_STRING)&GetHookAPIs, 0, &pGetHookAPIs)) || + !NT_SUCCESS(LdrGetProcedureAddress(BaseAddress, (PANSI_STRING)&NotifyShims, 0, &pNotifyShims))) + { + SHIMENG_WARN("Failed to resolve entry points for %S\n", DllName); + return NULL; + } + + if (!ARRAY_EnsureSize(&g_pShimInfo, sizeof(SHIMMODULE), 5)) + return NULL; + + Data = g_pShimInfo.Data; + Data += g_pShimInfo.Size; + g_pShimInfo.Size++; + + RtlCreateUnicodeString(&Data->Name, DllName); + Data->BaseAddress = BaseAddress; + + Data->pGetHookAPIs = pGetHookAPIs; + Data->pNotifyShims = pNotifyShims; + + Data->HookApis.Data = NULL; + Data->HookApis.Size = 0; + Data->HookApis.MaxSize = 0; + + return Data; +} + +VOID SeiAppendHookInfo(PSHIMMODULE pShimInfo, PHOOKAPIEX pHookApi, DWORD dwHookCount) +{ + PHOOKAPIPOINTERS Data; + if (!ARRAY_EnsureSize(&pShimInfo->HookApis, sizeof(HOOKAPIPOINTERS), 5)) + return; + + Data = pShimInfo->HookApis.Data; + Data += pShimInfo->HookApis.Size; + + Data->pHookApi = pHookApi; + Data->dwHookCount = dwHookCount; + pShimInfo->HookApis.Size++; +} + +PHOOKMODULEINFO SeiFindHookModuleInfo(PUNICODE_STRING ModuleName, PVOID BaseAddress) +{ + DWORD n; + PHOOKMODULEINFO Data = g_pHookArray.Data; + + for (n = 0; n < g_pHookArray.Size; ++n) + { + if (BaseAddress && BaseAddress == Data[n].BaseAddress) + return &Data[n]; + + if (!BaseAddress && RtlEqualUnicodeString(ModuleName, &Data[n].Name, TRUE)) + return &Data[n]; + } + + return NULL; +} + +PHOOKMODULEINFO SeiFindHookModuleInfoForImportDescriptor(PBYTE DllBase, PIMAGE_IMPORT_DESCRIPTOR ImportDescriptor) +{ + UNICODE_STRING DllName; + PVOID DllHandle; + NTSTATUS Success; + + if (!RtlCreateUnicodeStringFromAsciiz(&DllName, (PCSZ)(DllBase + ImportDescriptor->Name))) + { + SHIMENG_FAIL("Unable to convert dll name to unicode\n"); + return NULL; + } + + Success = LdrGetDllHandle(NULL, NULL, &DllName, &DllHandle); + RtlFreeUnicodeString(&DllName); + + if (!NT_SUCCESS(Success)) + { + SHIMENG_FAIL("Unable to get module handle for %wZ\n", &DllName); + return NULL; + } + + return SeiFindHookModuleInfo(NULL, DllHandle); +} + +static LPCWSTR SeiGetStringPtr(PDB pdb, TAGID tag, TAG type) +{ + TAGID tagEntry = SdbFindFirstTag(pdb, tag, type); + if (tagEntry == TAGID_NULL) + return NULL; + + return SdbGetStringTagPtr(pdb, tagEntry); +} + +static DWORD SeiGetDWORD(PDB pdb, TAGID tag, TAG type) +{ + TAGID tagEntry = SdbFindFirstTag(pdb, tag, type); + if (tagEntry == TAGID_NULL) + return 0; + + return SdbReadDWORDTag(pdb, tagEntry, TAGID_NULL); +} + + + +VOID SeiAddShim(TAGREF trShimRef, PARRAY pShimRef) +{ + TAGREF* Data; + if (!ARRAY_EnsureSize(pShimRef, sizeof(TAGREF), 10)) + return; + + Data = pShimRef->Data; + Data[pShimRef->Size] = trShimRef; + pShimRef->Size++; +} + +VOID SeiBuildShimRefArray(HSDB hsdb, SDBQUERYRESULT* pQuery, PARRAY pShimRef) +{ + DWORD n; + + for (n = 0; n < pQuery->dwExeCount; ++n) + { + PDB pdb; + TAGID tag; + if (SdbTagRefToTagID(hsdb, pQuery->atrExes[n], &pdb, &tag)) + { + LPCWSTR ExeName = SeiGetStringPtr(pdb, tag, TAG_NAME); + TAGID ShimRef = SdbFindFirstTag(pdb, tag, TAG_SHIM_REF); + + if (ExeName) + SeiDbgPrint(SEI_MSG, NULL, "ShimInfo(Exe(%S))\n", ExeName); + + while (ShimRef != TAGID_NULL) + { + TAGREF trShimRef; + if (SdbTagIDToTagRef(hsdb, pdb, ShimRef, &trShimRef)) + SeiAddShim(trShimRef, pShimRef); + + + ShimRef = SdbFindNextTag(pdb, tag, ShimRef); + } + + /* Handle FLAG_REF */ + } + } + + + for (n = 0; n < pQuery->dwLayerCount; ++n) + { + PDB pdb; + TAGID tag; + if (SdbTagRefToTagID(hsdb, pQuery->atrLayers[n], &pdb, &tag)) + { + LPCWSTR LayerName = SeiGetStringPtr(pdb, tag, TAG_NAME); + TAGID ShimRef = SdbFindFirstTag(pdb, tag, TAG_SHIM_REF); + if (LayerName) + SeiDbgPrint(SEI_MSG, NULL, "ShimInfo(Layer(%S))\n", LayerName); + + while (ShimRef != TAGID_NULL) + { + TAGREF trShimRef; + if (SdbTagIDToTagRef(hsdb, pdb, ShimRef, &trShimRef)) + SeiAddShim(trShimRef, pShimRef); + + ShimRef = SdbFindNextTag(pdb, tag, ShimRef); + } + + /* Handle FLAG_REF */ + } + } +} + + +VOID SeiAddHooks(PHOOKAPIEX hooks, DWORD dwHookCount) +{ + DWORD n; + UNICODE_STRING UnicodeModName; + WCHAR Buf[512]; + + RtlInitEmptyUnicodeString(&UnicodeModName, Buf, sizeof(Buf)); + + for (n = 0; n < dwHookCount; ++n) + { + ANSI_STRING AnsiString; + PVOID DllHandle; + PHOOKAPIEX hook = hooks + n; + PHOOKMODULEINFO HookModuleInfo; + PSINGLE_LIST_ENTRY Entry; + + RtlInitAnsiString(&AnsiString, hook->LibraryName); + if (!NT_SUCCESS(RtlAnsiStringToUnicodeString(&UnicodeModName, &AnsiString, FALSE))) + { + SHIMENG_FAIL("Unable to convert %s to Unicode\n", hook->LibraryName); + continue; + } + + RtlInitAnsiString(&AnsiString, hook->FunctionName); + if (NT_SUCCESS(LdrGetDllHandle(NULL, 0, &UnicodeModName, &DllHandle))) + { + PVOID ProcAddress; + + + if (!NT_SUCCESS(LdrGetProcedureAddress(DllHandle, &AnsiString, 0, &ProcAddress))) + { + SHIMENG_FAIL("Unable to retrieve %s!%s\n", hook->LibraryName, hook->FunctionName); + continue; + } + + HookModuleInfo = SeiFindHookModuleInfo(NULL, DllHandle); + hook->OriginalFunction = ProcAddress; + } + else + { + HookModuleInfo = SeiFindHookModuleInfo(&UnicodeModName, NULL); + DllHandle = NULL; + } + + if (!HookModuleInfo) + { + if (!ARRAY_EnsureSize(&g_pHookArray, sizeof(HOOKMODULEINFO), 5)) + continue; + + HookModuleInfo = g_pHookArray.Data; + HookModuleInfo += g_pHookArray.Size; + g_pHookArray.Size++; + + HookModuleInfo->BaseAddress = DllHandle; + RtlCreateUnicodeString(&HookModuleInfo->Name, UnicodeModName.Buffer); + } + + Entry = &HookModuleInfo->ModuleLink; + + while (Entry && Entry->Next) + { + PHOOKAPIEX HookApi = CONTAINING_RECORD(Entry->Next, HOOKAPIEX, ModuleLink); + + int CmpResult = strcmp(hook->FunctionName, HookApi->FunctionName); + if (CmpResult == 0) + { + /* Multiple hooks on one function? --> use ApiLink */ + SHIMENG_FAIL("Multiple hooks on one API is not yet supported!\n"); + ASSERT(0); + } + else if (CmpResult < 0) + { + /* Break out of the loop to have the entry inserted 'in place' */ + break; + } + + Entry = Entry->Next; + } + /* If Entry is not NULL, the item is not inserted yet, so link it at the end. */ + if (Entry) + { + hook->ModuleLink.Next = Entry->Next; + Entry->Next = &hook->ModuleLink; + } + } +} + + +FARPROC WINAPI StubGetProcAddress(HINSTANCE hModule, LPCSTR lpProcName) +{ + char szOrdProcName[10] = ""; + LPCSTR lpPrintName = lpProcName; + PVOID Addr = _ReturnAddress(); + PHOOKMODULEINFO HookModuleInfo; + FARPROC proc = ((GETPROCADDRESSPROC)g_IntHookEx[0].OriginalFunction)(hModule, lpProcName); + + if (!HIWORD(lpProcName)) + { + sprintf(szOrdProcName, "#%lu", (DWORD)lpProcName); + lpPrintName = szOrdProcName; + } + + Addr = SeiGetModuleFromAddress(Addr); + if (SE_IsShimDll(Addr)) + { + SHIMENG_MSG("Not touching GetProcAddress for shim dll (%p!%s)", hModule, lpPrintName); + return proc; + } + + SHIMENG_MSG("(GetProcAddress(%p!%s) => %p\n", hModule, lpProcName, lpPrintName); + + HookModuleInfo = SeiFindHookModuleInfo(NULL, hModule); + + /* FIXME: Ordinal not yet supported */ + if (HookModuleInfo && HIWORD(lpProcName)) + { + PSINGLE_LIST_ENTRY Entry; + + Entry = HookModuleInfo->ModuleLink.Next; + + while (Entry) + { + PHOOKAPIEX HookApi = CONTAINING_RECORD(Entry, HOOKAPIEX, ModuleLink); + + int CmpResult = strcmp(lpProcName, HookApi->FunctionName); + if (CmpResult == 0) + { + SHIMENG_MSG("Redirecting %p to %p\n", proc, HookApi->ReplacementFunction); + proc = HookApi->ReplacementFunction; + break; + } + else if (CmpResult < 0) + { + SHIMENG_MSG("Not found %s\n", lpProcName); + /* We are not going to find it anymore.. */ + break; + } + + Entry = Entry->Next; + } + } + + return proc; +} + +VOID SeiResolveAPIs(VOID) +{ + PSHIMMODULE Data; + DWORD mod, n; + + Data = g_pShimInfo.Data; + + /* Enumerate all Shim modules */ + for (mod = 0; mod < g_pShimInfo.Size; ++mod) + { + PHOOKAPIPOINTERS pShims = Data[mod].HookApis.Data; + DWORD dwShimCount = Data[mod].HookApis.Size; + + /* Enumerate all Shims */ + for (n = 0; n < dwShimCount; ++n) + { + PHOOKAPIEX hooks = pShims[n].pHookApi; + DWORD dwHookCount = pShims[n].dwHookCount; + + SeiAddHooks(hooks, dwHookCount); + } + } +} + +VOID SeiAddInternalHooks(DWORD dwNumHooks) +{ + if (dwNumHooks == 0) + { + g_bInternalHooksUsed = FALSE; + return; + } + + SeiAddHooks(g_IntHookEx, _countof(g_IntHookEx)); + g_bInternalHooksUsed = TRUE; +} + +VOID SeiPatchNewImport(PIMAGE_THUNK_DATA FirstThunk, PHOOKAPIEX HookApi, PLDR_DATA_TABLE_ENTRY LdrEntry) +{ + ULONG OldProtection = 0; + PVOID Ptr; + ULONG Size; + NTSTATUS Status; + + SHIMENG_INFO("Hooking API \"%s!%s\" for DLL \"%wZ\"\n", HookApi->LibraryName, HookApi->FunctionName, &LdrEntry->BaseDllName); + + Ptr = &FirstThunk->u1.Function; + Size = sizeof(FirstThunk->u1.Function); + Status = NtProtectVirtualMemory(NtCurrentProcess(), &Ptr, &Size, PAGE_EXECUTE_READWRITE, &OldProtection); + + if (!NT_SUCCESS(Status)) + { + SHIMENG_FAIL("Unable to unprotect 0x%p\n", &FirstThunk->u1.Function); + return; + } + + SHIMENG_INFO("changing 0x%p to 0x%p\n", FirstThunk->u1.Function, HookApi->ReplacementFunction); +#ifdef _WIN64 + FirstThunk->u1.Function = (ULONGLONG)HookApi->ReplacementFunction; +#else + FirstThunk->u1.Function = (DWORD)HookApi->ReplacementFunction; +#endif + + Size = sizeof(FirstThunk->u1.Function); + Status = NtProtectVirtualMemory(NtCurrentProcess(), &Ptr, &Size, OldProtection, &OldProtection); + + if (!NT_SUCCESS(Status)) + { + SHIMENG_WARN("Unable to reprotect 0x%p\n", &FirstThunk->u1.Function); + } +} + +/* Level(INFO) [SeiPrintExcludeInfo] Module "kernel32.dll" excluded for shim VistaRTMVersionLie, API "NTDLL.DLL!RtlGetVersion", because it is in System32/WinSXS. */ + +VOID SeiHookImports(PLDR_DATA_TABLE_ENTRY LdrEntry) +{ + ULONG Size; + PIMAGE_IMPORT_DESCRIPTOR ImportDescriptor; + PBYTE DllBase = LdrEntry->DllBase; + + if (SE_IsShimDll(DllBase) || g_hInstance == LdrEntry->DllBase) + { + SHIMENG_INFO("Skipping shim module 0x%p \"%wZ\"\n", LdrEntry->DllBase, &LdrEntry->BaseDllName); + return; + } + + ImportDescriptor = RtlImageDirectoryEntryToData(DllBase, TRUE, IMAGE_DIRECTORY_ENTRY_IMPORT, &Size); + if (!ImportDescriptor) + { + SHIMENG_INFO("Skipping module 0x%p \"%wZ\" due to no iat found\n", LdrEntry->DllBase, &LdrEntry->BaseDllName); + return; + } + + SHIMENG_INFO("Hooking module 0x%p \"%wZ\"\n", LdrEntry->DllBase, &LdrEntry->BaseDllName); + + for ( ;ImportDescriptor->Name && ImportDescriptor->OriginalFirstThunk; ImportDescriptor++) + { + PHOOKMODULEINFO HookModuleInfo; + + /* Do we have hooks for this module? */ + HookModuleInfo = SeiFindHookModuleInfoForImportDescriptor(DllBase, ImportDescriptor); + + if (HookModuleInfo) + { + PIMAGE_THUNK_DATA OriginalThunk, FirstThunk; + PSINGLE_LIST_ENTRY Entry; + + Entry = HookModuleInfo->ModuleLink.Next; + + while (Entry) + { + DWORD dwFound = 0; + OriginalThunk = (PIMAGE_THUNK_DATA)(DllBase + ImportDescriptor->OriginalFirstThunk); + FirstThunk = (PIMAGE_THUNK_DATA)(DllBase + ImportDescriptor->FirstThunk); + + for (;OriginalThunk->u1.AddressOfData && FirstThunk->u1.Function && Entry; OriginalThunk++, FirstThunk++) + { + PHOOKAPIEX HookApi = CONTAINING_RECORD(Entry, HOOKAPIEX, ModuleLink); + + if (!IMAGE_SNAP_BY_ORDINAL32(OriginalThunk->u1.AddressOfData)) + { + PIMAGE_IMPORT_BY_NAME ImportName; + + ImportName = (PIMAGE_IMPORT_BY_NAME)(DllBase + OriginalThunk->u1.AddressOfData); + if (!strcmp((PCSTR)ImportName->Name, HookApi->FunctionName)) + { + SeiPatchNewImport(FirstThunk, HookApi, LdrEntry); + + /* Sadly, iat does not have to be sorted, and can even contain duplicate entries. */ + dwFound++; + } + } + else + { + SHIMENG_FAIL("Ordinals not yet supported\n"); + ASSERT(0); + } + } + + if (Entry) + { + if (dwFound != 1) + { + /* One entry not found. */ + PHOOKAPIEX HookApi = CONTAINING_RECORD(Entry, HOOKAPIEX, ModuleLink); + if (!dwFound) + SHIMENG_INFO("Entry \"%s!%s\" not found for \"%wZ\"\n", HookApi->LibraryName, HookApi->FunctionName, &LdrEntry->BaseDllName); + else + SHIMENG_INFO("Entry \"%s!%s\" found %d times for \"%wZ\"\n", HookApi->LibraryName, HookApi->FunctionName, dwFound, &LdrEntry->BaseDllName); + } + + Entry = Entry->Next; + } + } + } + } +} + + +VOID PatchNewModules(PPEB Peb) +{ + PLIST_ENTRY ListHead, ListEntry; + PLDR_DATA_TABLE_ENTRY LdrEntry; + + ListHead = &NtCurrentPeb()->Ldr->InLoadOrderModuleList; + ListEntry = ListHead->Flink; + + while (ListHead != ListEntry) + { + LdrEntry = CONTAINING_RECORD(ListEntry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); + SeiHookImports(LdrEntry); + + ListEntry = ListEntry->Flink; + } +} + + +/* +Level(INFO) Using USER apphack flags 0x2080000 +*/ + +VOID SeiInit(PUNICODE_STRING ProcessImage, HSDB hsdb, SDBQUERYRESULT* pQuery) +{ + DWORD n; + ARRAY ShimRef; + TAGREF* Data; + DWORD dwTotalHooks = 0; + + PPEB Peb = NtCurrentPeb(); + + ShimRef.Data = NULL; + ShimRef.Size = ShimRef.MaxSize = 0; + + SeiCheckComPlusImage(Peb->ImageBaseAddress); + + /* TODO: + if (pQuery->trApphelp) + SeiDisplayAppHelp(?pQuery->trApphelp?); + */ + + SeiDbgPrint(SEI_MSG, NULL, "ShimInfo(ExePath(%wZ))\n", ProcessImage); + SeiBuildShimRefArray(hsdb, pQuery, &ShimRef); + SeiDbgPrint(SEI_MSG, NULL, "ShimInfo(Complete)\n"); + + SHIMENG_INFO("Got %d shims\n", ShimRef.Size); + /* TODO: + SeiBuildGlobalInclExclList() + */ + + Data = ShimRef.Data; + + for (n = 0; n < ShimRef.Size; ++n) + { + PDB pdb; + TAGID ShimRef; + if (SdbTagRefToTagID(hsdb, Data[n], &pdb, &ShimRef)) + { + LPCWSTR ShimName, DllName; + TAGID ShimTag; + WCHAR FullNameBuffer[MAX_PATH]; + UNICODE_STRING UnicodeDllName; + PVOID BaseAddress; + PSHIMMODULE pShimInfo = NULL; + const char* szCommandLine = ""; + PHOOKAPIEX pHookApi; + DWORD dwHookCount; + + ShimName = SeiGetStringPtr(pdb, ShimRef, TAG_NAME); + if (!ShimName) + { + SHIMENG_FAIL("Failed to retrieve the name for 0x%x\n", Data[n]); + continue; + } + + ShimTag = SeiGetDWORD(pdb, ShimRef, TAG_SHIM_TAGID); + if (!ShimTag) + { + SHIMENG_FAIL("Failed to resolve %S to a shim\n", ShimName); + continue; + } + + if (!SdbGetAppPatchDir(NULL, FullNameBuffer, _countof(FullNameBuffer))) + { + SHIMENG_WARN("Failed to get the AppPatch dir\n"); + continue; + } + + DllName = SeiGetStringPtr(pdb, ShimTag, TAG_DLLFILE); + if (DllName == NULL || + !SUCCEEDED(StringCchCatW(FullNameBuffer, _countof(FullNameBuffer), L"\\")) || + !SUCCEEDED(StringCchCatW(FullNameBuffer, _countof(FullNameBuffer), DllName))) + { + SHIMENG_WARN("Failed to build a full path for %S\n", ShimName); + continue; + } + + /* TODO: + SeiGetShimCommandLine(); + [SeiInit] COMMAND_LINE VirtualRegistry(WINNT;VistaRTMLie) from AcLayers.DLL + */ + + RtlInitUnicodeString(&UnicodeDllName, FullNameBuffer); + if (NT_SUCCESS(LdrGetDllHandle(NULL, NULL, &UnicodeDllName, &BaseAddress))) + { + pShimInfo = SeiGetShimInfo(BaseAddress); + } + else if (!NT_SUCCESS(LdrLoadDll(NULL, NULL, &UnicodeDllName, &BaseAddress))) + { + SHIMENG_WARN("Failed to load %wZ for %S\n", &UnicodeDllName, ShimName); + continue; + } + if (!pShimInfo) + { + pShimInfo = SeiCreateShimInfo(DllName, BaseAddress); + if (!pShimInfo) + { + SHIMENG_FAIL("Failed to allocate ShimInfo for %S\n", DllName); + continue; + } + } + + SHIMENG_INFO("Shim DLL 0x%p \"%wZ\" loaded\n", BaseAddress, &UnicodeDllName); + SHIMENG_INFO("Using SHIM \"%S!%S\"\n", DllName, ShimName); + + + pHookApi = pShimInfo->pGetHookAPIs(szCommandLine, ShimName, &dwHookCount); + SHIMENG_INFO("GetHookAPIs returns %d hooks for DLL \"%wZ\" SHIM \"%S\"\n", dwHookCount, &UnicodeDllName, ShimName); + if (dwHookCount) + SeiAppendHookInfo(pShimInfo, pHookApi, dwHookCount); + + dwTotalHooks += dwHookCount; + /*SeiBuildInclExclList*/ + } + } + + SeiAddInternalHooks(dwTotalHooks); + SeiResolveAPIs(); + PatchNewModules(Peb); +} + + + +BOOL SeiGetShimData(PUNICODE_STRING ProcessImage, PVOID pShimData, HSDB* pHsdb, SDBQUERYRESULT* pQuery) +{ + static const UNICODE_STRING ForbiddenShimmingApps[] = { + RTL_CONSTANT_STRING(L"ntsd.exe"), + RTL_CONSTANT_STRING(L"windbg.exe"), +#if WINVER >= 0x600 + RTL_CONSTANT_STRING(L"slsvc.exe"), +#endif + }; + static const UNICODE_STRING BackSlash = RTL_CONSTANT_STRING(L"\\"); + static const UNICODE_STRING ForwdSlash = RTL_CONSTANT_STRING(L"/"); + UNICODE_STRING ProcessName; + USHORT Back, Forward; + HSDB hsdb; + DWORD n; + + if (!NT_SUCCESS(RtlFindCharInUnicodeString(RTL_FIND_CHAR_IN_UNICODE_STRING_START_AT_END, ProcessImage, &BackSlash, &Back))) + Back = 0; + + if (!NT_SUCCESS(RtlFindCharInUnicodeString(RTL_FIND_CHAR_IN_UNICODE_STRING_START_AT_END, ProcessImage, &ForwdSlash, &Forward))) + Forward = 0; + + if (Back < Forward) + Back = Forward; + + if (Back) + Back += sizeof(WCHAR); + + ProcessName.Buffer = ProcessImage->Buffer + Back / sizeof(WCHAR); + ProcessName.Length = ProcessImage->Length - Back; + ProcessName.MaximumLength = ProcessImage->MaximumLength - Back; + + for (n = 0; n < _countof(ForbiddenShimmingApps); ++n) + { + if (RtlEqualUnicodeString(&ProcessName, ForbiddenShimmingApps + n, TRUE)) + { + SHIMENG_MSG("Not shimming %wZ\n", ForbiddenShimmingApps + n); + return FALSE; + } + } + + /* We should probably load all db's here, but since we do not support that yet... */ + hsdb = SdbInitDatabase(HID_DOS_PATHS | SDB_DATABASE_MAIN_SHIM, NULL); + if (hsdb) + { + if (SdbUnpackAppCompatData(hsdb, ProcessImage->Buffer, pShimData, pQuery)) + { + *pHsdb = hsdb; + return TRUE; + } + SdbReleaseDatabase(hsdb); + } + return FALSE; +} + VOID NTAPI SE_InstallBeforeInit(PUNICODE_STRING ProcessImage, PVOID pShimData) { - SHIMENG_FAIL("(%wZ, %p)", ProcessImage, pShimData); - /* Find & Load all shims.. */ + HSDB hsdb = NULL; + SDBQUERYRESULT QueryResult = { { 0 } }; + SHIMENG_MSG("(%wZ, %p)\n", ProcessImage, pShimData); + + if (!SeiGetShimData(ProcessImage, pShimData, &hsdb, &QueryResult)) + { + SHIMENG_FAIL("Failed to get shim data\n"); + return; + } + + g_bShimDuringInit = TRUE; + SeiInit(ProcessImage, hsdb, &QueryResult); + g_bShimDuringInit = FALSE; + + SdbReleaseDatabase(hsdb); } VOID NTAPI SE_InstallAfterInit(PUNICODE_STRING ProcessImage, PVOID pShimData) { - SHIMENG_FAIL("(%wZ, %p)", ProcessImage, pShimData); NotifyShims(SHIM_NOTIFY_ATTACH, NULL); } VOID NTAPI SE_ProcessDying(VOID) { - SHIMENG_FAIL("()"); + SHIMENG_MSG("()\n"); NotifyShims(SHIM_NOTIFY_DETACH, NULL); } VOID WINAPI SE_DllLoaded(PLDR_DATA_TABLE_ENTRY LdrEntry) { - SHIMENG_FAIL("(%p)", LdrEntry); + SHIMENG_INFO("%sINIT. loading DLL \"%wZ\"\n", g_bShimDuringInit ? "" : "AFTER ", &LdrEntry->BaseDllName); NotifyShims(SHIM_REASON_DLL_LOAD, LdrEntry); } VOID WINAPI SE_DllUnloaded(PLDR_DATA_TABLE_ENTRY LdrEntry) { - SHIMENG_FAIL("(%p)", LdrEntry); + SHIMENG_MSG("(%p)\n", LdrEntry); NotifyShims(SHIM_REASON_DLL_UNLOAD, LdrEntry); } BOOL WINAPI SE_IsShimDll(PVOID BaseAddress) { - SHIMENG_FAIL("(%p)", BaseAddress); - return FALSE; -} - + SHIMENG_MSG("(%p)\n", BaseAddress); + + return SeiGetShimInfo(BaseAddress) != NULL; +} + Added: trunk/reactos/dll/appcompat/apphelp/shimeng.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/shim…
============================================================================== --- trunk/reactos/dll/appcompat/apphelp/shimeng.h (added) +++ trunk/reactos/dll/appcompat/apphelp/shimeng.h [iso-8859-1] Sat Jul 1 20:06:30 2017 @@ -0,0 +1,97 @@ +/* + * Copyright 2017 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 + */ + +#ifndef SHIMENG_H +#define SHIMENG_H + +/* Structure that allows dynamic growing */ +typedef struct _ARRAY +{ + PVOID Data; + DWORD Size; + DWORD MaxSize; +} ARRAY, *PARRAY; + + +/* Shims do not know it, but actually they use the type HOOKAPIEX. + We use the 'Reserved' entry for our own purposes. */ + +typedef struct tagHOOKAPIEX +{ + PCSTR LibraryName; + PCSTR FunctionName; + PVOID ReplacementFunction; + PVOID OriginalFunction; + SINGLE_LIST_ENTRY ModuleLink; + SINGLE_LIST_ENTRY ApiLink; +} HOOKAPIEX, *PHOOKAPIEX; + +C_ASSERT(sizeof(HOOKAPIEX) == sizeof(HOOKAPI)); +C_ASSERT(offsetof(HOOKAPIEX, ModuleLink) == offsetof(HOOKAPI, Reserved)); + + +typedef struct _HOOKAPIPOINTERS +{ + PHOOKAPIEX pHookApi; + DWORD dwHookCount; +} HOOKAPIPOINTERS, *PHOOKAPIPOINTERS; + +typedef struct _SHIMMODULE +{ + UNICODE_STRING Name; + PVOID BaseAddress; + + PHOOKAPIEX (WINAPI* pGetHookAPIs)(LPCSTR szCommandLine, LPCWSTR wszShimName, PDWORD pdwHookCount); + BOOL (WINAPI* pNotifyShims)(DWORD fdwReason, PVOID ptr); + + ARRAY HookApis; /* HOOKAPIPOINTERS */ +} SHIMMODULE, *PSHIMMODULE; + +typedef struct _HOOKMODULEINFO +{ + UNICODE_STRING Name; + PVOID BaseAddress; + + SINGLE_LIST_ENTRY ModuleLink; /* Normal link, all entries from this module */ + SINGLE_LIST_ENTRY ApiLink; /* Multiple hooks on one api, unsupported for now */ +} HOOKMODULEINFO, *PHOOKMODULEINFO; + + +#if SDBAPI_DEBUG_ALLOC + +LPVOID SdbpAlloc(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 SeiAlloc(size) SdbpAlloc(size, __LINE__, __FILE__) +#define SeiReAlloc(mem, size, oldSize) SdbpReAlloc(mem, size, oldSize, __LINE__, __FILE__) +#define SeiFree(mem) SdbpFree(mem, __LINE__, __FILE__) + +#else + +LPVOID SdbpAlloc(SIZE_T size); +LPVOID SdbpReAlloc(LPVOID mem, SIZE_T size, SIZE_T oldSize); +VOID SdbpFree(LPVOID mem); + +#define SeiAlloc(size) SdbpAlloc(size) +#define SeiReAlloc(mem, size, oldSize) SdbpReAlloc(mem, size, oldSize) +#define SeiFree(mem) SdbpFree(mem) + +#endif + +#endif // SHIMENG_H Propchange: trunk/reactos/dll/appcompat/apphelp/shimeng.h ------------------------------------------------------------------------------ svn:eol-style = native
7 years, 5 months
1
0
0
0
[ssawant] 75257: [QCKLNCH] -Implemented IContextMenu::InvokeCommand() -Modified IContextMenu::QueryContextMenu() to support CheckMenuItem() -Minor code cleanup -Now Quick Launch Supports the 'show ...
by ssawant@svn.reactos.org
Author: ssawant Date: Sat Jul 1 18:34:33 2017 New Revision: 75257 URL:
http://svn.reactos.org/svn/reactos?rev=75257&view=rev
Log: [QCKLNCH] -Implemented IContextMenu::InvokeCommand() -Modified IContextMenu::QueryContextMenu() to support CheckMenuItem() -Minor code cleanup -Now Quick Launch Supports the 'show text' and 'view' options. -Tested on xpvm and ros explorer locally on win10, but needs some thorough testing Modified: branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CISFBand.cpp branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CISFBand.h branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CQuickLaunchBand.cpp Modified: branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CISFBand.cpp URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/shellext/reactos/dll/…
============================================================================== --- branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CISFBand.cpp [iso-8859-1] (original) +++ branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CISFBand.cpp [iso-8859-1] Sat Jul 1 18:34:33 2017 @@ -18,9 +18,19 @@ //***************************************************************************************** // *** CISFBand *** -CISFBand::CISFBand() : m_hWndTb(NULL), m_BandID(0), m_pidl(NULL) {} - -CISFBand::~CISFBand() {} +CISFBand::CISFBand() : + m_BandID(0), + m_hWndTb(NULL), + m_hInstance(NULL), + m_pidl(NULL), + m_textFlag(true), + m_iconFlag(true) +{ +} + +CISFBand::~CISFBand() +{ +} // *** CWindowImpl *** //Subclassing @@ -36,7 +46,8 @@ int index = SendMessage(m_hWndTb, TB_HITTEST, 0, (LPARAM)&pt); bool chk = SendMessage(m_hWndTb, TB_GETBUTTON, abs(index), (LPARAM)&tb); - if(chk) SHInvokeDefaultCommand(m_hWndTb, m_pISF, (LPITEMIDLIST)tb.dwData); + if(chk) + SHInvokeDefaultCommand(m_hWndTb, m_pISF, (LPITEMIDLIST)tb.dwData); return 0; } @@ -100,12 +111,13 @@ WS_CHILD | TBSTYLE_FLAT | TBSTYLE_LIST | CCS_NORESIZE | CCS_NODIVIDER, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, hWndParent, NULL, hInst, NULL); if (hWndToolbar == NULL) - return NULL; + return NULL; // Set the image list. HIMAGELIST* piml; HRESULT hr = SHGetImageList(SHIL_SMALL, IID_IImageList, (void**)&piml); - if (FAILED_UNEXPECTEDLY(hr)) return NULL; + if (FAILED_UNEXPECTEDLY(hr)) + return NULL; SendMessage(hWndToolbar, TB_SETIMAGELIST, 0, (LPARAM)piml); //Enumerate objects @@ -114,7 +126,8 @@ STRRET stret; ULONG count = 0; hr = m_pISF->EnumObjects(0, SHCONTF_FOLDERS, &pedl); - if (FAILED_UNEXPECTEDLY(hr)) return NULL; + if (FAILED_UNEXPECTEDLY(hr)) + return NULL; for (int i=0; pedl->Next(1, &pidl, 0) != S_FALSE; i++, count++) { @@ -154,14 +167,13 @@ m_hWndTb = CreateSimpleToolbar(hwndParent, m_hInstance); hr = SubclassWindow(m_hWndTb); - if (FAILED_UNEXPECTEDLY(hr)) return hr; - - return S_OK; - } - - HRESULT STDMETHODCALLTYPE CISFBand::GetSite( - IN REFIID riid, - OUT VOID **ppvSite) + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + return S_OK; + } + + HRESULT STDMETHODCALLTYPE CISFBand::GetSite(IN REFIID riid, OUT VOID **ppvSite) { TRACE("CISFBand::GetSite(0x%p,0x%p)\n", riid, ppvSite); @@ -189,15 +201,13 @@ return S_OK; } - HRESULT STDMETHODCALLTYPE CISFBand::ContextSensitiveHelp( - IN BOOL fEnterMode) + HRESULT STDMETHODCALLTYPE CISFBand::ContextSensitiveHelp(IN BOOL fEnterMode) { /* FIXME: Implement */ return E_NOTIMPL; } - HRESULT STDMETHODCALLTYPE CISFBand::ShowDW( - IN BOOL bShow) + HRESULT STDMETHODCALLTYPE CISFBand::ShowDW(IN BOOL bShow) { if (m_hWndTb) { @@ -207,8 +217,7 @@ return S_OK; } - HRESULT STDMETHODCALLTYPE CISFBand::CloseDW( - IN DWORD dwReserved) + HRESULT STDMETHODCALLTYPE CISFBand::CloseDW(IN DWORD dwReserved) { if (m_hWndTb) { @@ -220,20 +229,14 @@ return S_OK; } - HRESULT STDMETHODCALLTYPE CISFBand::ResizeBorderDW( - LPCRECT prcBorder, - IUnknown *punkToolbarSite, - BOOL fReserved) + HRESULT STDMETHODCALLTYPE CISFBand::ResizeBorderDW(LPCRECT prcBorder, IUnknown *punkToolbarSite, BOOL fReserved) { /* No need to implement this method */ return E_NOTIMPL; } - HRESULT STDMETHODCALLTYPE CISFBand::GetBandInfo( //Need a check - IN DWORD dwBandID, - IN DWORD dwViewMode, - IN OUT DESKBANDINFO *pdbi) + HRESULT STDMETHODCALLTYPE CISFBand::GetBandInfo(IN DWORD dwBandID, IN DWORD dwViewMode, IN OUT DESKBANDINFO *pdbi) { TRACE("CTaskBand::GetBandInfo(0x%x,0x%x,0x%p) hWnd=0x%p\n", dwBandID, dwViewMode, pdbi, m_hWndTb); @@ -295,24 +298,21 @@ /*****************************************************************************/ // *** IDeskBar *** - HRESULT STDMETHODCALLTYPE CISFBand::SetClient( - IN IUnknown *punkClient) + HRESULT STDMETHODCALLTYPE CISFBand::SetClient(IN IUnknown *punkClient) { TRACE("IDeskBar::SetClient(0x%p)\n", punkClient); return E_NOTIMPL; } - HRESULT STDMETHODCALLTYPE CISFBand::GetClient( - OUT IUnknown **ppunkClient) + HRESULT STDMETHODCALLTYPE CISFBand::GetClient(OUT IUnknown **ppunkClient) { TRACE("IDeskBar::GetClient(0x%p)\n", ppunkClient); return E_NOTIMPL; } - HRESULT STDMETHODCALLTYPE CISFBand::OnPosRectChangeDB( - IN RECT *prc) + HRESULT STDMETHODCALLTYPE CISFBand::OnPosRectChangeDB(IN RECT *prc) { TRACE("IDeskBar::OnPosRectChangeDB(0x%p=(%d,%d,%d,%d))\n", prc, prc->left, prc->top, prc->right, prc->bottom); @@ -321,8 +321,7 @@ /*****************************************************************************/ // *** IPersistStream *** - HRESULT STDMETHODCALLTYPE CISFBand::GetClassID( - OUT CLSID *pClassID) + HRESULT STDMETHODCALLTYPE CISFBand::GetClassID(OUT CLSID *pClassID) { TRACE("CISFBand::GetClassID(0x%p)\n", pClassID); /* We're going to return the (internal!) CLSID of the quick launch band */ @@ -338,8 +337,7 @@ return S_FALSE; } - HRESULT STDMETHODCALLTYPE CISFBand::Load( - IN IStream *pStm) + HRESULT STDMETHODCALLTYPE CISFBand::Load(IN IStream *pStm) { TRACE("CISFBand::Load called\n"); /* Nothing to do */ @@ -347,17 +345,14 @@ return S_OK; } - HRESULT STDMETHODCALLTYPE CISFBand::Save( - IN IStream *pStm, - IN BOOL fClearDirty) + HRESULT STDMETHODCALLTYPE CISFBand::Save(IN IStream *pStm, IN BOOL fClearDirty) { /* Nothing to do */ return S_OK; } - HRESULT STDMETHODCALLTYPE CISFBand::GetSizeMax( - OUT ULARGE_INTEGER *pcbSize) + HRESULT STDMETHODCALLTYPE CISFBand::GetSizeMax(OUT ULARGE_INTEGER *pcbSize) { TRACE("CISFBand::GetSizeMax called\n"); @@ -366,23 +361,16 @@ /*****************************************************************************/ // *** IWinEventHandler *** - HRESULT STDMETHODCALLTYPE CISFBand::ProcessMessage( - IN HWND hWnd, - IN UINT uMsg, - IN WPARAM wParam, - IN LPARAM lParam, - OUT LRESULT *plrResult) + HRESULT STDMETHODCALLTYPE CISFBand::ProcessMessage(IN HWND hWnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam, OUT LRESULT *plrResult) { TRACE("CISFBand: IWinEventHandler::ProcessMessage(0x%p, 0x%x, 0x%p, 0x%p, 0x%p)\n", hWnd, uMsg, wParam, lParam, plrResult); return E_NOTIMPL; } - HRESULT STDMETHODCALLTYPE CISFBand::ContainsWindow( - IN HWND hWnd) - { - if (hWnd == m_hWndTb || - ::IsChild(m_hWndTb, hWnd)) + HRESULT STDMETHODCALLTYPE CISFBand::ContainsWindow(IN HWND hWnd) + { + if (hWnd == m_hWndTb || ::IsChild(m_hWndTb, hWnd)) { TRACE("CISFBand::ContainsWindow(0x%p) returns S_OK\n", hWnd); return S_OK; @@ -494,67 +482,55 @@ } HRESULT STDMETHODCALLTYPE CISFBand::InvokeCommand(LPCMINVOKECOMMANDINFO pici) - { - /* BOOL fEx = FALSE; - BOOL fUnicode = FALSE; - - if (pici->cbSize == sizeof(CMINVOKECOMMANDINFOEX)) - { - fEx = TRUE; - if ((pici->fMask & CMIC_MASK_UNICODE)) - { - fUnicode = TRUE; - } - } - - if (!fUnicode && HIWORD(pici->lpVerb)) - { - if (StrCmpIA(pici->lpVerb, m_pszVerb)) - { - return E_FAIL; - } - } - - else if (fUnicode && HIWORD(((CMINVOKECOMMANDINFOEX *)pici)->lpVerbW)) - { - if (StrCmpIW(((CMINVOKECOMMANDINFOEX *)pici)->lpVerbW, m_pwszVerb)) - { - return E_FAIL; - } - } - - else if (LOWORD(pici->lpVerb) != IDM_DISPLAY) - { - return E_FAIL; - } - - else - { - ::MessageBox(pici->hwnd, - L"The File Name", - L"File Name", - MB_OK | MB_ICONINFORMATION); - }*/ - + { if (!HIWORD(pici->lpVerb)) { - switch (LOWORD(pici->lpVerb) /*- m_idCmdFirst*/) + switch (LOWORD(pici->lpVerb)) { case IDM_LARGE_ICONS: - { - ::MessageBox(0, L"IDM_LARGE_ICONS", L"Test", MB_OK | MB_ICONINFORMATION); + { + m_iconFlag = false; + + HIMAGELIST* piml = (HIMAGELIST*) SendMessage(m_hWndTb, TB_GETIMAGELIST, 0, 0); + HRESULT hr = SHGetImageList(SHIL_LARGE, IID_IImageList, (void**)&piml); + if (FAILED_UNEXPECTEDLY(hr)) return hr; + SendMessage(m_hWndTb, TB_SETIMAGELIST, 0, (LPARAM)piml); + hr = IUnknown_Exec(m_Site, IID_IDeskBand, DBID_BANDINFOCHANGED, 0, NULL, NULL); + if (FAILED_UNEXPECTEDLY(hr)) return hr; break; } case IDM_SMALL_ICONS: - { - ::MessageBox(0, L"IDM_SMALL_ICONS", L"Test", MB_OK | MB_ICONINFORMATION); + { + m_iconFlag = true; + + HIMAGELIST* piml = (HIMAGELIST*)SendMessage(m_hWndTb, TB_GETIMAGELIST, 0, 0); + HRESULT hr = SHGetImageList(SHIL_SMALL, IID_IImageList, (void**)&piml); + if (FAILED_UNEXPECTEDLY(hr)) return hr; + SendMessage(m_hWndTb, TB_SETIMAGELIST, 0, (LPARAM)piml); + hr = IUnknown_Exec(m_Site, IID_IDeskBand, DBID_BANDINFOCHANGED, 0, NULL, NULL); + if (FAILED_UNEXPECTEDLY(hr)) return hr; break; } case IDM_SHOW_TEXT: - { - ::MessageBox(0, L"IDM_SHOW_TEXT", L"Test", MB_OK | MB_ICONINFORMATION); + { + if (m_textFlag) + { + m_textFlag = false; + SendMessage(m_hWndTb, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS); + HRESULT hr = IUnknown_Exec(m_Site, IID_IDeskBand, DBID_BANDINFOCHANGED, 0, NULL, NULL); + if (FAILED_UNEXPECTEDLY(hr)) return hr; + } + else + { + m_textFlag = true; + SendMessage(m_hWndTb, TB_SETEXTENDEDSTYLE, 0, 0); + HRESULT hr = IUnknown_Exec(m_Site, IID_IDeskBand, DBID_BANDINFOCHANGED, 0, NULL, NULL); + if (FAILED_UNEXPECTEDLY(hr)) return hr; + } break; } + default: + return E_FAIL; } } @@ -562,11 +538,25 @@ } HRESULT STDMETHODCALLTYPE CISFBand::QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) - { - m_idCmdFirst = idCmdFirst; - m_qMenu = LoadMenu(_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCE(IDR_POPUPMENU)); - m_qMenu = GetSubMenu(m_qMenu, 0); - UINT idMax = Shell_MergeMenus(hmenu, m_qMenu, indexMenu, idCmdFirst, idCmdLast, MM_SUBMENUSHAVEIDS); + { + HMENU qMenu = LoadMenu(_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCE(IDR_POPUPMENU)); + UINT idMax = Shell_MergeMenus(hmenu, GetSubMenu(qMenu, 0), indexMenu, idCmdFirst, idCmdLast, MM_SUBMENUSHAVEIDS); + + if(m_textFlag) + CheckMenuItem(hmenu, IDM_SHOW_TEXT, MF_CHECKED); + else + CheckMenuItem(hmenu, IDM_SHOW_TEXT, MF_UNCHECKED); + + if (m_iconFlag) + { + CheckMenuItem(hmenu, IDM_SMALL_ICONS, MF_CHECKED); + CheckMenuItem(hmenu, IDM_LARGE_ICONS, MF_UNCHECKED); + } + else + { + CheckMenuItem(hmenu, IDM_LARGE_ICONS, MF_CHECKED); + CheckMenuItem(hmenu, IDM_SMALL_ICONS, MF_UNCHECKED); + } return MAKE_HRESULT(SEVERITY_SUCCESS, 0, USHORT(idMax - idCmdFirst +1)); } Modified: branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CISFBand.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/shellext/reactos/dll/…
============================================================================== --- branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CISFBand.h [iso-8859-1] (original) +++ branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CISFBand.h [iso-8859-1] Sat Jul 1 18:34:33 2017 @@ -31,10 +31,10 @@ CComPtr<IShellFolder> m_pISF; PCIDLIST_ABSOLUTE m_pidl; - //Menu - HMENU m_qMenu; - UINT m_idCmdFirst; - + //Menu + BOOL m_textFlag; + BOOL m_iconFlag; + public: CISFBand(); Modified: branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CQuickLaunchBand.cpp URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/shellext/reactos/dll/…
============================================================================== --- branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CQuickLaunchBand.cpp [iso-8859-1] (original) +++ branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CQuickLaunchBand.cpp [iso-8859-1] Sat Jul 1 18:34:33 2017 @@ -103,9 +103,7 @@ return pIOWS->SetSite(pUnkSite); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetSite( - IN REFIID riid, - OUT VOID **ppvSite) + HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetSite(IN REFIID riid, OUT VOID **ppvSite) { TRACE("CQuickLaunchBand::GetSite(0x%p,0x%p)\n", riid, ppvSite); @@ -129,8 +127,7 @@ return pIDB->GetWindow(phwnd); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::ContextSensitiveHelp( - IN BOOL fEnterMode) + HRESULT STDMETHODCALLTYPE CQuickLaunchBand::ContextSensitiveHelp(IN BOOL fEnterMode) { //Internal CISFBand Calls CComPtr<IDeskBand> pIDB; @@ -140,8 +137,7 @@ return pIDB->ContextSensitiveHelp(fEnterMode); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::ShowDW( - IN BOOL bShow) + HRESULT STDMETHODCALLTYPE CQuickLaunchBand::ShowDW(IN BOOL bShow) { //Internal CISFBand Calls CComPtr<IDeskBand> pIDB; @@ -151,8 +147,7 @@ return pIDB->ShowDW(bShow); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::CloseDW( - IN DWORD dwReserved) + HRESULT STDMETHODCALLTYPE CQuickLaunchBand::CloseDW(IN DWORD dwReserved) { //Internal CISFBand Calls CComPtr<IDeskBand> pIDB; @@ -162,10 +157,7 @@ return pIDB->CloseDW(dwReserved); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::ResizeBorderDW( - LPCRECT prcBorder, - IUnknown *punkToolbarSite, - BOOL fReserved) + HRESULT STDMETHODCALLTYPE CQuickLaunchBand::ResizeBorderDW(LPCRECT prcBorder, IUnknown *punkToolbarSite, BOOL fReserved) { //Internal CISFBand Calls CComPtr<IDeskBand> pIDB; @@ -175,10 +167,7 @@ return pIDB->ResizeBorderDW(prcBorder, punkToolbarSite, fReserved); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetBandInfo( //Need a check - IN DWORD dwBandID, - IN DWORD dwViewMode, - IN OUT DESKBANDINFO *pdbi) + HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetBandInfo(IN DWORD dwBandID, IN DWORD dwViewMode, IN OUT DESKBANDINFO *pdbi) { TRACE("CQuickLaunchBand::GetBandInfo(0x%x,0x%x,0x%p)\n", dwBandID, dwViewMode, pdbi); @@ -192,8 +181,7 @@ /*****************************************************************************/ //IDeskBar - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::SetClient( - IN IUnknown *punkClient) + HRESULT STDMETHODCALLTYPE CQuickLaunchBand::SetClient(IN IUnknown *punkClient) { TRACE("IDeskBar::SetClient(0x%p)\n", punkClient); @@ -205,8 +193,7 @@ return pIDB->SetClient(punkClient); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetClient( - OUT IUnknown **ppunkClient) + HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetClient(OUT IUnknown **ppunkClient) { TRACE("IDeskBar::GetClient(0x%p)\n", ppunkClient); @@ -218,8 +205,7 @@ return pIDB->GetClient(ppunkClient); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::OnPosRectChangeDB( - IN RECT *prc) + HRESULT STDMETHODCALLTYPE CQuickLaunchBand::OnPosRectChangeDB(IN RECT *prc) { TRACE("IDeskBar::OnPosRectChangeDB(0x%p=(%d,%d,%d,%d))\n", prc, prc->left, prc->top, prc->right, prc->bottom); @@ -233,8 +219,7 @@ /*****************************************************************************/ //IPersistStream - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetClassID( - OUT CLSID *pClassID) + HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetClassID(OUT CLSID *pClassID) { TRACE("CQuickLaunchBand::GetClassID(0x%p)\n", pClassID); @@ -256,8 +241,7 @@ return pIPS->IsDirty(); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::Load( - IN IStream *pStm) + HRESULT STDMETHODCALLTYPE CQuickLaunchBand::Load(IN IStream *pStm) { TRACE("CQuickLaunchBand::Load called\n"); @@ -269,9 +253,7 @@ return pIPS->Load(pStm); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::Save( - IN IStream *pStm, - IN BOOL fClearDirty) + HRESULT STDMETHODCALLTYPE CQuickLaunchBand::Save(IN IStream *pStm, IN BOOL fClearDirty) { //Internal CISFBand Calls CComPtr<IPersistStream> pIPS; @@ -281,8 +263,7 @@ return pIPS->Save(pStm, fClearDirty); } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetSizeMax( - OUT ULARGE_INTEGER *pcbSize) + HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetSizeMax(OUT ULARGE_INTEGER *pcbSize) { TRACE("CQuickLaunchBand::GetSizeMax called\n"); @@ -297,20 +278,14 @@ /*****************************************************************************/ //IWinEventHandler - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::ProcessMessage( - IN HWND hWnd, - IN UINT uMsg, - IN WPARAM wParam, - IN LPARAM lParam, - OUT LRESULT *plrResult) + HRESULT STDMETHODCALLTYPE CQuickLaunchBand::ProcessMessage(IN HWND hWnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam, OUT LRESULT *plrResult) { TRACE("CQuickLaunchBand: IWinEventHandler::ProcessMessage(0x%p, 0x%x, 0x%p, 0x%p, 0x%p)\n", hWnd, uMsg, wParam, lParam, plrResult); return E_NOTIMPL; } - HRESULT STDMETHODCALLTYPE CQuickLaunchBand::ContainsWindow( - IN HWND hWnd) + HRESULT STDMETHODCALLTYPE CQuickLaunchBand::ContainsWindow(IN HWND hWnd) { return E_NOTIMPL; }
7 years, 5 months
1
0
0
0
[mjansen] 75256: [ACPPAGE] Register the extension + allow it to be disabled with policies. Disable it with the rest of the app compat infrastructure. CORE-10375
by mjansen@svn.reactos.org
Author: mjansen Date: Sat Jul 1 11:37:44 2017 New Revision: 75256 URL:
http://svn.reactos.org/svn/reactos?rev=75256&view=rev
Log: [ACPPAGE] Register the extension + allow it to be disabled with policies. Disable it with the rest of the app compat infrastructure. CORE-10375 Modified: trunk/reactos/boot/bootdata/hivesft.inf trunk/reactos/boot/bootdata/hivesys.inf trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp trunk/reactos/media/inf/syssetup.inf Modified: trunk/reactos/boot/bootdata/hivesft.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesft.inf?…
============================================================================== --- trunk/reactos/boot/bootdata/hivesft.inf [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/hivesft.inf [iso-8859-1] Sat Jul 1 11:37:44 2017 @@ -1685,6 +1685,9 @@ HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows","swapdisk",0x00000000,"" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows","TransmissionRetryTimeout",0x00000000,"90" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows","USERProcessHandleQuota",0x00010001,0x2710 + +; App Compat -- Disable on ReactOS +HKLM,"SOFTWARE\Policies\Microsoft\Windows\AppCompat","DisableEngine",0x00010003, 0x00000001 ;-------------------------------- STRINGS ------------------------------- Modified: trunk/reactos/boot/bootdata/hivesys.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesys.inf?…
============================================================================== --- trunk/reactos/boot/bootdata/hivesys.inf [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/hivesys.inf [iso-8859-1] Sat Jul 1 11:37:44 2017 @@ -1453,9 +1453,6 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems","Posix",0x00020000,"%SystemRoot%\system32\psxss.exe" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems","Required",0x00010000,"Debug","Windows" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems","Windows",0x00020000,"%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,12288,512 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=winsrv:ConServerDllInitialization,2 ProfileControl=Off MaxRequestThreads=16" - -; App Compat -- Disable on ReactOS -HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\AppCompatibility","DisableAppCompat",0x00010003, 0x00000001 ; This is an empty App Compat cache HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\AppCompatCache","AppCompatCache", 0x00000001, \ Modified: trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/acppage/CLaye…
============================================================================== --- trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp [iso-8859-1] Sat Jul 1 11:37:44 2017 @@ -561,11 +561,43 @@ return FALSE; } +static BOOL DisableShellext() +{ + HKEY hkey; + LSTATUS ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\Windows\\AppCompat", 0, KEY_QUERY_VALUE, &hkey); + BOOL Disable = FALSE; + if (ret == ERROR_SUCCESS) + { + DWORD dwValue = 0; + DWORD type, size = sizeof(dwValue); + ret = RegQueryValueExW(hkey, L"DisableEngine", NULL, &type, (PBYTE)&dwValue, &size); + if (ret == ERROR_SUCCESS && type == REG_DWORD) + { + Disable = !!dwValue; + } + if (!Disable) + { + size = sizeof(dwValue); + ret = RegQueryValueExW(hkey, L"DisablePropPage", NULL, &type, (PBYTE)&dwValue, &size); + if (ret == ERROR_SUCCESS && type == REG_DWORD) + { + Disable = !!dwValue; + } + } + + RegCloseKey(hkey); + } + return Disable; +} STDMETHODIMP CLayerUIPropPage::Initialize(LPCITEMIDLIST pidlFolder, LPDATAOBJECT pDataObj, HKEY hkeyProgID) { FORMATETC etc = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; STGMEDIUM stg; + + if (DisableShellext()) + return E_ACCESSDENIED; + HRESULT hr = pDataObj->GetData(&etc, &stg); if (FAILED(hr)) { Modified: trunk/reactos/media/inf/syssetup.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/inf/syssetup.inf?rev…
============================================================================== --- trunk/reactos/media/inf/syssetup.inf [iso-8859-1] (original) +++ trunk/reactos/media/inf/syssetup.inf [iso-8859-1] Sat Jul 1 11:37:44 2017 @@ -35,7 +35,7 @@ [OleControlDlls] 11,,atl.dll,1 11,,actxprxy.dll,1 -;11,,acppage.dll,1 +11,,acppage.dll,1 11,,amstream.dll,1 11,,avifil32.dll,1 11,,browseui.dll,1
7 years, 5 months
1
0
0
0
[tfaber] 75255: [USBPORT][USBHUB_NEW] - Make use of the newly defined structures and constants and remove locally defined versions. Patch by Vadim Galyant.
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Jul 1 06:22:27 2017 New Revision: 75255 URL:
http://svn.reactos.org/svn/reactos?rev=75255&view=rev
Log: [USBPORT][USBHUB_NEW] - Make use of the newly defined structures and constants and remove locally defined versions. Patch by Vadim Galyant. Modified: trunk/reactos/drivers/usb/usbhub_new/ioctl.c trunk/reactos/drivers/usb/usbhub_new/pnp.c trunk/reactos/drivers/usb/usbhub_new/usbhub.c trunk/reactos/drivers/usb/usbhub_new/usbhub.h trunk/reactos/drivers/usb/usbport/iface.c trunk/reactos/drivers/usb/usbport/roothub.c trunk/reactos/sdk/include/reactos/drivers/usbport/usbmport.h Modified: trunk/reactos/drivers/usb/usbhub_new/ioctl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbhub_new/ioc…
============================================================================== --- trunk/reactos/drivers/usb/usbhub_new/ioctl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbhub_new/ioctl.c [iso-8859-1] Sat Jul 1 06:22:27 2017 @@ -250,7 +250,7 @@ Status = USBH_SyncGetPortStatus(HubExtension, PortExtension->PortNumber, &PortData->PortStatus, - sizeof(USBHUB_PORT_STATUS)); + sizeof(USB_PORT_STATUS_AND_CHANGE)); IoStack = IoGetCurrentIrpStackLocation(Irp); PortStatus = IoStack->Parameters.Others.Argument1; @@ -259,12 +259,12 @@ if (PortExtension->Common.SelfDevice == PortData->DeviceObject) { - if (PortData->PortStatus.UsbPortStatus.Usb20PortStatus.PortEnabledDisabled) + if (PortData->PortStatus.PortStatus.Usb20PortStatus.PortEnabledDisabled) { *PortStatus |= USBD_PORT_ENABLED; } - if (PortData->PortStatus.UsbPortStatus.Usb20PortStatus.CurrentConnectStatus) + if (PortData->PortStatus.PortStatus.Usb20PortStatus.CurrentConnectStatus) { *PortStatus |= USBD_PORT_CONNECTED; } Modified: trunk/reactos/drivers/usb/usbhub_new/pnp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbhub_new/pnp…
============================================================================== --- trunk/reactos/drivers/usb/usbhub_new/pnp.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbhub_new/pnp.c [iso-8859-1] Sat Jul 1 06:22:27 2017 @@ -1131,7 +1131,7 @@ DPRINT_ENUM("USBH_FdoQueryBusRelations: Port - %x, ConnectStatus - %x\n", Port, - PortData->PortStatus.UsbPortStatus.Usb20PortStatus.CurrentConnectStatus); + PortData->PortStatus.PortStatus.Usb20PortStatus.CurrentConnectStatus); if (HubExtension->HubFlags & USBHUB_FDO_FLAG_DEVICE_FAILED) { @@ -1141,7 +1141,7 @@ Status = USBH_SyncGetPortStatus(HubExtension, Port, &PortData->PortStatus, - sizeof(USBHUB_PORT_STATUS)); + sizeof(USB_PORT_STATUS_AND_CHANGE)); if (!NT_SUCCESS(Status)) { @@ -1158,7 +1158,7 @@ if (PdoExtension->PortPdoFlags & USBHUB_PDO_FLAG_OVERCURRENT_PORT) { - PortData->PortStatus.UsbPortStatus.Usb20PortStatus.CurrentConnectStatus = 1; + PortData->PortStatus.PortStatus.Usb20PortStatus.CurrentConnectStatus = 1; } } @@ -1168,7 +1168,7 @@ DbgBreakPoint(); } - if (!PortData->PortStatus.UsbPortStatus.Usb20PortStatus.CurrentConnectStatus) + if (!PortData->PortStatus.PortStatus.Usb20PortStatus.CurrentConnectStatus) { if (PdoDevice) { @@ -1233,9 +1233,9 @@ NtStatus = USBH_SyncGetPortStatus(HubExtension, Port, &PortData->PortStatus, - sizeof(USBHUB_PORT_STATUS)); - - UsbPortStatus = PortData->PortStatus.UsbPortStatus; + sizeof(USB_PORT_STATUS_AND_CHANGE)); + + UsbPortStatus = PortData->PortStatus.PortStatus; if (NT_SUCCESS(NtStatus)) { @@ -1472,7 +1472,7 @@ if (PortDevice) { - PortData->PortStatus.AsULONG = 0; + PortData->PortStatus.AsUlong32 = 0; PortData->DeviceObject = NULL; PortExtension = PortDevice->DeviceExtension; @@ -2064,7 +2064,7 @@ Status = USBH_SyncGetPortStatus(HubExtension, PortExtension->PortNumber, &PortData->PortStatus, - sizeof(USBHUB_PORT_STATUS)); + sizeof(USB_PORT_STATUS_AND_CHANGE)); if (NT_SUCCESS(Status)) { Modified: trunk/reactos/drivers/usb/usbhub_new/usbhub.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbhub_new/usb…
============================================================================== --- trunk/reactos/drivers/usb/usbhub_new/usbhub.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbhub_new/usbhub.c [iso-8859-1] Sat Jul 1 06:22:27 2017 @@ -464,7 +464,7 @@ USBH_SyncResetPort(IN PUSBHUB_FDO_EXTENSION HubExtension, IN USHORT Port) { - USBHUB_PORT_STATUS PortStatus; + USB_PORT_STATUS_AND_CHANGE PortStatus; KEVENT Event; LARGE_INTEGER Timeout; ULONG ResetRetry = 0; @@ -483,10 +483,10 @@ Status = USBH_SyncGetPortStatus(HubExtension, Port, &PortStatus, - sizeof(USBHUB_PORT_STATUS)); + sizeof(USB_PORT_STATUS_AND_CHANGE)); if (NT_SUCCESS(Status) && - (PortStatus.UsbPortStatus.Usb20PortStatus.CurrentConnectStatus == 0)) + (PortStatus.PortStatus.Usb20PortStatus.CurrentConnectStatus == 0)) { Status = STATUS_UNSUCCESSFUL; goto Exit; @@ -545,10 +545,10 @@ Status = USBH_SyncGetPortStatus(HubExtension, Port, &PortStatus, - sizeof(USBHUB_PORT_STATUS)); + sizeof(USB_PORT_STATUS_AND_CHANGE)); if (!NT_SUCCESS(Status) || - (PortStatus.UsbPortStatus.Usb20PortStatus.CurrentConnectStatus == 0) || + (PortStatus.PortStatus.Usb20PortStatus.CurrentConnectStatus == 0) || ResetRetry >= USBHUB_RESET_PORT_MAX_RETRY) { InterlockedExchangePointer((PVOID)&HubExtension->pResetPortEvent, @@ -567,9 +567,9 @@ Status = USBH_SyncGetPortStatus(HubExtension, Port, &PortStatus, - sizeof(USBHUB_PORT_STATUS)); - - if ((PortStatus.UsbPortStatus.Usb20PortStatus.CurrentConnectStatus == 0) && + sizeof(USB_PORT_STATUS_AND_CHANGE)); + + if ((PortStatus.PortStatus.Usb20PortStatus.CurrentConnectStatus == 0) && NT_SUCCESS(Status) && HubExtension->HubFlags & USBHUB_FDO_FLAG_USB20_HUB) { @@ -1156,7 +1156,7 @@ for (ix = 0; ix < NumberPorts; ix++) { - PortData[ix].PortStatus.AsULONG = 0; + PortData[ix].PortStatus.AsUlong32 = 0; if (ExtendedHubInfo) { @@ -1355,7 +1355,7 @@ NTAPI USBH_SyncGetPortStatus(IN PUSBHUB_FDO_EXTENSION HubExtension, IN USHORT Port, - IN PUSBHUB_PORT_STATUS PortStatus, + IN PUSB_PORT_STATUS_AND_CHANGE PortStatus, IN ULONG Length) { BM_REQUEST_TYPE RequestType; @@ -1417,7 +1417,7 @@ PUSB_HUB_DESCRIPTOR HubDescriptor; NTSTATUS Status = STATUS_SUCCESS; BM_REQUEST_TYPE RequestType; - PUSBHUB_PORT_STATUS PortStatus; + PUSB_PORT_STATUS_AND_CHANGE PortStatus; DPRINT("USBH_SyncPowerOnPort: Port - %x, IsWait - %x\n", Port, IsWait); @@ -1425,7 +1425,7 @@ PortData = &HubExtension->PortData[Port - 1]; PortStatus = &PortData->PortStatus; - if (PortStatus->UsbPortStatus.Usb20PortStatus.CurrentConnectStatus == 1) + if (PortStatus->PortStatus.Usb20PortStatus.CurrentConnectStatus == 1) { return Status; } @@ -1453,7 +1453,7 @@ USBH_Wait(2 * HubDescriptor->bPowerOnToPowerGood); } - PortStatus->UsbPortStatus.Usb20PortStatus.CurrentConnectStatus = 1; + PortStatus->PortStatus.Usb20PortStatus.CurrentConnectStatus = 1; } return Status; @@ -1520,7 +1520,7 @@ if (NT_SUCCESS(Status)) { - PortData->PortStatus.UsbPortStatus.Usb20PortStatus.PortEnabledDisabled = 0; + PortData->PortStatus.PortStatus.Usb20PortStatus.PortEnabledDisabled = 0; } return Status; @@ -1660,12 +1660,12 @@ HubExtension = Context; DPRINT_SCE("USBH_ChangeIndicationProcessChange: PortStatus - %lX\n", - HubExtension->PortStatus.AsULONG); + HubExtension->PortStatus.AsUlong32); if ((NT_SUCCESS(Irp->IoStatus.Status) || USBD_SUCCESS(HubExtension->SCEWorkerUrb.Hdr.Status)) && - (HubExtension->PortStatus.UsbPortStatusChange.ResetChange || - HubExtension->PortStatus.UsbPortStatusChange.PortEnableDisableChange)) + (HubExtension->PortStatus.PortChange.Usb20PortChange.ResetChange || + HubExtension->PortStatus.PortChange.Usb20PortChange.PortEnableDisableChange)) { if (!InterlockedDecrement(&HubExtension->PendingRequestCount)) { @@ -1678,7 +1678,7 @@ HubExtension->WorkItemToQueue = NULL; - if (HubExtension->PortStatus.UsbPortStatusChange.ResetChange) + if (HubExtension->PortStatus.PortChange.Usb20PortChange.ResetChange) { RequestValue = USBHUB_FEATURE_C_PORT_RESET; } @@ -1782,10 +1782,10 @@ NTAPI USBH_ProcessPortStateChange(IN PUSBHUB_FDO_EXTENSION HubExtension, IN USHORT Port, - IN PUSBHUB_PORT_STATUS PortStatus) + IN PUSB_PORT_STATUS_AND_CHANGE PortStatus) { PUSBHUB_PORT_DATA PortData; - USB_PORT_STATUS_CHANGE PortStatusChange; + USB_20_PORT_CHANGE PortStatusChange; PDEVICE_OBJECT PortDevice; PUSBHUB_PORT_PDO_EXTENSION PortExtension; PVOID SerialNumber; @@ -1798,11 +1798,11 @@ ASSERT(Port > 0); PortData = &HubExtension->PortData[Port - 1]; - PortStatusChange = PortStatus->UsbPortStatusChange; + PortStatusChange = PortStatus->PortChange.Usb20PortChange; if (PortStatusChange.ConnectStatusChange) { - PortData->PortStatus.AsULONG = *(PULONG)PortStatus; + PortData->PortStatus = *PortStatus; USBH_SyncClearPortStatus(HubExtension, Port, @@ -2062,7 +2062,7 @@ PUSBHUB_FDO_EXTENSION LowerHubExtension; PUSBHUB_PORT_PDO_EXTENSION LowerPortExtension; PUSBHUB_STATUS_CHANGE_CONTEXT WorkItem; - USBHUB_PORT_STATUS PortStatus; + USB_PORT_STATUS_AND_CHANGE PortStatus; NTSTATUS Status; USHORT Port = 0; @@ -2115,10 +2115,10 @@ Status = USBH_SyncGetPortStatus(LowerHubExtension, LowerPortExtension->PortNumber, &PortStatus, - sizeof(USBHUB_PORT_STATUS)); + sizeof(USB_PORT_STATUS_AND_CHANGE)); if (!NT_SUCCESS(Status) || - !PortStatus.UsbPortStatus.Usb20PortStatus.CurrentConnectStatus) + !PortStatus.PortStatus.Usb20PortStatus.CurrentConnectStatus) { HubExtension->HubFlags |= USBHUB_FDO_FLAG_DEVICE_REMOVED; @@ -2162,7 +2162,7 @@ Status = USBH_SyncGetPortStatus(HubExtension, Port, &PortStatus, - sizeof(USBHUB_PORT_STATUS)); + sizeof(USB_PORT_STATUS_AND_CHANGE)); } else { @@ -4537,7 +4537,7 @@ PVOID Handle; PVOID OldDeviceHandle; PUSB_DEVICE_HANDLE * DeviceHandle; - USBHUB_PORT_STATUS PortStatus; + USB_PORT_STATUS_AND_CHANGE PortStatus; DPRINT("USBH_ResetDevice: HubExtension - %p, Port - %x, IsKeepDeviceData - %x, IsWait - %x\n", HubExtension, @@ -4548,10 +4548,10 @@ Status = USBH_SyncGetPortStatus(HubExtension, Port, &PortStatus, - sizeof(USBHUB_PORT_STATUS)); + sizeof(USB_PORT_STATUS_AND_CHANGE)); if (!NT_SUCCESS(Status) || - !(PortStatus.UsbPortStatus.Usb20PortStatus.CurrentConnectStatus)) + !(PortStatus.PortStatus.Usb20PortStatus.CurrentConnectStatus)) { return STATUS_UNSUCCESSFUL; } @@ -4625,7 +4625,7 @@ Status = USBH_SyncGetPortStatus(HubExtension, Port, &PortStatus, - sizeof(USBHUB_PORT_STATUS)); + sizeof(USB_PORT_STATUS_AND_CHANGE)); if (!NT_SUCCESS(Status)) { @@ -4634,7 +4634,7 @@ Status = USBD_CreateDeviceEx(HubExtension, DeviceHandle, - PortStatus.UsbPortStatus, + PortStatus.PortStatus, Port); if (!NT_SUCCESS(Status)) Modified: trunk/reactos/drivers/usb/usbhub_new/usbhub.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbhub_new/usb…
============================================================================== --- trunk/reactos/drivers/usb/usbhub_new/usbhub.h [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbhub_new/usbhub.h [iso-8859-1] Sat Jul 1 06:22:27 2017 @@ -108,7 +108,7 @@ extern PWSTR GenericUSBDeviceString; typedef struct _USBHUB_PORT_DATA { - USBHUB_PORT_STATUS PortStatus; + USB_PORT_STATUS_AND_CHANGE PortStatus; PDEVICE_OBJECT DeviceObject; USB_CONNECTION_STATUS ConnectionStatus; ULONG PortAttributes; @@ -189,7 +189,7 @@ KSEMAPHORE HubSemaphore; PUSBHUB_IO_WORK_ITEM WorkItemToQueue; USB_IDLE_CALLBACK_INFO IdleCallbackInfo; - USBHUB_PORT_STATUS PortStatus; + USB_PORT_STATUS_AND_CHANGE PortStatus; PIRP PowerIrp; } USBHUB_FDO_EXTENSION, *PUSBHUB_FDO_EXTENSION; @@ -480,7 +480,7 @@ USBH_SyncGetPortStatus( IN PUSBHUB_FDO_EXTENSION HubExtension, IN USHORT Port, - IN PUSBHUB_PORT_STATUS PortStatus, + IN PUSB_PORT_STATUS_AND_CHANGE PortStatus, IN ULONG Length); NTSTATUS Modified: trunk/reactos/drivers/usb/usbport/iface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbport/iface.…
============================================================================== --- trunk/reactos/drivers/usb/usbport/iface.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbport/iface.c [iso-8859-1] Sat Jul 1 06:22:27 2017 @@ -421,7 +421,7 @@ ULONG NumPorts; ULONG ix; PUSB_EXTHUB_INFORMATION_0 HubInfoBuffer; - USBHUB_PORT_STATUS PortStatus; + USB_PORT_STATUS_AND_CHANGE PortStatus; ULONG PortAttrX; DPRINT("USBHI_GetExtendedHubInformation: ... \n"); @@ -433,7 +433,7 @@ Packet = &FdoExtension->MiniPortInterface->Packet; HubInfoBuffer = HubInformationBuffer; - PortStatus.AsULONG = 0; + PortStatus.AsUlong32 = 0; if (HubPhysicalDeviceObject != PdoDevice) { @@ -472,7 +472,7 @@ ix, &PortStatus); - if (PortStatus.UsbPortStatus.Usb20PortStatus.AsUshort16 & 0x8000) + if (PortStatus.PortStatus.Usb20PortStatus.AsUshort16 & 0x8000) { HubInfoBuffer->Port[ix].PortAttributes |= USB_PORTATTR_OWNED_BY_CC; } Modified: trunk/reactos/drivers/usb/usbport/roothub.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbport/roothu…
============================================================================== --- trunk/reactos/drivers/usb/usbport/roothub.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbport/roothub.c [iso-8859-1] Sat Jul 1 06:22:27 2017 @@ -534,7 +534,7 @@ PUSBPORT_RHDEVICE_EXTENSION PdoExtension; PUSBPORT_REGISTRATION_PACKET Packet; ULONG TransferLength; - USBHUB_PORT_STATUS PortStatus; + USB_PORT_STATUS_AND_CHANGE PortStatus; USB_HUB_STATUS_AND_CHANGE HubStatus; PVOID Buffer; PULONG AddressBitMap; @@ -555,7 +555,7 @@ HubDescriptor = &PdoExtension->RootHubDescriptors->Descriptor; NumberOfPorts = HubDescriptor->bNumberOfPorts; - PortStatus.AsULONG = 0; + PortStatus.AsUlong32 = 0; HubStatus.AsUlong32 = 0; Urb = Transfer->Urb; @@ -608,11 +608,11 @@ return RH_STATUS_UNSUCCESSFUL; } - if (PortStatus.UsbPortStatusChange.ConnectStatusChange || - PortStatus.UsbPortStatusChange.PortEnableDisableChange || - PortStatus.UsbPortStatusChange.SuspendChange || - PortStatus.UsbPortStatusChange.OverCurrentIndicatorChange || - PortStatus.UsbPortStatusChange.ResetChange) + if (PortStatus.PortChange.Usb20PortChange.ConnectStatusChange || + PortStatus.PortChange.Usb20PortChange.PortEnableDisableChange || + PortStatus.PortChange.Usb20PortChange.SuspendChange || + PortStatus.PortChange.Usb20PortChange.OverCurrentIndicatorChange || + PortStatus.PortChange.Usb20PortChange.ResetChange) { /* At the port status there is a change */ AddressBitMap[Port >> 5] |= 1 << (Port & 0x1F); @@ -858,11 +858,11 @@ Packet->MiniPortVersion == USB_MINIPORT_VERSION_UHCI || Packet->MiniPortVersion == USB_MINIPORT_VERSION_EHCI) { - RH_HubDescriptor->bDescriptorType = 0x29; // #define USB_20_HUB_DESCRIPTOR_TYPE 0x29 - need add in .h file + RH_HubDescriptor->bDescriptorType = USB_20_HUB_DESCRIPTOR_TYPE; } else if (Packet->MiniPortVersion == USB_MINIPORT_VERSION_XHCI) { - RH_HubDescriptor->bDescriptorType = 0x2A; // #define USB_30_HUB_DESCRIPTOR_TYPE 0x2A - need add in .h file + RH_HubDescriptor->bDescriptorType = USB_30_HUB_DESCRIPTOR_TYPE; } else { @@ -923,9 +923,9 @@ FdoDevice = FdoExtension->CommonExtension.SelfDevice; if (FdoExtension->Flags & USBPORT_FLAG_HC_SUSPEND && - FdoExtension->Flags & USBPORT_FLAG_HC_WAKE_SUPPORT && - FdoExtension->MiniPortFlags & USBPORT_MPFLAG_SUSPENDED && - FdoExtension->TimerFlags & USBPORT_TMFLAG_WAKE) + FdoExtension->Flags & USBPORT_FLAG_HC_WAKE_SUPPORT && + FdoExtension->MiniPortFlags & USBPORT_MPFLAG_SUSPENDED && + FdoExtension->TimerFlags & USBPORT_TMFLAG_WAKE) { USBPORT_HcQueueWakeDpc(FdoDevice); return 0; Modified: trunk/reactos/sdk/include/reactos/drivers/usbport/usbmport.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/reactos/driver…
============================================================================== --- trunk/reactos/sdk/include/reactos/drivers/usbport/usbmport.h [iso-8859-1] (original) +++ trunk/reactos/sdk/include/reactos/drivers/usbport/usbmport.h [iso-8859-1] Sat Jul 1 06:22:27 2017 @@ -66,19 +66,7 @@ #define RH_STATUS_NO_CHANGES 1 #define RH_STATUS_UNSUCCESSFUL 2 -typedef USB_20_PORT_CHANGE USB_PORT_STATUS_CHANGE; - -typedef union _USBHUB_PORT_STATUS { -struct { - USB_PORT_STATUS UsbPortStatus; - USB_PORT_STATUS_CHANGE UsbPortStatusChange; - }; - ULONG AsULONG; -} USBHUB_PORT_STATUS, *PUSBHUB_PORT_STATUS; - /* Additional USB Class Codes from
USB.org
*/ -#define USBC_DEVICE_CLASS_AUDIO_VIDEO 0x10 -#define USBC_DEVICE_CLASS_BILLBOARD 0x11 #define USBC_DEVICE_CLASS_TYPE_C_BRIDGE 0x12 /* Miniport functions */ @@ -222,7 +210,7 @@ (NTAPI *PHCI_RH_GET_PORT_STATUS)( PVOID, USHORT, - PUSBHUB_PORT_STATUS); + PUSB_PORT_STATUS_AND_CHANGE); typedef MPSTATUS (NTAPI *PHCI_RH_GET_HUB_STATUS)(
7 years, 5 months
1
0
0
0
← Newer
1
...
18
19
20
21
22
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Results per page:
10
25
50
100
200