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
May 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
18 participants
260 discussions
Start a n
N
ew thread
[mjansen] 71439: [APPHELP] Begin shimlib implementation. CORE-11329 Implement some macro's and functions that help when registering shims. These are all written in C, so that wine can use the shim ...
by mjansen@svn.reactos.org
Author: mjansen Date: Sat May 28 16:42:57 2016 New Revision: 71439 URL:
http://svn.reactos.org/svn/reactos?rev=71439&view=rev
Log: [APPHELP] Begin shimlib implementation. CORE-11329 Implement some macro's and functions that help when registering shims. These are all written in C, so that wine can use the shim libraries as well. Added: trunk/reactos/dll/appcompat/shims/ trunk/reactos/dll/appcompat/shims/CMakeLists.txt (with props) trunk/reactos/dll/appcompat/shims/shimlib/ trunk/reactos/dll/appcompat/shims/shimlib/CMakeLists.txt (with props) trunk/reactos/dll/appcompat/shims/shimlib/implement_shim.inl (with props) trunk/reactos/dll/appcompat/shims/shimlib/setup_shim.inl (with props) trunk/reactos/dll/appcompat/shims/shimlib/shimlib.c (with props) trunk/reactos/dll/appcompat/shims/shimlib/shimlib.h (with props) Modified: trunk/reactos/dll/appcompat/CMakeLists.txt Modified: trunk/reactos/dll/appcompat/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/CMakeLists.t…
============================================================================== --- trunk/reactos/dll/appcompat/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/appcompat/CMakeLists.txt [iso-8859-1] Sat May 28 16:42:57 2016 @@ -1,2 +1,5 @@ +project(appcompat) +set(SHIMLIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/shims/shimlib) add_subdirectory(apphelp) +add_subdirectory(shims) Added: trunk/reactos/dll/appcompat/shims/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/shims/CMakeL…
============================================================================== --- trunk/reactos/dll/appcompat/shims/CMakeLists.txt (added) +++ trunk/reactos/dll/appcompat/shims/CMakeLists.txt [iso-8859-1] Sat May 28 16:42:57 2016 @@ -0,0 +1,3 @@ + +add_subdirectory(shimlib) + Propchange: trunk/reactos/dll/appcompat/shims/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/appcompat/shims/shimlib/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/shims/shimli…
============================================================================== --- trunk/reactos/dll/appcompat/shims/shimlib/CMakeLists.txt (added) +++ trunk/reactos/dll/appcompat/shims/shimlib/CMakeLists.txt [iso-8859-1] Sat May 28 16:42:57 2016 @@ -0,0 +1,7 @@ + +list(APPEND SOURCE + shimlib.c + shimlib.h) + +add_library(shimlib ${SOURCE}) +add_dependencies(shimlib xdk) Propchange: trunk/reactos/dll/appcompat/shims/shimlib/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/appcompat/shims/shimlib/implement_shim.inl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/shims/shimli…
============================================================================== --- trunk/reactos/dll/appcompat/shims/shimlib/implement_shim.inl (added) +++ trunk/reactos/dll/appcompat/shims/shimlib/implement_shim.inl [iso-8859-1] Sat May 28 16:42:57 2016 @@ -0,0 +1,76 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Shim library + * FILE: dll/appcompat/shims/shimlib/implement_shim.inl + * PURPOSE: Shimlib helper file, used to register shims using the earlier prepared macro's + * PROGRAMMER: Mark Jansen + */ + +#ifndef SHIM_NS +#error "A namespace should be provided in SHIM_NS before including this file!" +#endif + +#ifndef SHIM_NUM_HOOKS +#error "The number of hooks should be provided in SHIM_NUM_HOOKS before including this file!" +#endif + +#ifndef SHIM_OBJ_NAME +#error "setup_shim.inl should be included before this file!" +#endif + +#ifndef SHIM_SETUP_HOOKS +#error "Please define a hook: #define SHIM_SETUP_HOOKS SHIM_HOOK(num, dll_name, function_name, your_function)" +#endif + +PHOOKAPI WINAPI SHIM_OBJ_NAME(InitializeHooksMulti)(DWORD fdwReason, PCSTR pszCmdLine, PDWORD pdwHookCount) +{ + if (fdwReason == SHIM_REASON_ATTACH) + { + if (pszCmdLine) + { + SHIM_OBJ_NAME(g_szCommandLine) = ShimLib_StringDuplicateA(pszCmdLine); + } + else + { + SHIM_OBJ_NAME(g_szCommandLine) = ""; + } + SHIM_OBJ_NAME(g_pAPIHooks) = ShimLib_ShimMalloc(sizeof(HOOKAPI) * SHIM_NUM_HOOKS); + ZeroMemory(SHIM_OBJ_NAME(g_pAPIHooks), sizeof(HOOKAPI) * SHIM_NUM_HOOKS); + *pdwHookCount = SHIM_NUM_HOOKS; + } + +#ifdef SHIM_NOTIFY_FN + if (!SHIM_NOTIFY_FN(fdwReason) && fdwReason == SHIM_REASON_ATTACH) + return NULL; +#endif + + if (fdwReason == SHIM_REASON_ATTACH) + { + SHIM_SETUP_HOOKS + } + return SHIM_OBJ_NAME(g_pAPIHooks); +} + + +PVOID SHIM_OBJ_NAME(FindShim)(PCWSTR wszString) +{ + PCSTR szString = SHIM_OBJ_NAME(g_szModuleName); + while (*szString == *wszString) + { + if (!*szString) + return SHIM_OBJ_NAME(InitializeHooksMulti); + szString++; wszString++; + } + return NULL; +} + +#if defined(_MSC_VER) +#pragma section(".shm$BBB",long,read) +#endif + +_SHMALLOC(".shm$BBB") _PVSHIM SHIM_OBJ_NAME(_shim_fn) = SHIM_OBJ_NAME(FindShim); + +#undef SHIM_SETUP_HOOKS +#undef SHIM_NOTIFY_FN +#undef SHIM_NUM_HOOKS +#undef SHIM_NS Propchange: trunk/reactos/dll/appcompat/shims/shimlib/implement_shim.inl ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/appcompat/shims/shimlib/setup_shim.inl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/shims/shimli…
============================================================================== --- trunk/reactos/dll/appcompat/shims/shimlib/setup_shim.inl (added) +++ trunk/reactos/dll/appcompat/shims/shimlib/setup_shim.inl [iso-8859-1] Sat May 28 16:42:57 2016 @@ -0,0 +1,39 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Shim library + * FILE: dll/appcompat/shims/shimlib/setup_shim.inl + * PURPOSE: Shimlib helper file, used for setting up the macro's used when registering a shim. + * PROGRAMMER: Mark Jansen + */ + + +#ifndef SHIM_NS +#error "A namespace should be provided in SHIM_NS before including this file!" +#endif + +#ifndef SHIM_OBJ_NAME +#define SHIM_OBJ_NAME3(ns, name) ns ## _ ## name +#define SHIM_OBJ_NAME2(ns, name) SHIM_OBJ_NAME3(ns, name) +#define SHIM_OBJ_NAME(name) SHIM_OBJ_NAME2(SHIM_NS, name) + +#define SHIM_STRINGIFY2(X_) # X_ +#define SHIM_STRINGIFY(X_) SHIM_STRINGIFY2(X_) + +#define SHIM_HOOK(num, dll, function, target) \ + SHIM_OBJ_NAME(g_pAPIHooks)[num].LibraryName = dll; \ + SHIM_OBJ_NAME(g_pAPIHooks)[num].FunctionName = function; \ + SHIM_OBJ_NAME(g_pAPIHooks)[num].ReplacementFunction = target; \ + SHIM_OBJ_NAME(g_pAPIHooks)[num].OriginalFunction = NULL; \ + SHIM_OBJ_NAME(g_pAPIHooks)[num].Unk1 = NULL; \ + SHIM_OBJ_NAME(g_pAPIHooks)[num].Unk2 = NULL; + +#define CALL_SHIM(SHIM_NUM, SHIM_CALLCONV) \ + ((SHIM_CALLCONV)(SHIM_OBJ_NAME(g_pAPIHooks)[SHIM_NUM].OriginalFunction)) + +#endif + + +PCSTR SHIM_OBJ_NAME(g_szModuleName) = SHIM_STRINGIFY(SHIM_NS); +PCSTR SHIM_OBJ_NAME(g_szCommandLine); +PHOOKAPI SHIM_OBJ_NAME(g_pAPIHooks); + Propchange: trunk/reactos/dll/appcompat/shims/shimlib/setup_shim.inl ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/appcompat/shims/shimlib/shimlib.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/shims/shimli…
============================================================================== --- trunk/reactos/dll/appcompat/shims/shimlib/shimlib.c (added) +++ trunk/reactos/dll/appcompat/shims/shimlib/shimlib.c [iso-8859-1] Sat May 28 16:42:57 2016 @@ -0,0 +1,91 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Shim library + * FILE: dll/appcompat/shims/shimlib/shimlib.c + * PURPOSE: Shim helper functions + * PROGRAMMER: Mark Jansen + */ + +#include <windows.h> +#include <shimlib.h> +#include <strsafe.h> + +HINSTANCE g_hinstDll; +static HANDLE g_ShimLib_Heap; + +void ShimLib_Init(HINSTANCE hInstance) +{ + g_hinstDll = hInstance; + g_ShimLib_Heap = HeapCreate(0, 0x10000, 0); +} + +void ShimLib_Deinit() +{ + // Is this a good idea? + HeapDestroy(g_ShimLib_Heap); +} + +PVOID ShimLib_ShimMalloc(SIZE_T dwSize) +{ + return HeapAlloc(g_ShimLib_Heap, 0, dwSize); +} + +void ShimLib_ShimFree(PVOID pData) +{ + HeapFree(g_ShimLib_Heap, 0, pData); +} + +PCSTR ShimLib_StringDuplicateA(PCSTR szString) +{ + SIZE_T Length = lstrlenA(szString); + PSTR NewString = ShimLib_ShimMalloc(Length+1); + return lstrcpyA(NewString, szString); +} + +#if defined(_MSC_VER) + +#if defined(_M_IA64) || defined(_M_AMD64) +#define _ATTRIBUTES read +#else +#define _ATTRIBUTES read +#endif + + +#pragma section(".shm",long,read) +#pragma section(".shm$AAA",long,read) +#pragma section(".shm$ZZZ",long,read) +#endif + +#ifdef _MSC_VER +#pragma comment(linker, "/merge:.shm=.rdata") +#endif + + +_SHMALLOC(".shm") _PVSHIM _shim_start = 0; +_SHMALLOC(".shm$ZZZ") _PVSHIM _shim_end = 0; + + +/* Generic GetHookAPIs function. + The macro's from <setup_shim.inl> and <implement_shim.inl> will register a list of all apis that should be hooked + for a specific shim + This helper function will return the correct shim, and call the init function */ +PHOOKAPI WINAPI ShimLib_GetHookAPIs(IN LPCSTR szCommandLine, IN LPCWSTR wszShimName, OUT PDWORD pdwHookCount) +{ + uintptr_t ps = (uintptr_t)&_shim_start; + ps += sizeof(uintptr_t); + for (; ps != (uintptr_t)&_shim_end; ps += sizeof(uintptr_t)) + { + _PVSHIM* pfunc = (_PVSHIM *)ps; + if (*pfunc != NULL) + { + PVOID res = (*pfunc)(wszShimName); + if (res) + { + PHOOKAPI (WINAPI* PFN)(DWORD, PCSTR, PDWORD) = res; + return (*PFN)(SHIM_REASON_ATTACH, szCommandLine, pdwHookCount); + } + } + } + return NULL; +} + Propchange: trunk/reactos/dll/appcompat/shims/shimlib/shimlib.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/appcompat/shims/shimlib/shimlib.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/appcompat/shims/shimli…
============================================================================== --- trunk/reactos/dll/appcompat/shims/shimlib/shimlib.h (added) +++ trunk/reactos/dll/appcompat/shims/shimlib/shimlib.h [iso-8859-1] Sat May 28 16:42:57 2016 @@ -0,0 +1,45 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Shim Engine + * FILE: dll/appcompat/shims/shimlib/shimlib.h + * PURPOSE: ReactOS Shim Engine + * PROGRAMMER: Mark Jansen + */ + +#pragma once + +typedef struct tagHOOKAPI { + PCSTR LibraryName; + PCSTR FunctionName; + PVOID ReplacementFunction; + PVOID OriginalFunction; + PVOID Unk1; + PVOID Unk2; +} HOOKAPI, *PHOOKAPI; + +extern HINSTANCE g_hinstDll; + +void ShimLib_Init(HINSTANCE); +void ShimLib_Deinit(void); +PVOID ShimLib_ShimMalloc(SIZE_T); +void ShimLib_ShimFree(PVOID); +PCSTR ShimLib_StringDuplicateA(PCSTR); +PHOOKAPI WINAPI ShimLib_GetHookAPIs(LPCSTR,LPCWSTR,PDWORD); + + +#define SHIM_REASON_ATTACH 1 +#define SHIM_REASON_DETACH 2 +#define SHIM_REASON_DLL_LOAD 3 /* Arg: PLDR_DATA_TABLE_ENTRY */ +#define SHIM_REASON_DLL_UNLOAD 4 /* Arg: Module Handle */ + + +typedef PVOID (__cdecl *_PVSHIM)(PCWSTR); + +#if defined(_MSC_VER) +#define _SHMALLOC(x) __declspec(allocate(x)) +#elif defined(__GNUC__) +#define _SHMALLOC(x) __attribute__ ((section (x) )) +#else +#error Your compiler is not supported. +#endif + Propchange: trunk/reactos/dll/appcompat/shims/shimlib/shimlib.h ------------------------------------------------------------------------------ svn:eol-style = native
8 years, 7 months
1
0
0
0
[hbelusca] 71438: [KDCOM]: Properly revert the commits.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sat May 28 15:54:44 2016 New Revision: 71438 URL:
http://svn.reactos.org/svn/reactos?rev=71438&view=rev
Log: [KDCOM]: Properly revert the commits. Modified: trunk/reactos/drivers/base/kdcom/kddll.c Modified: trunk/reactos/drivers/base/kdcom/kddll.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdcom/kddll.c…
============================================================================== --- trunk/reactos/drivers/base/kdcom/kddll.c [iso-8859-1] (original) +++ trunk/reactos/drivers/base/kdcom/kddll.c [iso-8859-1] Sat May 28 15:54:44 2016 @@ -11,7 +11,7 @@ /* GLOBALS ********************************************************************/ ULONG CurrentPacketId = INITIAL_PACKET_ID | SYNC_PACKET_ID; -ULONG RemotePacketId = INITIAL_PACKET_ID; +ULONG RemotePacketId = INITIAL_PACKET_ID; /* PRIVATE FUNCTIONS **********************************************************/ @@ -90,7 +90,7 @@ ULONG Checksum; /* Special handling for breakin packet */ - if(PacketType == PACKET_TYPE_KD_POLL_BREAKIN) + if (PacketType == PACKET_TYPE_KD_POLL_BREAKIN) { return KdpPollBreakIn(); } @@ -175,9 +175,9 @@ case PACKET_TYPE_KD_RESET: KDDBGPRINT("KdReceivePacket - got PACKET_TYPE_KD_RESET\n"); + CurrentPacketId = INITIAL_PACKET_ID; + RemotePacketId = INITIAL_PACKET_ID; KdpSendControlPacket(PACKET_TYPE_KD_RESET, 0); - CurrentPacketId = INITIAL_PACKET_ID; - RemotePacketId = INITIAL_PACKET_ID; /* Fall through */ case PACKET_TYPE_KD_RESEND: @@ -219,7 +219,7 @@ /* Receive the message header data */ KdStatus = KdpReceiveBuffer(MessageHeader->Buffer, - MessageHeader->Length); + MessageHeader->Length); if (KdStatus != KDP_PACKET_RECEIVED) { /* Didn't receive data. Packet needs to be resent. */ @@ -278,7 +278,7 @@ if (Packet.Checksum != Checksum) { KDDBGPRINT("KdReceivePacket - wrong cheksum, got %x, calculated %x\n", - Packet.Checksum, Checksum); + Packet.Checksum, Checksum); KdpSendControlPacket(PACKET_TYPE_KD_RESEND, 0); continue; }
8 years, 7 months
1
0
0
0
[tkreuzer] 71437: Revert a mistake commit...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat May 28 15:51:44 2016 New Revision: 71437 URL:
http://svn.reactos.org/svn/reactos?rev=71437&view=rev
Log: Revert a mistake commit... Modified: trunk/reactos/drivers/base/kdcom/kddll.c Modified: trunk/reactos/drivers/base/kdcom/kddll.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdcom/kddll.c…
============================================================================== --- trunk/reactos/drivers/base/kdcom/kddll.c [iso-8859-1] (original) +++ trunk/reactos/drivers/base/kdcom/kddll.c [iso-8859-1] Sat May 28 15:51:44 2016 @@ -8,19 +8,11 @@ #include "kddll.h" -#define _FULL_ 1 -#define _WORKS_ 0 -#define _WORKS2_ 0 - /* GLOBALS ********************************************************************/ ULONG CurrentPacketId = INITIAL_PACKET_ID | SYNC_PACKET_ID; -ULONG RemotePacketId = INITIAL_PACKET_ID; - -#if _FULL_ -ULONG KdCompNumberRetries = 5; -ULONG KdCompRetryCount = 5; -#endif +ULONG RemotePacketId = INITIAL_PACKET_ID; + /* PRIVATE FUNCTIONS **********************************************************/ @@ -38,13 +30,13 @@ IN PVOID Buffer, IN ULONG Length) { - ULONG i, Checksum = 0; - - for (i = 0; i < Length; i++) + PUCHAR ByteBuffer = Buffer; + ULONG Checksum = 0; + + while (Length-- > 0) { - Checksum += ((PUCHAR)Buffer)[i]; + Checksum += (ULONG)*ByteBuffer++; } - return Checksum; } @@ -67,36 +59,6 @@ /* PUBLIC FUNCTIONS ***********************************************************/ - -NTSTATUS -NTAPI -KdD0Transition(VOID) -{ - return STATUS_SUCCESS; -} - -NTSTATUS -NTAPI -KdD3Transition(VOID) -{ - return STATUS_SUCCESS; -} - - -/****************************************************************************** - * \name KdDebuggerInitialize1 - * \brief Phase 1 initialization. - * \param [opt] LoaderBlock Pointer to the Loader parameter block. Can be NULL. - * \return Status - */ -NTSTATUS -NTAPI -KdDebuggerInitialize1( - IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL) -{ - return STATUS_SUCCESS; -} - /****************************************************************************** * \name KdReceivePacket @@ -128,36 +90,21 @@ ULONG Checksum; /* Special handling for breakin packet */ - if (PacketType == PACKET_TYPE_KD_POLL_BREAKIN) + if(PacketType == PACKET_TYPE_KD_POLL_BREAKIN) { return KdpPollBreakIn(); } for (;;) { -#if _FULL_ || _WORKS2_ - if (KdContext) - { - KdContext->KdpControlCPending = FALSE; - } -#endif /* Step 1 - Read PacketLeader */ KdStatus = KdpReceivePacketLeader(&Packet.PacketLeader); -#if _FULL_ - if (KdStatus != KDP_PACKET_TIMEOUT) - { -// KdCompNumberRetries = KdCompRetryCount; - } -#endif if (KdStatus != KDP_PACKET_RECEIVED) { /* Check if we got a breakin */ if (KdStatus == KDP_PACKET_RESEND) { -#if _FULL_ || _WORKS2_ || _PATCH_ - if (KdContext) -#endif - KdContext->KdpControlCPending = TRUE; + KdContext->KdpControlCPending = TRUE; } return KdStatus; } @@ -167,37 +114,22 @@ if (KdStatus != KDP_PACKET_RECEIVED) { /* Didn't receive a PacketType. */ - KDDBGPRINT("KdReceivePacket - Didn't receive a PacketType.\n"); -#if _WORKS_ - continue; -#else return KdStatus; -#endif } /* Check if we got a resend packet */ if (Packet.PacketLeader == CONTROL_PACKET_LEADER && Packet.PacketType == PACKET_TYPE_KD_RESEND) { - KDDBGPRINT("KdReceivePacket - PACKET_TYPE_KD_RESEND.\n"); return KDP_PACKET_RESEND; } /* Step 3 - Read ByteCount */ KdStatus = KdpReceiveBuffer(&Packet.ByteCount, sizeof(USHORT)); -#if _WORKS_ - if (KdStatus != KDP_PACKET_RECEIVED || Packet.ByteCount > PACKET_MAX_SIZE) -#else - if (KdStatus != KDP_PACKET_RECEIVED) -#endif - { - /* Didn't receive ByteCount _WORKS_: or it's too big. Start over. */ - KDDBGPRINT("KdReceivePacket - Didn't receive ByteCount.\n"); -#if _WORKS_ - continue; -#else + if (KdStatus != KDP_PACKET_RECEIVED) + { + /* Didn't receive ByteCount. */ return KdStatus; -#endif } /* Step 4 - Read PacketId */ @@ -205,12 +137,7 @@ if (KdStatus != KDP_PACKET_RECEIVED) { /* Didn't receive PacketId. */ - KDDBGPRINT("KdReceivePacket - Didn't receive PacketId.\n"); -#if _WORKS_ - continue; -#else return KdStatus; -#endif } /* @@ -226,12 +153,7 @@ if (KdStatus != KDP_PACKET_RECEIVED) { /* Didn't receive Checksum. */ - KDDBGPRINT("KdReceivePacket - Didn't receive Checksum.\n"); -#if _WORKS_ - continue; -#else return KdStatus; -#endif } /* Step 6 - Handle control packets */ @@ -253,9 +175,9 @@ case PACKET_TYPE_KD_RESET: KDDBGPRINT("KdReceivePacket - got PACKET_TYPE_KD_RESET\n"); + KdpSendControlPacket(PACKET_TYPE_KD_RESET, 0); CurrentPacketId = INITIAL_PACKET_ID; - RemotePacketId = INITIAL_PACKET_ID; - KdpSendControlPacket(PACKET_TYPE_KD_RESET, 0); + RemotePacketId = INITIAL_PACKET_ID; /* Fall through */ case PACKET_TYPE_KD_RESEND: @@ -265,11 +187,8 @@ default: KDDBGPRINT("KdReceivePacket - got unknown control packet\n"); -#if _FULL_ + /* We got an invalid packet, ignore it and start over */ continue; -#else - return KDP_PACKET_RESEND; -#endif } } @@ -277,56 +196,17 @@ if (PacketType == PACKET_TYPE_KD_ACKNOWLEDGE) { /* We received something different */ -#if _FULL_ || _WORKS2_ - if (Packet.PacketId != RemotePacketId) - { - KdpSendControlPacket(PACKET_TYPE_KD_ACKNOWLEDGE, - Packet.PacketId); - continue; - } -#elif _PATCH_ - DBGKD_MANIPULATE_STATE64 State; - KdStatus = KdpReceiveBuffer(&State, sizeof(State)); - KDDBGPRINT("KdReceivePacket - unxpected Packet.PacketType=0x%x, 0x%x, 0x%x\n", - Packet.PacketType, Packet.Checksum, State.ApiNumber); -#endif KdpSendControlPacket(PACKET_TYPE_KD_RESEND, 0); CurrentPacketId ^= 1; return KDP_PACKET_RECEIVED; } /* Get size of the message header */ -#if _WORKS_ - switch (Packet.PacketType) - { - case PACKET_TYPE_KD_STATE_CHANGE64: - MessageHeader->Length = sizeof(DBGKD_WAIT_STATE_CHANGE64); - break; - - case PACKET_TYPE_KD_STATE_MANIPULATE: - MessageHeader->Length = sizeof(DBGKD_MANIPULATE_STATE64); - break; - - case PACKET_TYPE_KD_DEBUG_IO: - MessageHeader->Length = sizeof(DBGKD_DEBUG_IO); - break; - - default: - KDDBGPRINT("KdReceivePacket - unknown PacketType\n"); - return KDP_PACKET_RESEND; - } - - //KDDBGPRINT("KdReceivePacket - got normal PacketType\n"); - - /* Packet smaller than expected? */ - if (MessageHeader->Length > Packet.ByteCount) -#else MessageHeader->Length = MessageHeader->MaximumLength; /* Packet smaller than expected or too big? */ if (Packet.ByteCount < MessageHeader->Length || Packet.ByteCount > PACKET_MAX_SIZE) -#endif { KDDBGPRINT("KdReceivePacket - too few data (%d) for type %d\n", Packet.ByteCount, MessageHeader->Length); @@ -338,11 +218,8 @@ //KDDBGPRINT("KdReceivePacket - got normal PacketType, Buffer = %p\n", MessageHeader->Buffer); /* Receive the message header data */ -#if _WORKS2_ - MessageHeader->Length = MessageHeader->MaximumLength; -#endif KdStatus = KdpReceiveBuffer(MessageHeader->Buffer, - MessageHeader->Length); + MessageHeader->Length); if (KdStatus != KDP_PACKET_RECEIVED) { /* Didn't receive data. Packet needs to be resent. */ @@ -369,7 +246,7 @@ /* Do we have data? */ if (MessageData->Length) { - KDDBGPRINT("KdReceivePacket - 0x%lx bytes data\n", *DataLength); + KDDBGPRINT("KdReceivePacket - got data\n"); /* Receive the message data */ KdStatus = KdpReceiveBuffer(MessageData->Buffer, @@ -401,19 +278,10 @@ if (Packet.Checksum != Checksum) { KDDBGPRINT("KdReceivePacket - wrong cheksum, got %x, calculated %x\n", - Packet.Checksum, Checksum); + Packet.Checksum, Checksum); KdpSendControlPacket(PACKET_TYPE_KD_RESEND, 0); continue; } - -#if _FULL_ || _WORKS2_ - if (Packet.PacketId != INITIAL_PACKET_ID && - Packet.PacketId != (INITIAL_PACKET_ID ^ 1)) - { - KdpSendControlPacket(PACKET_TYPE_KD_RESEND, 0); - continue; - } -#endif /* Acknowledge the received packet */ KdpSendControlPacket(PACKET_TYPE_KD_ACKNOWLEDGE, Packet.PacketId); @@ -422,7 +290,6 @@ if (Packet.PacketId != RemotePacketId) { /* Continue with next packet */ - KDDBGPRINT("KdReceivePacket - Wrong PacketId.\n"); continue; } @@ -440,28 +307,6 @@ } return KDP_PACKET_RECEIVED; -} - -static -BOOLEAN -IsQuickTimeoutAllowed( - IN ULONG PacketType, - IN PSTRING MessageHeader) -{ - PDBGKD_DEBUG_IO DebugIo = (PDBGKD_DEBUG_IO)MessageHeader->Buffer; - ULONG ApiNumber = DebugIo->ApiNumber; - - if ( ((PacketType == PACKET_TYPE_KD_DEBUG_IO) && - ((ApiNumber == DbgKdPrintStringApi))) || - ((PacketType == PACKET_TYPE_KD_FILE_IO) && - ((ApiNumber == DbgKdCreateFileApi))) || - ((PacketType == PACKET_TYPE_KD_STATE_CHANGE64) && - ((ApiNumber == DbgKdLoadSymbolsStateChange))) ) - { - return TRUE; - } - - return FALSE; } VOID @@ -491,11 +336,7 @@ MessageData->Length); } -#if _FULL_ - Retries = KdCompNumberRetries = KdCompRetryCount; -#else Retries = KdContext->KdpDefaultRetries; -#endif for (;;) { @@ -508,7 +349,7 @@ /* Send the message header */ KdpSendBuffer(MessageHeader->Buffer, MessageHeader->Length); - /* If we have message data, also send it */ + /* If we have meesage data, also send it */ if (MessageData) { KdpSendBuffer(MessageData->Buffer, MessageData->Length); @@ -529,37 +370,58 @@ { /* Packet received, we can quit the loop */ CurrentPacketId &= ~SYNC_PACKET_ID; + Retries = KdContext->KdpDefaultRetries; break; } - - if (KdStatus == KDP_PACKET_TIMEOUT) + else if (KdStatus == KDP_PACKET_TIMEOUT) { /* Timeout, decrement the retry count */ - Retries--; + if (Retries > 0) + Retries--; /* * If the retry count reaches zero, bail out * for packet types allowed to timeout. */ - if ((Retries == 0) && - IsQuickTimeoutAllowed(PacketType, MessageHeader)) + if (Retries == 0) { + ULONG MessageId = *(PULONG)MessageHeader->Buffer; + switch (PacketType) + { + case PACKET_TYPE_KD_DEBUG_IO: + { + if (MessageId != DbgKdPrintStringApi) continue; + break; + } + + case PACKET_TYPE_KD_STATE_CHANGE32: + case PACKET_TYPE_KD_STATE_CHANGE64: + { + if (MessageId != DbgKdLoadSymbolsStateChange) continue; + break; + } + + case PACKET_TYPE_KD_FILE_IO: + { + if (MessageId != DbgKdCreateFileApi) continue; + break; + } + } /* Reset debugger state */ KD_DEBUGGER_NOT_PRESENT = TRUE; SharedUserData->KdDebuggerEnabled &= ~0x00000002; CurrentPacketId = INITIAL_PACKET_ID | SYNC_PACKET_ID; - RemotePacketId = INITIAL_PACKET_ID; + RemotePacketId = INITIAL_PACKET_ID; + return; } } + // else (KdStatus == KDP_PACKET_RESEND) /* Resend the packet */ /* Packet timed out, send it again */ KDDBGPRINT("KdSendPacket got KdStatus 0x%x\n", KdStatus); } - -#if _FULL_ - KdCompNumberRetries = Retries; -#endif // _FULL_ } +/* EOF */
8 years, 7 months
1
0
0
0
[tkreuzer] 71436: Patch "works": continue vs return stuff
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat May 28 15:46:49 2016 New Revision: 71436 URL:
http://svn.reactos.org/svn/reactos?rev=71436&view=rev
Log: Patch "works": continue vs return stuff Modified: trunk/reactos/drivers/base/kdcom/kddll.c Modified: trunk/reactos/drivers/base/kdcom/kddll.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdcom/kddll.c…
============================================================================== --- trunk/reactos/drivers/base/kdcom/kddll.c [iso-8859-1] (original) +++ trunk/reactos/drivers/base/kdcom/kddll.c [iso-8859-1] Sat May 28 15:46:49 2016 @@ -8,11 +8,19 @@ #include "kddll.h" +#define _FULL_ 1 +#define _WORKS_ 0 +#define _WORKS2_ 0 + /* GLOBALS ********************************************************************/ ULONG CurrentPacketId = INITIAL_PACKET_ID | SYNC_PACKET_ID; ULONG RemotePacketId = INITIAL_PACKET_ID; +#if _FULL_ +ULONG KdCompNumberRetries = 5; +ULONG KdCompRetryCount = 5; +#endif /* PRIVATE FUNCTIONS **********************************************************/ @@ -30,13 +38,13 @@ IN PVOID Buffer, IN ULONG Length) { - PUCHAR ByteBuffer = Buffer; - ULONG Checksum = 0; - - while (Length-- > 0) + ULONG i, Checksum = 0; + + for (i = 0; i < Length; i++) { - Checksum += (ULONG)*ByteBuffer++; + Checksum += ((PUCHAR)Buffer)[i]; } + return Checksum; } @@ -59,6 +67,36 @@ /* PUBLIC FUNCTIONS ***********************************************************/ + +NTSTATUS +NTAPI +KdD0Transition(VOID) +{ + return STATUS_SUCCESS; +} + +NTSTATUS +NTAPI +KdD3Transition(VOID) +{ + return STATUS_SUCCESS; +} + + +/****************************************************************************** + * \name KdDebuggerInitialize1 + * \brief Phase 1 initialization. + * \param [opt] LoaderBlock Pointer to the Loader parameter block. Can be NULL. + * \return Status + */ +NTSTATUS +NTAPI +KdDebuggerInitialize1( + IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL) +{ + return STATUS_SUCCESS; +} + /****************************************************************************** * \name KdReceivePacket @@ -97,14 +135,29 @@ for (;;) { +#if _FULL_ || _WORKS2_ + if (KdContext) + { + KdContext->KdpControlCPending = FALSE; + } +#endif /* Step 1 - Read PacketLeader */ KdStatus = KdpReceivePacketLeader(&Packet.PacketLeader); +#if _FULL_ + if (KdStatus != KDP_PACKET_TIMEOUT) + { +// KdCompNumberRetries = KdCompRetryCount; + } +#endif if (KdStatus != KDP_PACKET_RECEIVED) { /* Check if we got a breakin */ if (KdStatus == KDP_PACKET_RESEND) { - KdContext->KdpControlCPending = TRUE; +#if _FULL_ || _WORKS2_ || _PATCH_ + if (KdContext) +#endif + KdContext->KdpControlCPending = TRUE; } return KdStatus; } @@ -114,22 +167,37 @@ if (KdStatus != KDP_PACKET_RECEIVED) { /* Didn't receive a PacketType. */ + KDDBGPRINT("KdReceivePacket - Didn't receive a PacketType.\n"); +#if _WORKS_ + continue; +#else return KdStatus; +#endif } /* Check if we got a resend packet */ if (Packet.PacketLeader == CONTROL_PACKET_LEADER && Packet.PacketType == PACKET_TYPE_KD_RESEND) { + KDDBGPRINT("KdReceivePacket - PACKET_TYPE_KD_RESEND.\n"); return KDP_PACKET_RESEND; } /* Step 3 - Read ByteCount */ KdStatus = KdpReceiveBuffer(&Packet.ByteCount, sizeof(USHORT)); +#if _WORKS_ + if (KdStatus != KDP_PACKET_RECEIVED || Packet.ByteCount > PACKET_MAX_SIZE) +#else if (KdStatus != KDP_PACKET_RECEIVED) - { - /* Didn't receive ByteCount. */ +#endif + { + /* Didn't receive ByteCount _WORKS_: or it's too big. Start over. */ + KDDBGPRINT("KdReceivePacket - Didn't receive ByteCount.\n"); +#if _WORKS_ + continue; +#else return KdStatus; +#endif } /* Step 4 - Read PacketId */ @@ -137,7 +205,12 @@ if (KdStatus != KDP_PACKET_RECEIVED) { /* Didn't receive PacketId. */ + KDDBGPRINT("KdReceivePacket - Didn't receive PacketId.\n"); +#if _WORKS_ + continue; +#else return KdStatus; +#endif } /* @@ -153,7 +226,12 @@ if (KdStatus != KDP_PACKET_RECEIVED) { /* Didn't receive Checksum. */ + KDDBGPRINT("KdReceivePacket - Didn't receive Checksum.\n"); +#if _WORKS_ + continue; +#else return KdStatus; +#endif } /* Step 6 - Handle control packets */ @@ -187,8 +265,11 @@ default: KDDBGPRINT("KdReceivePacket - got unknown control packet\n"); - /* We got an invalid packet, ignore it and start over */ +#if _FULL_ continue; +#else + return KDP_PACKET_RESEND; +#endif } } @@ -196,17 +277,56 @@ if (PacketType == PACKET_TYPE_KD_ACKNOWLEDGE) { /* We received something different */ +#if _FULL_ || _WORKS2_ + if (Packet.PacketId != RemotePacketId) + { + KdpSendControlPacket(PACKET_TYPE_KD_ACKNOWLEDGE, + Packet.PacketId); + continue; + } +#elif _PATCH_ + DBGKD_MANIPULATE_STATE64 State; + KdStatus = KdpReceiveBuffer(&State, sizeof(State)); + KDDBGPRINT("KdReceivePacket - unxpected Packet.PacketType=0x%x, 0x%x, 0x%x\n", + Packet.PacketType, Packet.Checksum, State.ApiNumber); +#endif KdpSendControlPacket(PACKET_TYPE_KD_RESEND, 0); CurrentPacketId ^= 1; return KDP_PACKET_RECEIVED; } /* Get size of the message header */ +#if _WORKS_ + switch (Packet.PacketType) + { + case PACKET_TYPE_KD_STATE_CHANGE64: + MessageHeader->Length = sizeof(DBGKD_WAIT_STATE_CHANGE64); + break; + + case PACKET_TYPE_KD_STATE_MANIPULATE: + MessageHeader->Length = sizeof(DBGKD_MANIPULATE_STATE64); + break; + + case PACKET_TYPE_KD_DEBUG_IO: + MessageHeader->Length = sizeof(DBGKD_DEBUG_IO); + break; + + default: + KDDBGPRINT("KdReceivePacket - unknown PacketType\n"); + return KDP_PACKET_RESEND; + } + + //KDDBGPRINT("KdReceivePacket - got normal PacketType\n"); + + /* Packet smaller than expected? */ + if (MessageHeader->Length > Packet.ByteCount) +#else MessageHeader->Length = MessageHeader->MaximumLength; /* Packet smaller than expected or too big? */ if (Packet.ByteCount < MessageHeader->Length || Packet.ByteCount > PACKET_MAX_SIZE) +#endif { KDDBGPRINT("KdReceivePacket - too few data (%d) for type %d\n", Packet.ByteCount, MessageHeader->Length); @@ -218,6 +338,9 @@ //KDDBGPRINT("KdReceivePacket - got normal PacketType, Buffer = %p\n", MessageHeader->Buffer); /* Receive the message header data */ +#if _WORKS2_ + MessageHeader->Length = MessageHeader->MaximumLength; +#endif KdStatus = KdpReceiveBuffer(MessageHeader->Buffer, MessageHeader->Length); if (KdStatus != KDP_PACKET_RECEIVED) @@ -246,7 +369,7 @@ /* Do we have data? */ if (MessageData->Length) { - KDDBGPRINT("KdReceivePacket - got data\n"); + KDDBGPRINT("KdReceivePacket - 0x%lx bytes data\n", *DataLength); /* Receive the message data */ KdStatus = KdpReceiveBuffer(MessageData->Buffer, @@ -283,6 +406,15 @@ continue; } +#if _FULL_ || _WORKS2_ + if (Packet.PacketId != INITIAL_PACKET_ID && + Packet.PacketId != (INITIAL_PACKET_ID ^ 1)) + { + KdpSendControlPacket(PACKET_TYPE_KD_RESEND, 0); + continue; + } +#endif + /* Acknowledge the received packet */ KdpSendControlPacket(PACKET_TYPE_KD_ACKNOWLEDGE, Packet.PacketId); @@ -290,6 +422,7 @@ if (Packet.PacketId != RemotePacketId) { /* Continue with next packet */ + KDDBGPRINT("KdReceivePacket - Wrong PacketId.\n"); continue; } @@ -307,6 +440,28 @@ } return KDP_PACKET_RECEIVED; +} + +static +BOOLEAN +IsQuickTimeoutAllowed( + IN ULONG PacketType, + IN PSTRING MessageHeader) +{ + PDBGKD_DEBUG_IO DebugIo = (PDBGKD_DEBUG_IO)MessageHeader->Buffer; + ULONG ApiNumber = DebugIo->ApiNumber; + + if ( ((PacketType == PACKET_TYPE_KD_DEBUG_IO) && + ((ApiNumber == DbgKdPrintStringApi))) || + ((PacketType == PACKET_TYPE_KD_FILE_IO) && + ((ApiNumber == DbgKdCreateFileApi))) || + ((PacketType == PACKET_TYPE_KD_STATE_CHANGE64) && + ((ApiNumber == DbgKdLoadSymbolsStateChange))) ) + { + return TRUE; + } + + return FALSE; } VOID @@ -336,7 +491,11 @@ MessageData->Length); } +#if _FULL_ + Retries = KdCompNumberRetries = KdCompRetryCount; +#else Retries = KdContext->KdpDefaultRetries; +#endif for (;;) { @@ -349,7 +508,7 @@ /* Send the message header */ KdpSendBuffer(MessageHeader->Buffer, MessageHeader->Length); - /* If we have meesage data, also send it */ + /* If we have message data, also send it */ if (MessageData) { KdpSendBuffer(MessageData->Buffer, MessageData->Length); @@ -370,58 +529,37 @@ { /* Packet received, we can quit the loop */ CurrentPacketId &= ~SYNC_PACKET_ID; - Retries = KdContext->KdpDefaultRetries; break; } - else if (KdStatus == KDP_PACKET_TIMEOUT) + + if (KdStatus == KDP_PACKET_TIMEOUT) { /* Timeout, decrement the retry count */ - if (Retries > 0) - Retries--; + Retries--; /* * If the retry count reaches zero, bail out * for packet types allowed to timeout. */ - if (Retries == 0) + if ((Retries == 0) && + IsQuickTimeoutAllowed(PacketType, MessageHeader)) { - ULONG MessageId = *(PULONG)MessageHeader->Buffer; - switch (PacketType) - { - case PACKET_TYPE_KD_DEBUG_IO: - { - if (MessageId != DbgKdPrintStringApi) continue; - break; - } - - case PACKET_TYPE_KD_STATE_CHANGE32: - case PACKET_TYPE_KD_STATE_CHANGE64: - { - if (MessageId != DbgKdLoadSymbolsStateChange) continue; - break; - } - - case PACKET_TYPE_KD_FILE_IO: - { - if (MessageId != DbgKdCreateFileApi) continue; - break; - } - } /* Reset debugger state */ KD_DEBUGGER_NOT_PRESENT = TRUE; SharedUserData->KdDebuggerEnabled &= ~0x00000002; CurrentPacketId = INITIAL_PACKET_ID | SYNC_PACKET_ID; - RemotePacketId = INITIAL_PACKET_ID; - + RemotePacketId = INITIAL_PACKET_ID; return; } } - // else (KdStatus == KDP_PACKET_RESEND) /* Resend the packet */ /* Packet timed out, send it again */ KDDBGPRINT("KdSendPacket got KdStatus 0x%x\n", KdStatus); } -} - -/* EOF */ + +#if _FULL_ + KdCompNumberRetries = Retries; +#endif // _FULL_ +} +
8 years, 7 months
1
0
0
0
[hbelusca] 71435: [TIMEDATE.CPL]: Do not hardcode some of the buffer lengths. CORE-11284
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sat May 28 15:23:00 2016 New Revision: 71435 URL:
http://svn.reactos.org/svn/reactos?rev=71435&view=rev
Log: [TIMEDATE.CPL]: Do not hardcode some of the buffer lengths. CORE-11284 Modified: trunk/reactos/dll/cpl/timedate/timezone.c Modified: trunk/reactos/dll/cpl/timedate/timezone.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/timedate/timezone.…
============================================================================== --- trunk/reactos/dll/cpl/timedate/timezone.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/timedate/timezone.c [iso-8859-1] Sat May 28 15:23:00 2016 @@ -73,7 +73,7 @@ DWORD dwValueSize; LONG lError; - dwValueSize = 128 * sizeof(WCHAR); + dwValueSize = sizeof(Entry->Description); lError = RegQueryValueExW(hZoneKey, L"Display", NULL, @@ -83,7 +83,7 @@ if (lError != ERROR_SUCCESS) return lError; - dwValueSize = 33 * sizeof(WCHAR); + dwValueSize = sizeof(Entry->StandardName); lError = RegQueryValueExW(hZoneKey, L"Std", NULL, @@ -93,7 +93,7 @@ if (lError != ERROR_SUCCESS) return lError; - dwValueSize = 33 * sizeof(WCHAR); + dwValueSize = sizeof(Entry->DaylightName); lError = RegQueryValueExW(hZoneKey, L"Dlt", NULL, @@ -103,7 +103,7 @@ if (lError != ERROR_SUCCESS) return lError; - dwValueSize = sizeof(TZ_INFO); + dwValueSize = sizeof(Entry->TimezoneInfo); lError = RegQueryValueExW(hZoneKey, L"TZI", NULL, @@ -371,7 +371,7 @@ 0, REG_DWORD, (LPBYTE)&dwValue, - sizeof(DWORD)); + sizeof(dwValue)); } else { @@ -401,7 +401,7 @@ hBitmap = LoadImageW(hApplet, MAKEINTRESOURCEW(IDC_WORLD), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); if (hBitmap != NULL) { - GetObjectW(hBitmap, sizeof(BITMAP), &bitmap); + GetObjectW(hBitmap, sizeof(bitmap), &bitmap); cxSource = bitmap.bmWidth; cySource = bitmap.bmHeight;
8 years, 7 months
1
0
0
0
[ekohl] 71434: [NETSHELL] German translation and fixed layout Patch by reactosfanboy. CORE-11278 #resolve #comment Thanks a lot!
by ekohl@svn.reactos.org
Author: ekohl Date: Sat May 28 00:18:39 2016 New Revision: 71434 URL:
http://svn.reactos.org/svn/reactos?rev=71434&view=rev
Log: [NETSHELL] German translation and fixed layout Patch by reactosfanboy. CORE-11278 #resolve #comment Thanks a lot! Modified: trunk/reactos/dll/shellext/netshell/lang/de-DE.rc Modified: trunk/reactos/dll/shellext/netshell/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/netshell/lang…
============================================================================== --- trunk/reactos/dll/shellext/netshell/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/dll/shellext/netshell/lang/de-DE.rc [iso-8859-1] Sat May 28 00:18:39 2016 @@ -36,12 +36,12 @@ LTEXT "Dauer:", -1, 19, 34, 60, 8 LTEXT "Ãbertragungsrate:", -1, 19, 48, 60, 8 GROUPBOX "Aktivität", -1, 9, 74, 182, 70, BS_GROUPBOX - RTEXT "Gesendet", -1, 26, 90, 60, 8 - ICON "", IDC_NETSTAT, 110, 85, 32, 32 - LTEXT "Empfangen", -1, 149, 90, 37, 8 + LTEXT "Gesendet", -1, 55, 90, 60, 8 + ICON "", IDC_NETSTAT, 105, 85, 32, 32 + RTEXT "Empfangen", -1, 137, 90, 44, 8 LTEXT "Bytes:", -1, 17, 115, 32, 8 - RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 - RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 44, 8 + LTEXT "000.000.000", IDC_SEND, 55, 115, 44, 8 + RTEXT "000.000.000", IDC_RECEIVED, 137, 115, 44, 8 PUSHBUTTON "E&igenschaften", IDC_STATUS_PROPERTIES, 10, 150, 50, 14 PUSHBUTTON "&Deaktivieren", IDC_ENDISABLE, 66, 150, 50, 14 RTEXT "", IDC_STATUS, 83, 20, 98, 8 @@ -82,11 +82,11 @@ FONT 8, "MS Shell Dlg" BEGIN ICON IDI_NET_SETUP, IDC_STATIC, 21, 10, 20, 20 - LTEXT "Choose whether to use typical or custom settings:", IDC_STATIC, 53, 7, 240, 20 - AUTORADIOBUTTON "Typical Settings", IDC_NETWORK_TYPICAL, 53, 27, 253, 20, WS_TABSTOP | WS_GROUP - AUTORADIOBUTTON "Custom Settings", IDC_NETWORK_CUSTOM, 53, 72, 253, 20, WS_TABSTOP - LTEXT "Creates network connetions using the Client for ReactOS Networks, File and Print Sharing for ReactOS Networks, and the TCP/IP transport protocol with automatic addressing.", IDC_STATIC, 65, 45, 240, 30 - LTEXT "Allows you to manually configure network components.", IDC_STATIC, 65, 90, 243, 20 + LTEXT "Wählen Sie, ob Standard- oder benutzerdefinierte Einstellungen verwendet werden sollen:", IDC_STATIC, 53, 7, 240, 20 + AUTORADIOBUTTON "Standardeinstellungen", IDC_NETWORK_TYPICAL, 53, 27, 253, 20, WS_TABSTOP | WS_GROUP + AUTORADIOBUTTON "Benutzerdefinierte Einstellungen", IDC_NETWORK_CUSTOM, 53, 72, 253, 20, WS_TABSTOP + LTEXT "Erstellt Netzwerkverbindungen unter Verwendung des Clients für ReactOS-Netzwerke, Datei- und Druckerfreigabe für ReactOS-Netzwerke und des TCP/IP-Transportprotokolls mit automatischer Adressierung.", IDC_STATIC, 65, 45, 240, 30 + LTEXT "Ermöglicht die manuelle Konfiguration von Netzwerkkomponenten.", IDC_STATIC, 65, 90, 243, 20 END IDD_NETWORKCOMPONENTPAGE DIALOGEX 0, 0, 317, 143 @@ -94,14 +94,14 @@ CAPTION "ReactOS Setup" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "For Device:", IDC_STATIC, 33, 2, 100, 20 + LTEXT "Für Gerät:", IDC_STATIC, 33, 2, 100, 20 LTEXT "n/a", IDC_NETWORK_DEVICE, 75, 2, 253, 20 - LTEXT "Components checked are used by this connection:", IDC_STATIC, 33, 12, 253, 20 - CONTROL "", IDC_COMPONENT_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 33, 22, 250, 50 - PUSHBUTTON "&Install...", IDC_NETWORK_INSTALL, 122, 75, 50, 14, WS_DISABLED | WS_TABSTOP - PUSHBUTTON "&Uninstall", IDC_NETWORK_UNINSTALL, 177, 75, 50, 14, WS_DISABLED | WS_TABSTOP - PUSHBUTTON "&Properties", IDC_NETWORK_PROPERTIES, 232, 75, 50, 14, WS_DISABLED | WS_TABSTOP - GROUPBOX "Description", IDC_STATIC, 33, 90, 250, 50, BS_GROUPBOX + LTEXT "Aktivierte Komponenten werden von dieser Verbindung verwendet:", IDC_STATIC, 33, 17, 253, 10 + CONTROL "", IDC_COMPONENT_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 33, 27, 250, 45 + PUSHBUTTON "I&nstallieren...", IDC_NETWORK_INSTALL, 122, 75, 50, 14, WS_DISABLED | WS_TABSTOP + PUSHBUTTON "&Deinstallieren", IDC_NETWORK_UNINSTALL, 177, 75, 50, 14, WS_DISABLED | WS_TABSTOP + PUSHBUTTON "Ei&genschaften", IDC_NETWORK_PROPERTIES, 232, 75, 50, 14, WS_DISABLED | WS_TABSTOP + GROUPBOX "Beschreibung", IDC_STATIC, 33, 90, 250, 50, BS_GROUPBOX END IDD_NETWORKDOMAINPAGE DIALOGEX 0, 0, 317, 143 @@ -109,13 +109,13 @@ CAPTION "ReactOS Setup" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "Do you want this computer to be a member of a domain?\n\ -(You can obtain this information from your network administator.)", IDC_STATIC, 33, 2, 263, 50 - AUTORADIOBUTTON "No, this computer will be part of a workgroup.", IDC_SELECT_WORKGROUP, 33, 32, 253, 20, WS_TABSTOP | WS_GROUP - AUTORADIOBUTTON "Yes, this computer will be part of a domain.", IDC_SELECT_DOMAIN, 33, 47, 253, 20, WS_TABSTOP - LTEXT "Workgroup or Domain Name:", IDC_STATIC, 33, 72, 126, 14 + LTEXT "Soll dieser Computer einer Domäne oder Arbeitsgruppe hinzugefügt werden?\n\ +(Domänen-Anmelde-Informationen müssen eventuell vom Netzwerkadministrator bezogen werden.)", IDC_STATIC, 33, 2, 263, 50 + AUTORADIOBUTTON "Diesen Computer folgender Arbeitsgruppe hinzufügen.", IDC_SELECT_WORKGROUP, 33, 32, 253, 20, WS_TABSTOP | WS_GROUP + AUTORADIOBUTTON "Diesen Computer folgender Domäne hinzufügen.", IDC_SELECT_DOMAIN, 33, 47, 253, 20, WS_TABSTOP + LTEXT "Arbeitsgruppe oder Domäne:", IDC_STATIC, 33, 72, 126, 14 EDITTEXT IDC_DOMAIN_NAME, 33, 82, 126, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL - LTEXT "NOTE: If this computer isn't going to be part of a network, you don't have sufficient rights to join a domain, or you don't know what to enter, then just choose workgroup for now. These options can be changed at a later time.", IDC_STATIC, 33, 107, 263, 50 + LTEXT "Hinweis: Soll dieser Computer nicht mit einem Netzwerk verbunden werden, ungenügend Rechte besitzen, einer Domäne beizutreten oder Sie schlicht nicht wissen, was Sie eingeben sollen, wählen Sie vorläufig Arbeitsgruppe.\nDiese Einstellung kann später jederzeit verändert werden.", IDC_STATIC, 33, 107, 263, 50 END STRINGTABLE @@ -165,12 +165,12 @@ STRINGTABLE BEGIN - IDS_NETWORKSETTINGSTITLE "Network Settings" - IDS_NETWORKSETTINGSSUBTITLE "Installs network software used to connect to other networks, computers, and the Internet." - IDS_NETWORKCOMPONENTTITLE "Network Components" - IDS_NETWORKCOMPONENTSUBTITLE "Determine which networking components are used on your computer. To add new components, click on Install." - IDS_NETWORKDOMAINTITLE "Workgroup or Computer Domain" - IDS_NETWORKDOMAINSUBTITLE "A domain is a group of computers defined by a network administator. A workgroup is a group of computers sharing the same workgroup name." + IDS_NETWORKSETTINGSTITLE "Netzwerkeinstellungen" + IDS_NETWORKSETTINGSSUBTITLE "Die Installation von Netzwerksoftware ermöglicht das Herstellen von Verbindungen mit anderen Computern, Netzwerken und dem Internet." + IDS_NETWORKCOMPONENTTITLE "Netzwerkkomponenten" + IDS_NETWORKCOMPONENTSUBTITLE "Wählen Sie die Netzwerkkomponenten, die aktiviert werden sollen. Klicken Sie auf ""Installieren"", um eine Komponente hinzuzufügen." + IDS_NETWORKDOMAINTITLE "Arbeitsgruppe oder Computerdomäne" + IDS_NETWORKDOMAINSUBTITLE "Eine Arbeitsgruppe besteht aus Computern mit gleichem Arbeitsgruppennamen.\nEine Domäne ist eine vom Netzwerkadministrator vorgegebene Computergruppe." IDS_REACTOS_SETUP "ReactOS Setup" - IDS_WZD_DOMAIN_NAME "Setup cannot continue until you\nenter the name of your domain\nor workgroup." + IDS_WZD_DOMAIN_NAME "Setup kann nicht fortgesetzt werden bevor Sie den Namen der Domäne oder Arbeitsgruppe festgelegt haben." END
8 years, 7 months
1
0
0
0
[ekohl] 71433: [TIMEDATE] Fixes and improvements to datetime CPL applet. Patch by Carlo Bramini. Replaced the original RegLocalQuery() by QueryTimezoneData() to simplify the error handling. Modific...
by ekohl@svn.reactos.org
Author: ekohl Date: Sat May 28 00:12:02 2016 New Revision: 71433 URL:
http://svn.reactos.org/svn/reactos?rev=71433&view=rev
Log: [TIMEDATE] Fixes and improvements to datetime CPL applet. Patch by Carlo Bramini. Replaced the original RegLocalQuery() by QueryTimezoneData() to simplify the error handling. Modification by Eric Kohl. CORE-11284 #resolve #comment Thanks a lot! Modified: trunk/reactos/dll/cpl/timedate/timezone.c Modified: trunk/reactos/dll/cpl/timedate/timezone.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/timedate/timezone.…
============================================================================== --- trunk/reactos/dll/cpl/timedate/timezone.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/timedate/timezone.c [iso-8859-1] Sat May 28 00:12:02 2016 @@ -24,11 +24,10 @@ { struct _TIMEZONE_ENTRY *Prev; struct _TIMEZONE_ENTRY *Next; - WCHAR Description[64]; /* 'Display' */ + WCHAR Description[128]; /* 'Display' */ WCHAR StandardName[33]; /* 'Std' */ WCHAR DaylightName[33]; /* 'Dlt' */ TZ_INFO TimezoneInfo; /* 'TZI' */ - ULONG Index; /* 'Index ' */ } TIMEZONE_ENTRY, *PTIMEZONE_ENTRY; @@ -38,21 +37,80 @@ PTIMEZONE_ENTRY TimeZoneListHead = NULL; PTIMEZONE_ENTRY TimeZoneListTail = NULL; -static PTIMEZONE_ENTRY -GetLargerTimeZoneEntry(DWORD Index) +static +PTIMEZONE_ENTRY +GetLargerTimeZoneEntry( + LONG Bias, + LPWSTR lpDescription) { PTIMEZONE_ENTRY Entry; Entry = TimeZoneListHead; while (Entry != NULL) { - if (Entry->Index >= Index) + if (Entry->TimezoneInfo.Bias > Bias) return Entry; + if (Entry->TimezoneInfo.Bias == Bias) + { + if (_wcsicmp(Entry->Description, lpDescription) > 0) + return Entry; + } + Entry = Entry->Next; } return NULL; +} + + +static +LONG +QueryTimezoneData( + HKEY hZoneKey, + PTIMEZONE_ENTRY Entry) +{ + DWORD dwValueSize; + LONG lError; + + dwValueSize = 128 * sizeof(WCHAR); + lError = RegQueryValueExW(hZoneKey, + L"Display", + NULL, + NULL, + (LPBYTE)&Entry->Description, + &dwValueSize); + if (lError != ERROR_SUCCESS) + return lError; + + dwValueSize = 33 * sizeof(WCHAR); + lError = RegQueryValueExW(hZoneKey, + L"Std", + NULL, + NULL, + (LPBYTE)&Entry->StandardName, + &dwValueSize); + if (lError != ERROR_SUCCESS) + return lError; + + dwValueSize = 33 * sizeof(WCHAR); + lError = RegQueryValueExW(hZoneKey, + L"Dlt", + NULL, + NULL, + (LPBYTE)&Entry->DaylightName, + &dwValueSize); + if (lError != ERROR_SUCCESS) + return lError; + + dwValueSize = sizeof(TZ_INFO); + lError = RegQueryValueExW(hZoneKey, + L"TZI", + NULL, + NULL, + (LPBYTE)&Entry->TimezoneInfo, + &dwValueSize); + return lError; } @@ -62,11 +120,9 @@ WCHAR szKeyName[256]; DWORD dwIndex; DWORD dwNameSize; - DWORD dwValueSize; LONG lError; HKEY hZonesKey; HKEY hZoneKey; - PTIMEZONE_ENTRY Entry; PTIMEZONE_ENTRY Current; @@ -77,10 +133,9 @@ &hZonesKey)) return; - dwIndex = 0; - while (TRUE) - { - dwNameSize = 256 * sizeof(WCHAR); + for (dwIndex = 0; ; dwIndex++) + { + dwNameSize = sizeof(szKeyName); lError = RegEnumKeyExW(hZonesKey, dwIndex, szKeyName, @@ -106,70 +161,16 @@ break; } - dwValueSize = 64 * sizeof(WCHAR); - lError = RegQueryValueExW(hZoneKey, - L"Display", - NULL, - NULL, - (LPBYTE)&Entry->Description, - &dwValueSize); + lError = QueryTimezoneData(hZoneKey, + Entry); + + RegCloseKey(hZoneKey); + if (lError != ERROR_SUCCESS) { - RegCloseKey(hZoneKey); - dwIndex++; HeapFree(GetProcessHeap(), 0, Entry); - continue; - } - - dwValueSize = 33 * sizeof(WCHAR); - if (RegQueryValueExW(hZoneKey, - L"Std", - NULL, - NULL, - (LPBYTE)&Entry->StandardName, - &dwValueSize)) - { - RegCloseKey(hZoneKey); - break; - } - - dwValueSize = 33 * sizeof(WCHAR); - if (RegQueryValueExW(hZoneKey, - L"Dlt", - NULL, - NULL, - (LPBYTE)&Entry->DaylightName, - &dwValueSize)) - { - RegCloseKey(hZoneKey); - break; - } - - dwValueSize = sizeof(DWORD); - if (RegQueryValueExW(hZoneKey, - L"Index", - NULL, - NULL, - (LPBYTE)&Entry->Index, - &dwValueSize)) - { - RegCloseKey(hZoneKey); - break; - } - - dwValueSize = sizeof(TZ_INFO); - if (RegQueryValueExW(hZoneKey, - L"TZI", - NULL, - NULL, - (LPBYTE)&Entry->TimezoneInfo, - &dwValueSize)) - { - RegCloseKey(hZoneKey); - break; - } - - RegCloseKey(hZoneKey); + break; + } if (TimeZoneListHead == NULL && TimeZoneListTail == NULL) @@ -181,7 +182,7 @@ } else { - Current = GetLargerTimeZoneEntry(Entry->Index); + Current = GetLargerTimeZoneEntry(Entry->TimezoneInfo.Bias, Entry->Description); if (Current != NULL) { if (Current == TimeZoneListHead) @@ -210,8 +211,6 @@ TimeZoneListTail = Entry; } } - - dwIndex++; } RegCloseKey(hZonesKey);
8 years, 7 months
1
0
0
0
[pschweitzer] 71432: [REISERFS] r71430, repetita
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Fri May 27 20:35:44 2016 New Revision: 71432 URL:
http://svn.reactos.org/svn/reactos?rev=71432&view=rev
Log: [REISERFS] r71430, repetita Removed: trunk/reactos/drivers/filesystems/reiserfs/inc/gplntifs.h [This mail would be too long, it was shortened to contain the URLs only.] Removed: trunk/reactos/drivers/filesystems/reiserfs/inc/gplntifs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/reiser…
8 years, 7 months
1
0
0
0
[pschweitzer] 71431: [DOC] Add a file to track imported FSD and their release
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Fri May 27 20:32:45 2016 New Revision: 71431 URL:
http://svn.reactos.org/svn/reactos?rev=71431&view=rev
Log: [DOC] Add a file to track imported FSD and their release Added: trunk/reactos/media/doc/README.FSD (with props) Added: trunk/reactos/media/doc/README.FSD URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.FSD?rev=7…
============================================================================== --- trunk/reactos/media/doc/README.FSD (added) +++ trunk/reactos/media/doc/README.FSD [iso-8859-1] Fri May 27 20:32:45 2016 @@ -0,0 +1,15 @@ +# ReactOS FSD porting/syncing reference file +# Update this file when you port/sync a FSD from an external source. + +The following FSD are shared with:
https://github.com/maharmstone/btrfs
. + +reactos/drivers/filesystems/btrfs # Synced to 0.4 + +The following FSD are shared with:
http://www.ext2fsd.com/
+ +reactos/drivers/filesystems/ext2 # Synced to 0.66 + +The following FSD are shared with:
http://www.acc.umu.se/~bosse/
+ +reactos/drivers/filesystems/ffs # Synced to 0.5.2 +reactos/drivers/filesystems/reiserfs # Synced to 0.26 Propchange: trunk/reactos/media/doc/README.FSD ------------------------------------------------------------------------------ svn:eol-style = native
8 years, 7 months
1
0
0
0
[pschweitzer] 71430: [FFS] We don't need that file CORE-11040
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Fri May 27 17:52:03 2016 New Revision: 71430 URL:
http://svn.reactos.org/svn/reactos?rev=71430&view=rev
Log: [FFS] We don't need that file CORE-11040 Removed: trunk/reactos/drivers/filesystems/ffs/inc/gplntifs.h [This mail would be too long, it was shortened to contain the URLs only.] Removed: trunk/reactos/drivers/filesystems/ffs/inc/gplntifs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ffs/in…
8 years, 7 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
26
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
Results per page:
10
25
50
100
200