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
March 2016
----- 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
13 participants
263 discussions
Start a n
N
ew thread
[ekohl] 71087: [NET] Net utility not enumerating local user accounts. Patch by Curtis Wilson. CORE-11023 #resolve #comment Thanks a lot!
by ekohl@svn.reactos.org
Author: ekohl Date: Thu Mar 31 21:48:43 2016 New Revision: 71087 URL:
http://svn.reactos.org/svn/reactos?rev=71087&view=rev
Log: [NET] Net utility not enumerating local user accounts. Patch by Curtis Wilson. CORE-11023 #resolve #comment Thanks a lot! Modified: trunk/reactos/base/applications/network/net/cmdUser.c Modified: trunk/reactos/base/applications/network/net/cmdUser.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/net/cmdUser.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/net/cmdUser.c [iso-8859-1] Thu Mar 31 21:48:43 2016 @@ -5,6 +5,7 @@ * PURPOSE: * * PROGRAMMERS: Eric Kohl + * Curtis Wilson */ #include "net.h" @@ -45,31 +46,37 @@ NetApiBufferFree(pServer); - Status = NetUserEnum(NULL, - 0, - 0, - (LPBYTE*)&pBuffer, - MAX_PREFERRED_LENGTH, - &dwRead, - &dwTotal, - &ResumeHandle); - if (Status != NERR_Success) - return Status; - - qsort(pBuffer, - dwRead, - sizeof(PUSER_INFO_0), - CompareInfo); - -// printf("dwRead: %lu dwTotal: %lu\n", dwRead, dwTotal); - for (i = 0; i < dwRead; i++) - { -// printf("%p\n", pBuffer[i].lgrpi0_name); - if (pBuffer[i].usri0_name) - PrintToConsole(L"%s\n", pBuffer[i].usri0_name); - } - - NetApiBufferFree(pBuffer); + do + { + Status = NetUserEnum(NULL, + 0, + 0, + (LPBYTE*)&pBuffer, + MAX_PREFERRED_LENGTH, + &dwRead, + &dwTotal, + &ResumeHandle); + if ((Status != NERR_Success) && (Status != ERROR_MORE_DATA)) + return Status; + + qsort(pBuffer, + dwRead, + sizeof(PUSER_INFO_0), + CompareInfo); + + for (i = 0; i < dwRead; i++) + { + if (pBuffer[i].usri0_name) + PrintToConsole(L"%s\n", pBuffer[i].usri0_name); + } + + if (pBuffer != NULL) + { + NetApiBufferFree(pBuffer); + pBuffer = NULL; + } + } + while (Status == ERROR_MORE_DATA); return NERR_Success; }
8 years, 8 months
1
0
0
0
[ekohl] 71086: [ADVAPI32] CredWriteDomainCredentialsW missing in advapi32.dll. Patch by Jared Smudde. CORE-11055 #resolve #comment Thanks a lot!
by ekohl@svn.reactos.org
Author: ekohl Date: Thu Mar 31 21:22:05 2016 New Revision: 71086 URL:
http://svn.reactos.org/svn/reactos?rev=71086&view=rev
Log: [ADVAPI32] CredWriteDomainCredentialsW missing in advapi32.dll. Patch by Jared Smudde. CORE-11055 #resolve #comment Thanks a lot! Modified: trunk/reactos/dll/win32/advapi32/advapi32.spec Modified: trunk/reactos/dll/win32/advapi32/advapi32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/advapi3…
============================================================================== --- trunk/reactos/dll/win32/advapi32/advapi32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/advapi32.spec [iso-8859-1] Thu Mar 31 21:22:05 2016 @@ -126,7 +126,7 @@ 126 stdcall CredUnmarshalCredentialW(wstr ptr ptr) 127 stdcall CredWriteA(ptr long) # CredWriteDomainCredentialsA -# CredWriteDomainCredentialsW +129 stub CredWriteDomainCredentialsW 130 stdcall CredWriteW(ptr long) 131 stub CredpConvertCredential 132 stub CredpConvertTargetInfo
8 years, 8 months
1
0
0
0
[ekohl] 71085: [NETAPI32] DsEnumerateDomainTrustsW missing in netapi32.dll. Patch by Jared Smudde. CORE-11056 #resolve #comment Thanks a lot!
by ekohl@svn.reactos.org
Author: ekohl Date: Thu Mar 31 21:12:46 2016 New Revision: 71085 URL:
http://svn.reactos.org/svn/reactos?rev=71085&view=rev
Log: [NETAPI32] DsEnumerateDomainTrustsW missing in netapi32.dll. Patch by Jared Smudde. CORE-11056 #resolve #comment Thanks a lot! Modified: trunk/reactos/dll/win32/netapi32/ds.c trunk/reactos/dll/win32/netapi32/netapi32.spec Modified: 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 [iso-8859-1] Thu Mar 31 21:12:46 2016 @@ -65,3 +65,23 @@ 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", 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] Thu Mar 31 21:12:46 2016 @@ -5,8 +5,8 @@ @ stub DsAddressToSiteNamesW @ stub DsDeregisterDnsHostRecordsA @ stub DsDeregisterDnsHostRecordsW -@ stub DsEnumerateDomainTrustsA -@ stub DsEnumerateDomainTrustsW +8 stdcall DsEnumerateDomainTrustsA(wstr long ptr ptr) +9 stdcall DsEnumerateDomainTrustsW(wstr long ptr ptr) @ stub DsGetDcCloseW @ stdcall DsGetDcNameA(str str ptr str long ptr) @ stdcall DsGetDcNameW(wstr wstr ptr wstr long ptr)
8 years, 8 months
1
0
0
0
[tfaber] 71084: [APPHELP] - Add apphelp.dll. Patch by Mark Jansen, partially based on work by Mislav Blažević and the Wine team. CORE-10367 #resolve
by tfaber@svn.reactos.org
Author: tfaber Date: Thu Mar 31 12:54:05 2016 New Revision: 71084 URL:
http://svn.reactos.org/svn/reactos?rev=71084&view=rev
Log: [APPHELP] - Add apphelp.dll. Patch by Mark Jansen, partially based on work by Mislav Blažević and the Wine team. CORE-10367 #resolve Added: trunk/reactos/dll/appcompat/ trunk/reactos/dll/appcompat/CMakeLists.txt (with props) trunk/reactos/dll/appcompat/apphelp/ trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt (with props) trunk/reactos/dll/appcompat/apphelp/apphelp.c (with props) trunk/reactos/dll/appcompat/apphelp/apphelp.h (with props) trunk/reactos/dll/appcompat/apphelp/apphelp.spec (with props) trunk/reactos/dll/appcompat/apphelp/layer.c (with props) trunk/reactos/dll/appcompat/apphelp/sdbapi.c (with props) Modified: trunk/reactos/dll/CMakeLists.txt Modified: trunk/reactos/dll/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/CMakeLists.txt?rev=710…
============================================================================== --- trunk/reactos/dll/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/CMakeLists.txt [iso-8859-1] Thu Mar 31 12:54:05 2016 @@ -1,5 +1,6 @@ add_subdirectory(3rdparty) +add_subdirectory(appcompat) add_subdirectory(cpl) add_subdirectory(directx) add_subdirectory(keyboard) Added: trunk/reactos/dll/appcompat/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/CMakeLists.t…
============================================================================== --- trunk/reactos/dll/appcompat/CMakeLists.txt (added) +++ trunk/reactos/dll/appcompat/CMakeLists.txt [iso-8859-1] Thu Mar 31 12:54:05 2016 @@ -0,0 +1,2 @@ + +add_subdirectory(apphelp) Propchange: trunk/reactos/dll/appcompat/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: 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 (added) +++ trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt [iso-8859-1] Thu Mar 31 12:54:05 2016 @@ -0,0 +1,20 @@ + +spec2def(apphelp.dll apphelp.spec ADD_IMPORTLIB) + +list(APPEND SOURCE + apphelp.c + sdbapi.c + layer.c + apphelp.spec + apphelp.h + ${CMAKE_CURRENT_BINARY_DIR}/apphelp_stubs.c) + +add_library(apphelp SHARED + ${SOURCE} + ${CMAKE_CURRENT_BINARY_DIR}/apphelp.def) + +set_module_type(apphelp win32dll) +target_link_libraries(apphelp wine) +#add_delay_importlibs(apphelp version imagehlp user32) +add_importlibs(apphelp msvcrt kernel32 ntdll) +add_cd_file(TARGET apphelp DESTINATION reactos/system32 FOR all) Propchange: trunk/reactos/dll/appcompat/apphelp/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/appcompat/apphelp/apphelp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/apph…
============================================================================== --- trunk/reactos/dll/appcompat/apphelp/apphelp.c (added) +++ trunk/reactos/dll/appcompat/apphelp/apphelp.c [iso-8859-1] Thu Mar 31 12:54:05 2016 @@ -0,0 +1,135 @@ +/* + * Copyright 2011 André Hentschel + * Copyright 2013 Mislav BlaževiÄ + * Copyright 2015 Mark Jansen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WIN32_NO_STATUS +#include "windef.h" +#include "winbase.h" +#include "winver.h" +#include "strsafe.h" +#include "apphelp.h" + +#include "wine/winternl.h" +#include "wine/debug.h" +#include "wine/unicode.h" + +/* from dpfilter.h */ +#define DPFLTR_APPCOMPAT_ID 123 + +#ifndef NT_SUCCESS +#define NT_SUCCESS(StatCode) ((NTSTATUS)(StatCode) >= 0) +#endif + +ULONG g_ShimDebugLevel = 0xffffffff; + +void ApphelppInitDebugLevel(void) +{ + UNICODE_STRING DebugKey, DebugValue; + NTSTATUS Status; + ULONG NewLevel = 0; + WCHAR Buffer[40]; + + RtlInitUnicodeString(&DebugKey, L"SHIM_DEBUG_LEVEL"); + DebugValue.MaximumLength = sizeof(Buffer); + DebugValue.Buffer = Buffer; + DebugValue.Length = 0; + + /* Hold the lock as short as possible. */ + RtlAcquirePebLock(); + Status = RtlQueryEnvironmentVariable_U(NULL, &DebugKey, &DebugValue); + RtlReleasePebLock(); + + if (NT_SUCCESS(Status)) + { + if (!NT_SUCCESS(RtlUnicodeStringToInteger(&DebugValue, 10, &NewLevel))) + NewLevel = 0; + } + g_ShimDebugLevel = NewLevel; +} + +BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) +{ + switch (reason) + { +#ifndef __REACTOS__ + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ +#endif + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls( hinst ); + SdbpHeapInit(); + break; + case DLL_PROCESS_DETACH: + SdbpHeapDeinit(); + break; + } + return TRUE; +} + + +/** + * Outputs diagnostic info. + * + * @param [in] Level The level to log this message with, choose any of [SHIM_ERR, + * SHIM_WARN, SHIM_INFO]. + * @param [in] FunctionName The function this log should be attributed to. + * @param [in] Format The format string. + * @param ... Variable arguments providing additional information. + * + * @return Success: TRUE Failure: FALSE. + */ +BOOL WINAPIV ShimDbgPrint(SHIM_LOG_LEVEL Level, PCSTR FunctionName, PCSTR Format, ...) +{ + char Buffer[512]; + va_list ArgList; + char* Current = Buffer, *LevelStr; + size_t Length = sizeof(Buffer); + + if (g_ShimDebugLevel == 0xffffffff) + ApphelppInitDebugLevel(); + + if (Level > g_ShimDebugLevel) + return FALSE; + + switch (Level) + { + case SHIM_ERR: + LevelStr = "Err "; + Level = DPFLTR_MASK | (1 << DPFLTR_ERROR_LEVEL); + break; + case SHIM_WARN: + LevelStr = "Warn"; + Level = DPFLTR_MASK | (1 << DPFLTR_WARNING_LEVEL); + break; + case SHIM_INFO: + LevelStr = "Info"; + Level = DPFLTR_MASK | (1 << DPFLTR_INFO_LEVEL); + break; + default: + LevelStr = "User"; + Level = DPFLTR_MASK | (1 << DPFLTR_INFO_LEVEL); + break; + } + StringCchPrintfExA(Current, Length, &Current, &Length, STRSAFE_NULL_ON_FAILURE, "[%s][%-20s] ", LevelStr, FunctionName); + va_start(ArgList, Format); + StringCchVPrintfExA(Current, Length, &Current, &Length, STRSAFE_NULL_ON_FAILURE, Format, ArgList); + va_end(ArgList); + return NT_SUCCESS(DbgPrintEx(DPFLTR_APPCOMPAT_ID, Level, "%s", Buffer)); +} + Propchange: trunk/reactos/dll/appcompat/apphelp/apphelp.c ------------------------------------------------------------------------------ svn:eol-style = native Added: 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 (added) +++ trunk/reactos/dll/appcompat/apphelp/apphelp.h [iso-8859-1] Thu Mar 31 12:54:05 2016 @@ -0,0 +1,71 @@ +/* + * Copyright 2013 Mislav BlaževiÄ + * Copyright 2015 Mark Jansen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef APPHELP_H +#define APPHELP_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum _SHIM_LOG_LEVEL { + SHIM_ERR = 1, + SHIM_WARN = 2, + SHIM_INFO = 3, +}SHIM_LOG_LEVEL; + +/* apphelp.c */ +BOOL WINAPIV ShimDbgPrint(SHIM_LOG_LEVEL Level, PCSTR FunctionName, PCSTR Format, ...); +extern ULONG g_ShimDebugLevel; + +#define SHIM_ERR(fmt, ...) do { if (g_ShimDebugLevel) ShimDbgPrint(SHIM_ERR, __FUNCTION__, fmt, ##__VA_ARGS__ ); } while (0) +#define SHIM_WARN(fmt, ...) do { if (g_ShimDebugLevel) ShimDbgPrint(SHIM_WARN, __FUNCTION__, fmt, ##__VA_ARGS__ ); } while (0) +#define SHIM_INFO(fmt, ...) do { if (g_ShimDebugLevel) ShimDbgPrint(SHIM_INFO, __FUNCTION__, fmt, ##__VA_ARGS__ ); } while (0) + + +/* sdbapi.c */ +void SdbpHeapInit(void); +void SdbpHeapDeinit(void); +#if SDBAPI_DEBUG_ALLOC + +LPVOID SdbpAlloc(SIZE_T size, int line, const char* file); +LPVOID SdbpReAlloc(LPVOID mem, SIZE_T size, int line, const char* file); +void SdbpFree(LPVOID mem, int line, const char* file); + +#define SdbAlloc(size) SdbpAlloc(size, __LINE__, __FILE__) +#define SdbReAlloc(mem, size) SdbpReAlloc(mem, size, __LINE__, __FILE__) +#define SdbFree(mem) SdbpFree(mem, __LINE__, __FILE__) + +#else + +LPVOID SdbpAlloc(SIZE_T size); +LPVOID SdbpReAlloc(LPVOID mem, SIZE_T size); +void SdbpFree(LPVOID mem); + +#define SdbAlloc(size) SdbpAlloc(size) +#define SdbReAlloc(mem, size) SdbpReAlloc(mem, size) +#define SdbFree(mem) SdbpFree(mem) + +#endif + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // APPHELP_H Propchange: trunk/reactos/dll/appcompat/apphelp/apphelp.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/appcompat/apphelp/apphelp.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/apph…
============================================================================== --- trunk/reactos/dll/appcompat/apphelp/apphelp.spec (added) +++ trunk/reactos/dll/appcompat/apphelp/apphelp.spec [iso-8859-1] Thu Mar 31 12:54:05 2016 @@ -0,0 +1,175 @@ +@ stdcall AllowPermLayer(wstr) +@ stub ApphelpCheckExe +@ stub ApphelpCheckInstallShieldPackage +@ stub ApphelpCheckMsiPackage +@ stub ApphelpCheckRunApp +@ stub ApphelpCheckRunAppEx +@ stub ApphelpCheckShellObject +@ stub ApphelpCreateAppcompatData +@ stub ApphelpFixMsiPackage +@ stub ApphelpFixMsiPackageExe +@ stub ApphelpFreeFileAttributes +@ stub ApphelpGetFileAttributes +@ stub ApphelpGetMsiProperties +@ stub ApphelpGetNTVDMInfo +@ stub ApphelpParseModuleData +@ stub ApphelpQueryModuleData +@ stub ApphelpQueryModuleDataEx +@ stub ApphelpUpdateCacheEntry +@ stub GetPermLayers +@ stub SdbAddLayerTagRefToQuery +@ stub SdbApphelpNotify +@ stub SdbApphelpNotifyExSdbApphelpNotifyEx +@ stub SdbBeginWriteListTag +@ stub SdbBuildCompatEnvVariables +@ stub SdbCloseApphelpInformation +@ stub SdbCloseDatabase +@ stub SdbCloseDatabaseWrite +@ stub SdbCloseLocalDatabase +@ stub SdbCommitIndexes +@ stub SdbCreateDatabase +@ stub SdbCreateHelpCenterURL +@ stub SdbCreateMsiTransformFile +@ stub SdbDeclareIndex +@ stub SdbDumpSearchPathPartCaches +@ stub SdbEnumMsiTransforms +@ stub SdbEndWriteListTag +@ stub SdbEscapeApphelpURL +@ stub SdbFindFirstDWORDIndexedTag +@ stub SdbFindFirstMsiPackage +@ stub SdbFindFirstMsiPackage_Str +@ stub SdbFindFirstNamedTag +@ stub SdbFindFirstStringIndexedTag +@ stub SdbFindFirstTag +@ stub SdbFindFirstTagRef +@ stub SdbFindNextDWORDIndexedTag +@ stub SdbFindNextMsiPackage +@ stub SdbFindNextStringIndexedTag +@ stub SdbFindNextTag +@ stub SdbFindNextTagRef +@ stub SdbFreeDatabaseInformation +@ stub SdbFreeFileAttributes +@ stub SdbFreeFileInfo +@ stub SdbFreeFlagInfo +@ stub SdbGetAppCompatDataSize +@ stub SdbGetAppPatchDir +@ stub SdbGetBinaryTagData +@ stub SdbGetDatabaseID +@ stub SdbGetDatabaseInformation +@ stub SdbGetDatabaseInformationByName +@ stub SdbGetDatabaseMatch +@ stub SdbGetDatabaseVersion +@ stub SdbGetDllPath +@ stub SdbGetEntryFlags +@ stub SdbGetFileAttributes +@ stub SdbGetFileImageType +@ stub SdbGetFileImageTypeEx +@ stub SdbGetFileInfo +@ stub SdbGetFirstChild +@ stub SdbGetIndex +@ stub SdbGetItemFromItemRef +@ stub SdbGetLayerName +@ stub SdbGetLayerTagRef +@ stub SdbGetLocalPDB +@ stub SdbGetMatchingExe +@ stub SdbGetMsiPackageInformation +@ stub SdbGetNamedLayer +@ stub SdbGetNextChild +@ stub SdbGetNthUserSdb +@ stdcall SdbGetPermLayerKeys(wstr wstr ptr long) +@ stub SdbGetShowDebugInfoOption +@ stub SdbGetShowDebugInfoOptionValue +@ stub SdbGetStandardDatabaseGUID +@ stub SdbGetStringTagPtr +@ stub SdbGetTagDataSize +@ stub SdbGetTagFromTagID +@ stub SdbGrabMatchingInfo +@ stub SdbGrabMatchingInfoEx +@ stub SdbGUIDFromString +@ stub SdbGUIDToString +@ stub SdbInitDatabase +@ stub SdbInitDatabaseEx +@ stub SdbIsNullGUID +@ stub SdbIsStandardDatabase +@ stub SdbIsTagrefFromLocalDB +@ stub SdbIsTagrefFromMainDB +@ stub SdbLoadString +@ stub SdbMakeIndexKeyFromString +@ stub SdbOpenApphelpDetailsDatabase +@ stub SdbOpenApphelpDetailsDatabaseSP +@ stub SdbOpenApphelpInformation +@ stub SdbOpenApphelpInformationByID +@ stub SdbOpenApphelpResourceFile +@ stub SdbOpenDatabase +@ stub SdbOpenDbFromGuid +@ stub SdbOpenLocalDatabase +@ stub SdbPackAppCompatData +@ stub SdbQueryApphelpInformation +@ stub SdbQueryBlockUpgrade +@ stub SdbQueryContext +@ stub SdbQueryData +@ stub SdbQueryDataEx +@ stub SdbQueryDataExTagID +@ stub SdbQueryFlagInfo +@ stub SdbQueryName +@ stub SdbQueryReinstallUpgrade +@ stub SdbReadApphelpData +@ stub SdbReadApphelpDetailsData +@ stub SdbReadBinaryTag +@ stub SdbReadBYTETag +@ stub SdbReadDWORDTag +@ stub SdbReadDWORDTagRef +@ stub SdbReadEntryInformation +@ stub SdbReadMsiTransformInfo +@ stub SdbReadPatchBits +@ stub SdbReadQWORDTag +@ stub SdbReadQWORDTagRef +@ stub SdbReadStringTag +@ stub SdbReadStringTagRef +@ stub SdbReadWORDTag +@ stub SdbReadWORDTagRef +@ stub SdbRegisterDatabase +@ stub SdbReleaseDatabase +@ stub SdbReleaseMatchingExe +@ stub SdbResolveDatabase +@ stub SdbSetApphelpDebugParameters +@ stub SdbSetEntryFlags +@ stub SdbSetImageType +@ stdcall SdbSetPermLayerKeys(wstr wstr long) +@ stub SdbShowApphelpDialog +@ stub SdbShowApphelpFromQuery +@ stub SdbStartIndexing +@ stub SdbStopIndexing +@ stub SdbStringDuplicate +@ stub SdbStringReplace +@ stub SdbStringReplaceArray +@ stub SdbTagIDToTagRef +@ stub SdbTagRefToTagID +@ stub SdbTagToString +@ stub SdbUnregisterDatabase +@ stub SdbWriteBinaryTag +@ stub SdbWriteBinaryTagFromFile +@ stub SdbWriteBYTETag +@ stub SdbWriteDWORDTag +@ stub SdbWriteNULLTag +@ stub SdbWriteQWORDTag +@ stub SdbWriteStringRefTag +@ stub SdbWriteStringTag +@ stub SdbWriteStringTagDirect +@ stub SdbWriteWORDTag +@ stub SE_DllLoaded +@ stub SE_DllUnloaded +@ stub SE_GetHookAPIs +@ stub SE_GetMaxShimCount +@ stub SE_GetProcAddressLoad +@ stub SE_GetShimCount +@ stub SE_InstallAfterInit +@ stub SE_InstallBeforeInit +@ stub SE_IsShimDll +@ stub SE_LdrEntryRemoved +@ stub SE_ProcessDying +@ stub SetPermLayers +@ cdecl ShimDbgPrint(long str str) +@ stub ShimDumpCache +@ stub ShimFlushCache +@ stdcall SetPermLayerState(wstr wstr long long long) Propchange: trunk/reactos/dll/appcompat/apphelp/apphelp.spec ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/appcompat/apphelp/layer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/laye…
============================================================================== --- trunk/reactos/dll/appcompat/apphelp/layer.c (added) +++ trunk/reactos/dll/appcompat/apphelp/layer.c [iso-8859-1] Thu Mar 31 12:54:05 2016 @@ -0,0 +1,554 @@ +/* + * Copyright 2015 Mark Jansen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WIN32_NO_STATUS +#include "windef.h" +#include "winbase.h" +#include "strsafe.h" +#include <ntndk.h> +#include "apphelp.h" + +#define GPLK_USER 1 +#define GPLK_MACHINE 2 +#define MAX_LAYER_LENGTH 256 +#define LAYER_APPLY_TO_SYSTEM_EXES 1 +#define LAYER_UNK_FLAG2 2 + +#ifndef REG_SZ +#define REG_SZ 1 +#endif + +#if defined(__GNUC__) +#define APPCOMPAT_LAYER_KEY (const WCHAR[]){'\\','S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s',' ','N','T','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','A','p','p','C','o','m','p','a','t','F','l','a','g','s','\\','L','a','y','e','r','s',0} +#define REGISTRY_MACHINE (const WCHAR[]){'\\','R','e','g','i','s','t','r','y','\\','M','a','c','h','i','n','e',0} +#define SPACE_ONLY (const WCHAR[]){' ',0} +#define DISALLOWED_LAYER_CHARS (const WCHAR[]){' ','#','!',0} +#define LAYER_SEPARATORS (const WCHAR[]){' ','\t',0} +#define SIGN_MEDIA_FMT (const WCHAR[]){'S','I','G','N','.','M','E','D','I','A','=','%','X',' ','%','s',0} + +#else +#define APPCOMPAT_LAYER_KEY L"\\Software\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Layers" +#define REGISTRY_MACHINE L"\\Registry\\Machine" +#define SPACE_ONLY L" " +#define DISALLOWED_LAYER_CHARS L" #!" +#define LAYER_SEPARATORS L" \t" +#define SIGN_MEDIA_FMT L"SIGN.MEDIA=%X %s" +#endif + + +typedef struct SDB_TMP_STR +{ + UNICODE_STRING Str; + WCHAR FixedBuffer[MAX_PATH]; +} SDB_TMP_STR, *PSDB_TMP_STR; + +void SdbpInitTempStr(PSDB_TMP_STR String) +{ + String->Str.Buffer = String->FixedBuffer; + String->Str.Length = 0; + String->Str.MaximumLength = sizeof(String->FixedBuffer); +} + +void SdbpFreeTempStr(PSDB_TMP_STR String) +{ + if (String->Str.Buffer != String->FixedBuffer) + { + SdbFree(String->Str.Buffer); + } +} + +void SdbpResizeTempStr(PSDB_TMP_STR String, WORD newLength) +{ + if (newLength > String->Str.MaximumLength) + { + SdbpFreeTempStr(String); + String->Str.MaximumLength = newLength * sizeof(WCHAR); + String->Str.Buffer = SdbAlloc(String->Str.MaximumLength); + String->Str.Length = 0; + } +} + +BOOL SdbpGetLongPathName(PCWSTR wszPath, PSDB_TMP_STR Result) +{ + DWORD max = Result->Str.MaximumLength / 2; + DWORD ret = GetLongPathNameW(wszPath, Result->Str.Buffer, max); + if (ret) + { + if (ret >= max) + { + SdbpResizeTempStr(Result, ret); + max = Result->Str.MaximumLength / 2; + ret = GetLongPathNameW(wszPath, Result->Str.Buffer, max); + } + if (ret && ret < max) + { + Result->Str.Length = ret * 2; + return TRUE; + } + } + SHIM_ERR("Failed to convert short path to long path error 0x%lx\n", GetLastError()); + return FALSE; +} + +BOOL SdbpIsPathOnRemovableMedia(PCWSTR Path) +{ + WCHAR tmp[] = { 'A',':','\\',0 }; + ULONG type; + if (!Path) + { + SHIM_ERR("Invalid argument\n"); + return FALSE; + } + switch (Path[1]) + { + case L':': + break; + case L'\\': + SHIM_INFO("\"%S\" is a network path.\n", Path); + return FALSE; + default: + SHIM_INFO("\"%S\" not a full path we can operate on.\n", Path); + return FALSE; + } + tmp[0] = Path[0]; + type = GetDriveTypeW(tmp); + + return type == DRIVE_REMOVABLE || type == DRIVE_CDROM; +} + +BOOL SdbpBuildSignMediaId(PSDB_TMP_STR LongPath) +{ + SDB_TMP_STR Scratch; + PWCHAR Ptr; + + SdbpInitTempStr(&Scratch); + SdbpResizeTempStr(&Scratch, LongPath->Str.Length / sizeof(WCHAR) + 30); + StringCbCopyNW(Scratch.Str.Buffer, Scratch.Str.MaximumLength, LongPath->Str.Buffer, LongPath->Str.Length); + Ptr = wcsrchr(LongPath->Str.Buffer, '\\'); + if (Ptr) + { + HANDLE FindHandle; + WIN32_FIND_DATAW FindData; + Ptr[1] = '*'; + Ptr[2] = '\0'; + FindHandle = FindFirstFileW(LongPath->Str.Buffer, &FindData); + if (FindHandle != INVALID_HANDLE_VALUE) + { + DWORD SignMedia = 0; + do + { + if (!(FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && FindData.nFileSizeLow) + SignMedia = SignMedia << 1 ^ FindData.nFileSizeLow; + } while (FindNextFileW(FindHandle, &FindData)); + + FindClose(FindHandle); + SdbpResizeTempStr(LongPath, (LongPath->Str.Length >> 1) + 20); + StringCbPrintfW(LongPath->Str.Buffer, LongPath->Str.MaximumLength, SIGN_MEDIA_FMT, SignMedia, Scratch.Str.Buffer + 3); + LongPath->Str.Length = wcslen(LongPath->Str.Buffer) * sizeof(WCHAR); + SdbpFreeTempStr(&Scratch); + return TRUE; + } + } + SdbpFreeTempStr(&Scratch); + SdbpFreeTempStr(LongPath); + return FALSE; +} + +BOOL SdbpResolvePath(PSDB_TMP_STR LongPath, PCWSTR wszPath) +{ + SdbpInitTempStr(LongPath); + if (!SdbpGetLongPathName(wszPath, LongPath)) + { + SdbpFreeTempStr(LongPath); + return FALSE; + } + if (SdbpIsPathOnRemovableMedia(LongPath->Str.Buffer)) + { + return SdbpBuildSignMediaId(LongPath); + } + return TRUE; +} + +static ACCESS_MASK g_QueryFlag = 0xffffffff; +ACCESS_MASK QueryFlag(void) +{ + if (g_QueryFlag == 0xffffffff) + { + ULONG_PTR wow64_ptr = 0; + NTSTATUS Status = NtQueryInformationProcess(NtCurrentProcess(), ProcessWow64Information, &wow64_ptr, sizeof(wow64_ptr), NULL); + g_QueryFlag = (NT_SUCCESS(Status) && wow64_ptr != 0) ? KEY_WOW64_64KEY : 0; + } + return g_QueryFlag; +} + +NTSTATUS SdbpOpenKey(PUNICODE_STRING FullPath, BOOL bMachine, ACCESS_MASK Access, PHANDLE KeyHandle) +{ + UNICODE_STRING BasePath; + const WCHAR* LayersKey = APPCOMPAT_LAYER_KEY; + OBJECT_ATTRIBUTES ObjectLayer = RTL_INIT_OBJECT_ATTRIBUTES(FullPath, OBJ_CASE_INSENSITIVE); + NTSTATUS Status; + FullPath->Buffer = NULL; + FullPath->Length = FullPath->MaximumLength = 0; + if (bMachine) + { + RtlInitUnicodeString(&BasePath, REGISTRY_MACHINE); + } + else + { + Status = RtlFormatCurrentUserKeyPath(&BasePath); + if (!NT_SUCCESS(Status)) + { + SHIM_ERR("Unable to aquire user registry key, Error: 0x%lx\n", Status); + return Status; + } + } + FullPath->MaximumLength = BasePath.Length + (wcslen(LayersKey) + 1) * sizeof(WCHAR); + FullPath->Buffer = SdbAlloc(FullPath->MaximumLength); + FullPath->Length = 0; + RtlAppendUnicodeStringToString(FullPath, &BasePath); + if (!bMachine) + RtlFreeUnicodeString(&BasePath); + RtlAppendUnicodeToString(FullPath, LayersKey); + + Status = NtOpenKey(KeyHandle, Access | QueryFlag(), &ObjectLayer); + if (!NT_SUCCESS(Status)) + { + SHIM_ERR("Unable to open Key \"%wZ\" Status 0x%lx\n", FullPath, Status); + SdbFree(FullPath->Buffer); + FullPath->Buffer = NULL; + } + return Status; +} + + +BOOL SdbpGetPermLayersInternal(PUNICODE_STRING FullPath, PWSTR pwszLayers, PDWORD pdwBytes, BOOL bMachine) +{ + UNICODE_STRING FullKey; + ULONG ValueBuffer[(MAX_LAYER_LENGTH * sizeof(WCHAR) + sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(ULONG) - 1) / sizeof(ULONG)]; + PKEY_VALUE_PARTIAL_INFORMATION PartialInfo = (PVOID)ValueBuffer; + ULONG Length = 0; + HANDLE KeyHandle; + NTSTATUS Status; + + Status = SdbpOpenKey(&FullKey, bMachine, KEY_QUERY_VALUE, &KeyHandle); + if (NT_SUCCESS(Status)) + { + Status = NtQueryValueKey(KeyHandle, FullPath, KeyValuePartialInformation, PartialInfo, sizeof(ValueBuffer), &Length); + if (NT_SUCCESS(Status)) + { + StringCbCopyNW(pwszLayers, *pdwBytes, (PCWSTR)PartialInfo->Data, PartialInfo->DataLength); + *pdwBytes = PartialInfo->DataLength; + } + else + { + SHIM_INFO("Failed to read value info from Key \"%wZ\" Status 0x%lx\n", &FullKey, Status); + } + NtClose(KeyHandle); + SdbFree(FullKey.Buffer); + } + return NT_SUCCESS(Status); +} + +BOOL SdbDeletePermLayerKeys(PCWSTR wszPath, BOOL bMachine) +{ + UNICODE_STRING FullKey; + SDB_TMP_STR LongPath; + HANDLE KeyHandle; + NTSTATUS Status; + + if (!SdbpResolvePath(&LongPath, wszPath)) + return FALSE; + + Status = SdbpOpenKey(&FullKey, bMachine, KEY_SET_VALUE, &KeyHandle); + if (NT_SUCCESS(Status)) + { + Status = NtDeleteValueKey(KeyHandle, &LongPath.Str); + if (!NT_SUCCESS(Status)) + { + SHIM_INFO("Failed to delete value from Key \"%wZ\" Status 0x%lx\n", &FullKey, Status); + /* This is what we want, so if the key didnt exist, we should not fail :) */ + if (Status == STATUS_OBJECT_NAME_NOT_FOUND) + Status = STATUS_SUCCESS; + } + NtClose(KeyHandle); + SdbFree(FullKey.Buffer); + } + SdbpFreeTempStr(&LongPath); + return NT_SUCCESS(Status); +} + +BOOL SdbpMatchLayer(PCWSTR start, PCWSTR end, PCWSTR compare) +{ + size_t len; + if (!end) + return !wcsicmp(start, compare); + len = end - start; + return wcslen(compare) == len && !_wcsnicmp(start, compare, len); +} + +BOOL SdbpAppendLayer(PWSTR target, DWORD len, PCWSTR layer, PCWSTR end) +{ + NTSTATUS Status = STATUS_SUCCESS; + if (target[0]) + Status = StringCbCatW(target, len, SPACE_ONLY); + + if (NT_SUCCESS(Status)) + { + if (end) + Status = StringCbCatNW(target, len, layer, (end - layer) * sizeof(WCHAR)); + else + Status = StringCbCatW(target, len, layer); + } + + return NT_SUCCESS(Status); +} + + +/** + * Determine if we allow permission layers to apply on this file. + * + * @param [in] Path Full pathname of the file, only the drive part is used. + * + * @return TRUE if we allow permission layer, FALSE if not. + */ +BOOL WINAPI AllowPermLayer(PCWSTR Path) +{ + WCHAR tmp[] = { 'A',':','\\', 0 }; + ULONG type; + if (!Path) + { + SHIM_ERR("Invalid argument\n"); + return FALSE; + } + switch (Path[1]) + { + case L':': + break; + case L'\\': + SHIM_INFO("\"%S\" is a network path.\n", Path); + return FALSE; + default: + SHIM_INFO("\"%S\" not a full path we can operate on.\n", Path); + return FALSE; + } + tmp[0] = Path[0]; + type = GetDriveTypeW(tmp); + if (type == DRIVE_REMOTE) + { + /* The logging here indicates that it does not like a CDROM or removable media, but it only + seems to bail out on a media that reports it is remote... + I have included correct logging, I doubt anyone would parse the logging, so this shouldnt break anything. */ + SHIM_INFO("\"%S\" is on a remote drive.\n", Path); + return FALSE; + } + return TRUE; +} + +/** + * Read the layers specified for the application. + * + * @param [in] wszPath Full pathname of the file. + * @param [out] pwszLayers On return, the layers set on the file. + * @param pdwBytes The size of the pwszLayers buffer in bytes, and on return the size of + * the data written (in bytes) + * @param [in] dwFlags The flags, [GPLK_USER | GPLK_MACHINE]. + * + * @return TRUE if it succeeds, FALSE if it fails. + */ +BOOL WINAPI SdbGetPermLayerKeys(PCWSTR wszPath, PWSTR pwszLayers, PDWORD pdwBytes, DWORD dwFlags) +{ + BOOL Result = FALSE; + SDB_TMP_STR LongPath; + DWORD dwBytes, dwTotal = 0; + if (!wszPath || !pdwBytes) + { + SHIM_ERR("NULL parameter passed for wszPath or pdwBytes.\n"); + return FALSE; + } + + if (!SdbpResolvePath(&LongPath, wszPath)) + return FALSE; + dwBytes = *pdwBytes; + if (dwFlags & GPLK_MACHINE) + { + if (SdbpGetPermLayersInternal(&LongPath.Str, pwszLayers, &dwBytes, TRUE)) + { + Result = TRUE; + dwTotal = dwBytes - sizeof(WCHAR); /* Compensate for the nullterm. */ + pwszLayers += dwTotal / sizeof(WCHAR); + dwBytes = *pdwBytes - dwBytes; + if (dwFlags & GPLK_USER) + { + *(pwszLayers++) = L' '; + *pwszLayers = L'\0'; + dwBytes -= sizeof(WCHAR); + dwTotal += sizeof(WCHAR); + } + } + } + if (dwFlags & GPLK_USER) + { + if (SdbpGetPermLayersInternal(&LongPath.Str, pwszLayers, &dwBytes, FALSE)) + { + Result = TRUE; + dwTotal += dwBytes - sizeof(WCHAR); /* Compensate for the nullterm. */ + } + else if (dwTotal > 0 && pwszLayers[-1] == L' ') + { + pwszLayers[-1] = '\0'; + dwTotal -= sizeof(WCHAR); + } + } + if (dwTotal) + dwTotal += sizeof(WCHAR); + *pdwBytes = dwTotal; + SdbpFreeTempStr(&LongPath); + return Result; +} + +/** + * Set or clear the Layer key. + * + * @param [in] wszPath Full pathname of the file. + * @param [in] wszLayers The layers to add (space separated), or an empty string / NULL to + * remove all layers. + * @param [in] bMachine TRUE to machine. + * + * @return TRUE if it succeeds, FALSE if it fails. + */ +BOOL WINAPI SdbSetPermLayerKeys(PCWSTR wszPath, PCWSTR wszLayers, BOOL bMachine) +{ + UNICODE_STRING FullKey; + SDB_TMP_STR LongPath; + HANDLE KeyHandle; + NTSTATUS Status; + + if (!wszLayers || *wszLayers == '\0') + return SdbDeletePermLayerKeys(wszPath, bMachine); + + if (!SdbpResolvePath(&LongPath, wszPath)) + return FALSE; + + Status = SdbpOpenKey(&FullKey, bMachine, KEY_SET_VALUE, &KeyHandle); + if (NT_SUCCESS(Status)) + { + Status = NtSetValueKey(KeyHandle, &LongPath.Str, 0, REG_SZ, (PVOID)wszLayers, (wcslen(wszLayers)+1) * sizeof(WCHAR)); + if (!NT_SUCCESS(Status)) + { + SHIM_INFO("Failed to write a value to Key \"%wZ\" Status 0x%lx\n", &FullKey, Status); + if (Status == STATUS_OBJECT_NAME_NOT_FOUND) + Status = STATUS_SUCCESS; + } + NtClose(KeyHandle); + SdbFree(FullKey.Buffer); + } + SdbpFreeTempStr(&LongPath); + return NT_SUCCESS(Status); +} + +/** + * Adds or removes a single layer entry. + * + * @param [in] wszPath Full pathname of the file. + * @param [in] wszLayer The layer to add or remove. + * @param [in] dwFlags Additional flags to add / remove [LAYER_APPLY_TO_SYSTEM_EXES | ???]. + * @param [in] bMachine When TRUE, the setting applies to all users, when FALSE only applies + * to the current user. + * @param [in] bEnable TRUE to enable, FALSE to disable a layer / flag specified. + * + * @return TRUE if it succeeds, FALSE if it fails. + */ +BOOL WINAPI SetPermLayerState(PCWSTR wszPath, PCWSTR wszLayer, DWORD dwFlags, BOOL bMachine, BOOL bEnable) +{ + WCHAR fullLayer[MAX_LAYER_LENGTH] = { 0 }; + WCHAR newLayer[MAX_LAYER_LENGTH] = { 0 }; + DWORD dwBytes = sizeof(fullLayer), dwWriteFlags = 0; + PWSTR start, p; + + if (!wszLayer) + { + SHIM_ERR("Invalid argument\n"); + return FALSE; + } + if (dwFlags & ~(LAYER_APPLY_TO_SYSTEM_EXES | LAYER_UNK_FLAG2)) + { + SHIM_ERR("Invalid flags\n"); + return FALSE; + } + p = wcspbrk(wszLayer, DISALLOWED_LAYER_CHARS); + if (p) + { + switch (*p) + { + case ' ': + SHIM_ERR("Only one layer can be passed in at a time.\n"); + return FALSE; + case '#': + case '!': + SHIM_ERR("Flags cannot be passed in with the layer name.\n"); + return FALSE; + } + } + if (!SdbGetPermLayerKeys(wszPath, fullLayer, &dwBytes, bMachine ? GPLK_MACHINE : GPLK_USER)) + { + fullLayer[0] = '\0'; + dwBytes = sizeof(fullLayer); + } + + start = fullLayer; + while (*start == '!' || *start == '#' || *start == ' ' || *start == '\t') + { + if (*start == '#') + dwWriteFlags |= LAYER_APPLY_TO_SYSTEM_EXES; + else if (*start == '!') + dwWriteFlags |= LAYER_UNK_FLAG2; + start++; + } + if (bEnable) + dwWriteFlags |= dwFlags; + else + dwWriteFlags &= ~dwFlags; + + p = newLayer; + if (dwWriteFlags & LAYER_UNK_FLAG2) + *(p++) = '!'; + if (dwWriteFlags & LAYER_APPLY_TO_SYSTEM_EXES) + *(p++) = '#'; + + do + { + while (*start == ' ' || *start == '\t') + ++start; + + if (*start == '\0') + break; + p = wcspbrk(start, LAYER_SEPARATORS); + if (!SdbpMatchLayer(start, p, wszLayer)) + { + SdbpAppendLayer(newLayer, sizeof(newLayer), start, p); + } + start = p + 1; + } while (p); + + if (bEnable && wszLayer[0]) + { + SdbpAppendLayer(newLayer, sizeof(newLayer), wszLayer, NULL); + } + + return SdbSetPermLayerKeys(wszPath, newLayer, bMachine); +} Propchange: trunk/reactos/dll/appcompat/apphelp/layer.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/appcompat/apphelp/sdbapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/apphelp/sdba…
============================================================================== --- trunk/reactos/dll/appcompat/apphelp/sdbapi.c (added) +++ trunk/reactos/dll/appcompat/apphelp/sdbapi.c [iso-8859-1] Thu Mar 31 12:54:05 2016 @@ -0,0 +1,204 @@ +/* + * Copyright 2011 André Hentschel + * Copyright 2013 Mislav BlaževiÄ + * Copyright 2015 Mark Jansen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WIN32_NO_STATUS +#include "windows.h" +#include "ntndk.h" +#include "strsafe.h" +#include "apphelp.h" + +#include "wine/unicode.h" + + +static HANDLE SdbpHeap(void); + +#if SDBAPI_DEBUG_ALLOC + +typedef struct SHIM_ALLOC_ENTRY +{ + PVOID Address; + SIZE_T Size; + int Line; + const char* File; + PVOID Next; + PVOID Prev; +} SHIM_ALLOC_ENTRY, *PSHIM_ALLOC_ENTRY; + + +static RTL_AVL_TABLE g_SdbpAllocationTable; + + +static RTL_GENERIC_COMPARE_RESULTS +NTAPI ShimAllocCompareRoutine(_In_ PRTL_AVL_TABLE Table, _In_ PVOID FirstStruct, _In_ PVOID SecondStruct) +{ + PVOID First = ((PSHIM_ALLOC_ENTRY)FirstStruct)->Address; + PVOID Second = ((PSHIM_ALLOC_ENTRY)SecondStruct)->Address; + + if (First < Second) + return GenericLessThan; + else if (First == Second) + return GenericEqual; + return GenericGreaterThan; +} + +static PVOID NTAPI ShimAllocAllocateRoutine(_In_ PRTL_AVL_TABLE Table, _In_ CLONG ByteSize) +{ + return HeapAlloc(SdbpHeap(), HEAP_ZERO_MEMORY, ByteSize); +} + +static VOID NTAPI ShimAllocFreeRoutine(_In_ PRTL_AVL_TABLE Table, _In_ PVOID Buffer) +{ + HeapFree(SdbpHeap(), 0, Buffer); +} + +static void SdbpInsertAllocation(PVOID address, SIZE_T size, int line, const char* file) +{ + SHIM_ALLOC_ENTRY Entry = {0}; + + Entry.Address = address; + Entry.Size = size; + Entry.Line = line; + Entry.File = file; + RtlInsertElementGenericTableAvl(&g_SdbpAllocationTable, &Entry, sizeof(Entry), NULL); +} + +static void SdbpUpdateAllocation(PVOID address, PVOID newaddress, SIZE_T size, int line, const char* file) +{ + SHIM_ALLOC_ENTRY Lookup = {0}; + PSHIM_ALLOC_ENTRY Entry; + Lookup.Address = address; + Entry = RtlLookupElementGenericTableAvl(&g_SdbpAllocationTable, &Lookup); + + if (address == newaddress) + { + Entry->Size = size; + } + else + { + Lookup.Address = newaddress; + Lookup.Size = size; + Lookup.Line = line; + Lookup.File = file; + Lookup.Prev = address; + RtlInsertElementGenericTableAvl(&g_SdbpAllocationTable, &Lookup, sizeof(Lookup), NULL); + Entry->Next = newaddress; + } +} + +static void SdbpRemoveAllocation(PVOID address, int line, const char* file) +{ + char buf[512]; + SHIM_ALLOC_ENTRY Lookup = {0}; + PSHIM_ALLOC_ENTRY Entry; + + sprintf(buf, "\r\n===============\r\n%s(%d): SdbpFree called, tracing alloc:\r\n", file, line); + OutputDebugStringA(buf); + + Lookup.Address = address; + while (Lookup.Address) + { + Entry = RtlLookupElementGenericTableAvl(&g_SdbpAllocationTable, &Lookup); + if (Entry) + { + Lookup = *Entry; + RtlDeleteElementGenericTableAvl(&g_SdbpAllocationTable, Entry); + + sprintf(buf, " > %s(%d): %s%sAlloc( %d ) ==> %p\r\n", Lookup.File, Lookup.Line, + Lookup.Next ? "Invalidated " : "", Lookup.Prev ? "Re" : "", Lookup.Size, Lookup.Address); + OutputDebugStringA(buf); + Lookup.Address = Lookup.Prev; + } + else + { + Lookup.Address = NULL; + } + } + sprintf(buf, "\r\n===============\r\n"); + OutputDebugStringA(buf); +} + +#endif + +static HANDLE g_Heap; +void SdbpHeapInit(void) +{ +#if SDBAPI_DEBUG_ALLOC + RtlInitializeGenericTableAvl(&g_SdbpAllocationTable, ShimAllocCompareRoutine, + ShimAllocAllocateRoutine, ShimAllocFreeRoutine, NULL); +#endif + g_Heap = HeapCreate(0, 0x10000, 0); +} + +void SdbpHeapDeinit(void) +{ +#if SDBAPI_DEBUG_ALLOC + if (g_SdbpAllocationTable.NumberGenericTableElements != 0) + __debugbreak(); +#endif + HeapDestroy(g_Heap); +} + +DWORD SdbpStrlen(PCWSTR string) +{ + return (lstrlenW(string) + 1) * sizeof(WCHAR); +} + +static HANDLE SdbpHeap(void) +{ + return g_Heap; +} + +LPVOID SdbpAlloc(SIZE_T size +#if SDBAPI_DEBUG_ALLOC + , int line, const char* file +#endif + ) +{ + LPVOID mem = HeapAlloc(SdbpHeap(), HEAP_ZERO_MEMORY, size); +#if SDBAPI_DEBUG_ALLOC + SdbpInsertAllocation(mem, size, line, file); +#endif + return mem; +} + +LPVOID SdbpReAlloc(LPVOID mem, SIZE_T size +#if SDBAPI_DEBUG_ALLOC + , int line, const char* file +#endif + ) +{ + LPVOID newmem = HeapReAlloc(SdbpHeap(), HEAP_ZERO_MEMORY, mem, size); +#if SDBAPI_DEBUG_ALLOC + SdbpUpdateAllocation(mem, newmem, size, line, file); +#endif + return newmem; +} + +void SdbpFree(LPVOID mem +#if SDBAPI_DEBUG_ALLOC + , int line, const char* file +#endif + ) +{ +#if SDBAPI_DEBUG_ALLOC + SdbpRemoveAllocation(mem, line, file); +#endif + HeapFree(SdbpHeap(), 0, mem); +} Propchange: trunk/reactos/dll/appcompat/apphelp/sdbapi.c ------------------------------------------------------------------------------ svn:eol-style = native
8 years, 8 months
1
0
0
0
[tfaber] 71083: [NTOS:PNP] - Fix indentation in PnpRootPdoPnpControl. Also avoid unnecessary casts. No functional changes.
by tfaber@svn.reactos.org
Author: tfaber Date: Thu Mar 31 07:54:52 2016 New Revision: 71083 URL:
http://svn.reactos.org/svn/reactos?rev=71083&view=rev
Log: [NTOS:PNP] - Fix indentation in PnpRootPdoPnpControl. Also avoid unnecessary casts. No functional changes. Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnproot…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c [iso-8859-1] Thu Mar 31 07:54:52 2016 @@ -1110,84 +1110,84 @@ IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { - PPNPROOT_PDO_DEVICE_EXTENSION DeviceExtension; - PPNPROOT_FDO_DEVICE_EXTENSION FdoDeviceExtension; - PIO_STACK_LOCATION IrpSp; - NTSTATUS Status; - - DeviceExtension = (PPNPROOT_PDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - FdoDeviceExtension = (PPNPROOT_FDO_DEVICE_EXTENSION)PnpRootDeviceObject->DeviceExtension; - Status = Irp->IoStatus.Status; - IrpSp = IoGetCurrentIrpStackLocation(Irp); - - switch (IrpSp->MinorFunction) - { - case IRP_MN_START_DEVICE: /* 0x00 */ - DPRINT("IRP_MJ_PNP / IRP_MN_START_DEVICE\n"); - Status = STATUS_SUCCESS; - break; - - case IRP_MN_QUERY_DEVICE_RELATIONS: /* 0x07 */ - Status = PdoQueryDeviceRelations(DeviceObject, Irp, IrpSp); - break; - - case IRP_MN_QUERY_CAPABILITIES: /* 0x09 */ - DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_CAPABILITIES\n"); - Status = PdoQueryCapabilities(DeviceObject, Irp, IrpSp); - break; - - case IRP_MN_QUERY_RESOURCES: /* 0x0a */ - DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_RESOURCES\n"); - Status = PdoQueryResources(DeviceObject, Irp, IrpSp); - break; - - case IRP_MN_QUERY_RESOURCE_REQUIREMENTS: /* 0x0b */ - DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_RESOURCE_REQUIREMENTS\n"); - Status = PdoQueryResourceRequirements(DeviceObject, Irp, IrpSp); - break; - - case IRP_MN_QUERY_DEVICE_TEXT: /* 0x0c */ - DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_RESOURCE_REQUIREMENTS\n"); - Status = PdoQueryDeviceText(DeviceObject, Irp, IrpSp); - break; - - case IRP_MN_FILTER_RESOURCE_REQUIREMENTS: /* 0x0d */ - DPRINT("IRP_MJ_PNP / IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n"); - break; - - case IRP_MN_REMOVE_DEVICE: - /* Remove the device from the device list and decrement the device count*/ - KeAcquireGuardedMutex(&FdoDeviceExtension->DeviceListLock); - RemoveEntryList(&DeviceExtension->DeviceInfo->ListEntry); - FdoDeviceExtension->DeviceListCount--; - KeReleaseGuardedMutex(&FdoDeviceExtension->DeviceListLock); - - /* Free some strings we created */ - RtlFreeUnicodeString(&DeviceExtension->DeviceInfo->DeviceDescription); - RtlFreeUnicodeString(&DeviceExtension->DeviceInfo->DeviceID); - RtlFreeUnicodeString(&DeviceExtension->DeviceInfo->InstanceID); - - /* Free the resource requirements list */ - if (DeviceExtension->DeviceInfo->ResourceRequirementsList != NULL) + PPNPROOT_PDO_DEVICE_EXTENSION DeviceExtension; + PPNPROOT_FDO_DEVICE_EXTENSION FdoDeviceExtension; + PIO_STACK_LOCATION IrpSp; + NTSTATUS Status; + + DeviceExtension = DeviceObject->DeviceExtension; + FdoDeviceExtension = PnpRootDeviceObject->DeviceExtension; + Status = Irp->IoStatus.Status; + IrpSp = IoGetCurrentIrpStackLocation(Irp); + + switch (IrpSp->MinorFunction) + { + case IRP_MN_START_DEVICE: /* 0x00 */ + DPRINT("IRP_MJ_PNP / IRP_MN_START_DEVICE\n"); + Status = STATUS_SUCCESS; + break; + + case IRP_MN_QUERY_DEVICE_RELATIONS: /* 0x07 */ + Status = PdoQueryDeviceRelations(DeviceObject, Irp, IrpSp); + break; + + case IRP_MN_QUERY_CAPABILITIES: /* 0x09 */ + DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_CAPABILITIES\n"); + Status = PdoQueryCapabilities(DeviceObject, Irp, IrpSp); + break; + + case IRP_MN_QUERY_RESOURCES: /* 0x0a */ + DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_RESOURCES\n"); + Status = PdoQueryResources(DeviceObject, Irp, IrpSp); + break; + + case IRP_MN_QUERY_RESOURCE_REQUIREMENTS: /* 0x0b */ + DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_RESOURCE_REQUIREMENTS\n"); + Status = PdoQueryResourceRequirements(DeviceObject, Irp, IrpSp); + break; + + case IRP_MN_QUERY_DEVICE_TEXT: /* 0x0c */ + DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_RESOURCE_REQUIREMENTS\n"); + Status = PdoQueryDeviceText(DeviceObject, Irp, IrpSp); + break; + + case IRP_MN_FILTER_RESOURCE_REQUIREMENTS: /* 0x0d */ + DPRINT("IRP_MJ_PNP / IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n"); + break; + + case IRP_MN_REMOVE_DEVICE: + /* Remove the device from the device list and decrement the device count*/ + KeAcquireGuardedMutex(&FdoDeviceExtension->DeviceListLock); + RemoveEntryList(&DeviceExtension->DeviceInfo->ListEntry); + FdoDeviceExtension->DeviceListCount--; + KeReleaseGuardedMutex(&FdoDeviceExtension->DeviceListLock); + + /* Free some strings we created */ + RtlFreeUnicodeString(&DeviceExtension->DeviceInfo->DeviceDescription); + RtlFreeUnicodeString(&DeviceExtension->DeviceInfo->DeviceID); + RtlFreeUnicodeString(&DeviceExtension->DeviceInfo->InstanceID); + + /* Free the resource requirements list */ + if (DeviceExtension->DeviceInfo->ResourceRequirementsList != NULL) ExFreePool(DeviceExtension->DeviceInfo->ResourceRequirementsList); - /* Free the boot resources list */ - if (DeviceExtension->DeviceInfo->ResourceList != NULL) + /* Free the boot resources list */ + if (DeviceExtension->DeviceInfo->ResourceList != NULL) ExFreePool(DeviceExtension->DeviceInfo->ResourceList); - /* Free the device info */ - ExFreePool(DeviceExtension->DeviceInfo); - - /* Finally, delete the device object */ - IoDeleteDevice(DeviceObject); - - /* Return success */ - Status = STATUS_SUCCESS; - break; - - case IRP_MN_QUERY_ID: /* 0x13 */ - Status = PdoQueryId(DeviceObject, Irp, IrpSp); - break; + /* Free the device info */ + ExFreePool(DeviceExtension->DeviceInfo); + + /* Finally, delete the device object */ + IoDeleteDevice(DeviceObject); + + /* Return success */ + Status = STATUS_SUCCESS; + break; + + case IRP_MN_QUERY_ID: /* 0x13 */ + Status = PdoQueryId(DeviceObject, Irp, IrpSp); + break; case IRP_MN_QUERY_BUS_INFORMATION: /* 0x15 */ DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_BUS_INFORMATION\n");
8 years, 8 months
1
0
0
0
[tfaber] 71082: [NTOS:PNP] - Avoid INVALID_HANDLE_VALUE, it's not meant for the kernel.
by tfaber@svn.reactos.org
Author: tfaber Date: Thu Mar 31 07:51:08 2016 New Revision: 71082 URL:
http://svn.reactos.org/svn/reactos?rev=71082&view=rev
Log: [NTOS:PNP] - Avoid INVALID_HANDLE_VALUE, it's not meant for the kernel. Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Thu Mar 31 07:51:08 2016 @@ -781,7 +781,7 @@ PDEVICE_NODE DeviceNode) { NTSTATUS Status; - HANDLE InstanceHandle = INVALID_HANDLE_VALUE, ControlHandle = INVALID_HANDLE_VALUE; + HANDLE InstanceHandle = NULL, ControlHandle = NULL; UNICODE_STRING KeyName; OBJECT_ATTRIBUTES ObjectAttributes; @@ -817,10 +817,10 @@ // } ByeBye: - if (ControlHandle != INVALID_HANDLE_VALUE) + if (ControlHandle != NULL) ZwClose(ControlHandle); - if (InstanceHandle != INVALID_HANDLE_VALUE) + if (InstanceHandle != NULL) ZwClose(InstanceHandle); return Status; Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnproot…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c [iso-8859-1] Thu Mar 31 07:51:08 2016 @@ -198,7 +198,7 @@ UNICODE_STRING PathSep = RTL_CONSTANT_STRING(L"\\"); ULONG NextInstance; UNICODE_STRING EnumKeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\" REGSTR_PATH_SYSTEMENUM); - HANDLE EnumHandle, DeviceKeyHandle = INVALID_HANDLE_VALUE, InstanceKeyHandle; + HANDLE EnumHandle, DeviceKeyHandle = NULL, InstanceKeyHandle; RTL_QUERY_REGISTRY_TABLE QueryTable[2]; OBJECT_ATTRIBUTES ObjectAttributes; @@ -377,7 +377,7 @@ RtlFreeUnicodeString(&Device->InstanceID); ExFreePoolWithTag(Device, TAG_PNP_ROOT); } - if (DeviceKeyHandle != INVALID_HANDLE_VALUE) + if (DeviceKeyHandle != NULL) ObCloseHandle(DeviceKeyHandle, KernelMode); return Status; } @@ -447,9 +447,9 @@ WCHAR DevicePath[MAX_PATH + 1]; RTL_QUERY_REGISTRY_TABLE QueryTable[4]; PPNPROOT_DEVICE Device = NULL; - HANDLE KeyHandle = INVALID_HANDLE_VALUE; - HANDLE SubKeyHandle = INVALID_HANDLE_VALUE; - HANDLE DeviceKeyHandle = INVALID_HANDLE_VALUE; + HANDLE KeyHandle = NULL; + HANDLE SubKeyHandle = NULL; + HANDLE DeviceKeyHandle = NULL; ULONG BufferSize; ULONG ResultSize; ULONG Index1, Index2; @@ -627,7 +627,7 @@ } ZwClose(DeviceKeyHandle); - DeviceKeyHandle = INVALID_HANDLE_VALUE; + DeviceKeyHandle = NULL; /* Insert the newly created device into the list */ InsertTailList( @@ -641,7 +641,7 @@ } ZwClose(SubKeyHandle); - SubKeyHandle = INVALID_HANDLE_VALUE; + SubKeyHandle = NULL; Index1++; } @@ -652,11 +652,11 @@ /* FIXME */ ExFreePoolWithTag(Device, TAG_PNP_ROOT); } - if (DeviceKeyHandle != INVALID_HANDLE_VALUE) + if (DeviceKeyHandle != NULL) ZwClose(DeviceKeyHandle); - if (SubKeyHandle != INVALID_HANDLE_VALUE) + if (SubKeyHandle != NULL) ZwClose(SubKeyHandle); - if (KeyHandle != INVALID_HANDLE_VALUE) + if (KeyHandle != NULL) ZwClose(KeyHandle); if (KeyInfo) ExFreePoolWithTag(KeyInfo, TAG_PNP_ROOT);
8 years, 8 months
1
0
0
0
[tfaber] 71081: [SHELL32] - Correctly handle desktop pidls in CDesktopFolder::CompareIDs. Based on a patch by Sylvain Deverre. CORE-10747 CORE-10801 #resolve
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Mar 30 11:35:22 2016 New Revision: 71081 URL:
http://svn.reactos.org/svn/reactos?rev=71081&view=rev
Log: [SHELL32] - Correctly handle desktop pidls in CDesktopFolder::CompareIDs. Based on a patch by Sylvain Deverre. CORE-10747 CORE-10801 #resolve Modified: trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp Modified: trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp [iso-8859-1] Wed Mar 30 11:35:22 2016 @@ -463,11 +463,18 @@ */ HRESULT WINAPI CDesktopFolder::CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2) { + bool bIsDesktopFolder1, bIsDesktopFolder2; + if (!pidl1 || !pidl2) { ERR("Got null pidl pointer (%Ix %p %p)!\n", lParam, pidl1, pidl2); return E_INVALIDARG; } + + bIsDesktopFolder1 = _ILIsDesktop(pidl1); + bIsDesktopFolder2 = _ILIsDesktop(pidl2); + if (bIsDesktopFolder1 || bIsDesktopFolder2) + return MAKE_COMPARE_HRESULT(bIsDesktopFolder1 - bIsDesktopFolder2); if (_ILIsSpecialFolder(pidl1) || _ILIsSpecialFolder(pidl2)) return SHELL32_CompareGuidItems(this, lParam, pidl1, pidl2);
8 years, 8 months
1
0
0
0
[tfaber] 71080: [SHELL32] - Correctly handle NULL pidls in CDesktopFolder::CompareIDs and CDrivesFolder::CompareIDs. Based on a patch by Sylvain Deverre. CORE-10745 #resolve CORE-10747
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Mar 30 11:11:37 2016 New Revision: 71080 URL:
http://svn.reactos.org/svn/reactos?rev=71080&view=rev
Log: [SHELL32] - Correctly handle NULL pidls in CDesktopFolder::CompareIDs and CDrivesFolder::CompareIDs. Based on a patch by Sylvain Deverre. CORE-10745 #resolve CORE-10747 Modified: trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp Modified: trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp [iso-8859-1] Wed Mar 30 11:11:37 2016 @@ -463,6 +463,12 @@ */ HRESULT WINAPI CDesktopFolder::CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2) { + if (!pidl1 || !pidl2) + { + ERR("Got null pidl pointer (%Ix %p %p)!\n", lParam, pidl1, pidl2); + return E_INVALIDARG; + } + if (_ILIsSpecialFolder(pidl1) || _ILIsSpecialFolder(pidl2)) return SHELL32_CompareGuidItems(this, lParam, pidl1, pidl2); Modified: trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp [iso-8859-1] Wed Mar 30 11:11:37 2016 @@ -298,6 +298,12 @@ HRESULT WINAPI CDrivesFolder::CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2) { + if (!pidl1 || !pidl2) + { + ERR("Got null pidl pointer (%Ix %p %p)!\n", lParam, pidl1, pidl2); + return E_INVALIDARG; + } + if (_ILIsSpecialFolder(pidl1) || _ILIsSpecialFolder(pidl2)) return SHELL32_CompareGuidItems(this, lParam, pidl1, pidl2);
8 years, 8 months
1
0
0
0
[tfaber] 71079: [SHELL32] - Treat psfgaoOut as optional in SHParseDisplayName. Patch by Sylvain Deverre. CORE-10747
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Mar 30 09:35:04 2016 New Revision: 71079 URL:
http://svn.reactos.org/svn/reactos?rev=71079&view=rev
Log: [SHELL32] - Treat psfgaoOut as optional in SHParseDisplayName. Patch by Sylvain Deverre. CORE-10747 Modified: trunk/reactos/dll/win32/shell32/wine/pidl.c Modified: trunk/reactos/dll/win32/shell32/wine/pidl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/wine/pid…
============================================================================== --- trunk/reactos/dll/win32/shell32/wine/pidl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/wine/pidl.c [iso-8859-1] Wed Mar 30 09:35:04 2016 @@ -1338,7 +1338,7 @@ if(!ppidl) return E_INVALIDARG; - if (!pszName || !psfgaoOut) + if (!pszName) { *ppidl = NULL; return E_INVALIDARG; @@ -1356,9 +1356,13 @@ IShellFolder_Release(psfDesktop); if (SUCCEEDED(hr)) - *psfgaoOut = dwAttr; + { + if (psfgaoOut) *psfgaoOut = dwAttr; + } else + { *ppidl = NULL; + } return hr; }
8 years, 8 months
1
0
0
0
[akhaldi] 71078: [IERNONCE] Turkish translation by Erdem Ersoy. CORE-11042
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Mar 29 09:53:44 2016 New Revision: 71078 URL:
http://svn.reactos.org/svn/reactos?rev=71078&view=rev
Log: [IERNONCE] Turkish translation by Erdem Ersoy. CORE-11042 Added: trunk/reactos/dll/win32/iernonce/lang/tr-TR.rc (with props) Modified: trunk/reactos/dll/win32/iernonce/iernonce.rc Modified: trunk/reactos/dll/win32/iernonce/iernonce.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iernonce/iernonc…
============================================================================== --- trunk/reactos/dll/win32/iernonce/iernonce.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/iernonce/iernonce.rc [iso-8859-1] Tue Mar 29 09:53:44 2016 @@ -17,3 +17,6 @@ #ifdef LANGUAGE_EN_US #include "lang/en-US.rc" #endif +#ifdef LANGUAGE_TR_TR + #include "lang/tr-TR.rc" +#endif Added: trunk/reactos/dll/win32/iernonce/lang/tr-TR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iernonce/lang/tr…
============================================================================== --- trunk/reactos/dll/win32/iernonce/lang/tr-TR.rc (added) +++ trunk/reactos/dll/win32/iernonce/lang/tr-TR.rc [iso-8859-1] Tue Mar 29 09:53:44 2016 @@ -0,0 +1,29 @@ +/* TRANSLATOR: 2016 Erdem Ersoy (eersoy93) (erdemersoy(a)live.com) */ + +LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT + +STRINGTABLE +BEGIN + IDS_INVALIDFORMAT "%1 RunEx veyâ RunOnceEx giriÅinin biçimi geçersiz oldu. WinMain() deÄiÅkenlerini desteklemek için iÅleçten ve iÅleç adından sonra dikey bir çubuk (|) gereklidir." + IDS_LOADERROR "%1 yüklemede bir sorun oluÅtu. Kütük, kurulu olmayabilir ya da bozulmuÅ olabilir." + IDS_CALLERROR "%2 içinde %1 iÅlecini çaÄırırken bir yanlıÅlık ya da ayrıklık oluÅtu." + IDS_INCORRECTFORMAT "AÅaÄıdaki RunEx ya da RunOnceEx komutunun biçimi yanlıÅ: %1. Kabuk çalıÅtırma komutu || ile baÅlamalıdır." + IDS_NOEXPORT "Ä°Ålecin, var olmadıÄından ya da verilmediÄinden dolayı %2 kütüÄü içindeki %1 iÅleci çaÄrılamaz." + IDS_EXECUTEERROR "%1 çalıÅtırılırken bir yanlıÅlık ya da ayrıklık oluÅtu." + IDS_NOFUNCTION "%2 kütüÄü içindeki %1 iÅleci bulunamaz." + IDS_NODEPENDENCY "%1 baÄımlılık kütüÄü yüklenemez." + IDS_SETUPERROR "%1 kurulurken bir yanlıÅlık oluÅtu. Bu yanlıÅlık kayıt edildi, kurulum sürecek." + IDS_INCOMPLETE "Bir uygulamanın önceki kurulumu bitirilmemiÅ.\n\nKurulumu bitirmek için bir Yönetici hesâbıyla oturum açınız." + IDS_SETUP "ReactOS Kur" + IDS_SERVICEERROR "Birtakım hizmetler baÅlatılamadı. Kur, hizmetleri baÅlatmak için dizgenizin yeniden baÅlatılmasını gerektiriyor." +END + +IDD_DIALOG DIALOGEX 0, 0, 206, 166 +STYLE DS_MODALFRAME | DS_NOIDLEMSG | WS_POPUP | WS_VISIBLE | WS_CAPTION +CAPTION "ReactOS Kur" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "ReactOS Åimdi aÅaÄıdaki öÄeleri kuruyor:", -1, 36, 13, 163, 11 + LISTBOX IDC_LB_ITEMS, 36, 32, 163, 127, LBS_NOTIFY | LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_VSCROLL | WS_TABSTOP + ICON IDI_ICON, -1, 7, 7, 20, 20 +END Propchange: trunk/reactos/dll/win32/iernonce/lang/tr-TR.rc ------------------------------------------------------------------------------ svn:eol-style = native
8 years, 9 months
1
0
0
0
← Newer
1
2
3
4
...
27
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
23
24
25
26
27
Results per page:
10
25
50
100
200