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 2019
----- 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
17 participants
165 discussions
Start a n
N
ew thread
[reactos] 01/01: [WIN32SS][NTGDI] Wrap IntLPtoDP and IntDPtoLP macros by do { .... } while (0)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cb9a9fa9841e6c1c0e4ad…
commit cb9a9fa9841e6c1c0e4ada5bdca0539beea55db9 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat May 4 09:56:09 2019 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Sat May 4 09:56:09 2019 +0900 [WIN32SS][NTGDI] Wrap IntLPtoDP and IntDPtoLP macros by do { .... } while (0) --- win32ss/gdi/ntgdi/coord.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/win32ss/gdi/ntgdi/coord.h b/win32ss/gdi/ntgdi/coord.h index 9c7a75bbcd..6dcf58fc98 100644 --- a/win32ss/gdi/ntgdi/coord.h +++ b/win32ss/gdi/ntgdi/coord.h @@ -4,14 +4,16 @@ #define MIN_COORD (INT_MIN / 16) #define MAX_COORD (INT_MAX / 16) -#define IntLPtoDP(pdc, ppt, count) \ +#define IntLPtoDP(pdc, ppt, count) do { \ DC_vUpdateWorldToDevice(pdc); \ - DC_vXformWorldToDevice(pdc, count, (PPOINTL)(ppt), (PPOINTL)(ppt)); + DC_vXformWorldToDevice(pdc, count, (PPOINTL)(ppt), (PPOINTL)(ppt)); \ + } while (0) #define CoordLPtoDP(pdc, ppt) \ DC_vXformWorldToDevice(pdc, 1, (PPOINTL)(ppt), (PPOINTL)(ppt)); -#define IntDPtoLP(pdc, ppt, count) \ +#define IntDPtoLP(pdc, ppt, count) do { \ DC_vUpdateDeviceToWorld(pdc); \ - DC_vXformDeviceToWorld(pdc, count, (PPOINTL)(ppt), (PPOINTL)(ppt)); + DC_vXformDeviceToWorld(pdc, count, (PPOINTL)(ppt), (PPOINTL)(ppt)); \ + } while (0) #define CoordDPtoLP(pdc, ppt) \ DC_vXformDeviceToWorld(pdc, 1, (PPOINTL)(ppt), (PPOINTL)(ppt));
5 years, 7 months
1
0
0
0
[reactos] 01/01: [APPSHIM_APITEST] Fix 2k3 test failures
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1292f5f881c9897561a1a…
commit 1292f5f881c9897561a1a16d34abf595f5a56443 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Wed May 1 22:48:08 2019 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Thu May 2 22:07:49 2019 +0200 [APPSHIM_APITEST] Fix 2k3 test failures --- modules/rostests/apitests/appshim/genral_hooks.c | 6 +++-- modules/rostests/apitests/appshim/layer_hooks.c | 7 +++-- modules/rostests/apitests/appshim/versionlie.c | 34 +++++++++++++----------- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/modules/rostests/apitests/appshim/genral_hooks.c b/modules/rostests/apitests/appshim/genral_hooks.c index 2e9887c64b..6bc6ea3b8e 100644 --- a/modules/rostests/apitests/appshim/genral_hooks.c +++ b/modules/rostests/apitests/appshim/genral_hooks.c @@ -15,7 +15,6 @@ #include "appshim_apitest.h" static DWORD g_WinVersion; -#define WINVER_WIN8 0x0602 typedef struct expect_shim_hook @@ -36,7 +35,7 @@ static expect_shim_data data[] = { { L"IgnoreChromeSandbox", - WINVER_WIN8, + _WIN32_WINNT_WIN8, { { "KERNEL32.DLL", "CreateProcessW" }, } @@ -98,7 +97,10 @@ START_TEST(genral_hooks) PHOOKAPI hook = pGetHookAPIs("", current->ShimName, &num_shims); if (current->MinVersion > g_WinVersion && !hook) + { + skip("Shim %s not present\n", wine_dbgstr_w(current->ShimName)); continue; + } ok(!!hook, "Expected a valid pointer, got nothing for %s\n", wine_dbgstr_w(current->ShimName)); ok(num_shims == expected_shims, "Expected %u shims, got %u for %s\n", diff --git a/modules/rostests/apitests/appshim/layer_hooks.c b/modules/rostests/apitests/appshim/layer_hooks.c index 1a0126b311..31f5fa1800 100644 --- a/modules/rostests/apitests/appshim/layer_hooks.c +++ b/modules/rostests/apitests/appshim/layer_hooks.c @@ -47,7 +47,7 @@ static expect_shim_data data[] = }, { L"VerifyVersionInfoLite", - 0, + _WIN32_WINNT_VISTA, { { "KERNEL32.DLL", "VerifyVersionInfoA" }, { "KERNEL32.DLL", "VerifyVersionInfoW" }, @@ -56,7 +56,7 @@ static expect_shim_data data[] = /* Show that it is not case sensitive */ { L"VeRiFyVeRsIoNInFoLiTe", - 0, + _WIN32_WINNT_VISTA, { { "KERNEL32.DLL", "VerifyVersionInfoA" }, { "KERNEL32.DLL", "VerifyVersionInfoW" }, @@ -109,7 +109,10 @@ START_TEST(layer_hooks) PHOOKAPI hook = pGetHookAPIs("", current->ShimName, &num_shims); if (current->MinVersion > g_WinVersion && !hook) + { + skip("Shim %s not present\n", wine_dbgstr_w(current->ShimName)); continue; + } ok(!!hook, "Expected a valid pointer, got nothing for %s\n", wine_dbgstr_w(current->ShimName)); ok(num_shims == expected_shims, "Expected %u shims, got %u for %s\n", diff --git a/modules/rostests/apitests/appshim/versionlie.c b/modules/rostests/apitests/appshim/versionlie.c index 328190668b..f7605f2e7c 100644 --- a/modules/rostests/apitests/appshim/versionlie.c +++ b/modules/rostests/apitests/appshim/versionlie.c @@ -22,8 +22,9 @@ static tGETHOOKAPIS pGetHookAPIs; static DWORD g_WinVersion; -#define WINVER_WINXP 0x0501 +#define FLAG_BUGGY_ServicePackMajorMinor 1 +#define FLAG_AlternateHookOrder 2 typedef struct VersionLieInfo { @@ -34,6 +35,7 @@ typedef struct VersionLieInfo DWORD dwPlatformId; WORD wServicePackMajor; WORD wServicePackMinor; + WORD wFlags; } VersionLieInfo; typedef BOOL(WINAPI* GETVERSIONEXAPROC)(LPOSVERSIONINFOEXA); @@ -83,7 +85,7 @@ static void verify_shima_imp(PHOOKAPI hook, const VersionLieInfo* info, PCSTR sh if (v1.dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXA)) { - if (info->dwPlatformId != VER_PLATFORM_WIN32_WINDOWS) + if (!(info->wFlags & FLAG_BUGGY_ServicePackMajorMinor)) { winetest_ok(info->wServicePackMajor == v2.wServicePackMajor, "Expected wServicePackMajor to be equal, was: %i, %i for %s\n", info->wServicePackMajor, v2.wServicePackMajor, shim); winetest_ok(info->wServicePackMinor == v2.wServicePackMinor, "Expected wServicePackMinor to be equal, was: %i, %i for %s\n", info->wServicePackMinor, v2.wServicePackMinor, shim); @@ -155,7 +157,7 @@ static void verify_shimw_imp(PHOOKAPI hook, const VersionLieInfo* info, PCSTR sh if (v1.dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXW)) { - if (info->dwPlatformId != VER_PLATFORM_WIN32_WINDOWS) + if (!(info->wFlags & FLAG_BUGGY_ServicePackMajorMinor)) { winetest_ok(info->wServicePackMajor == v2.wServicePackMajor, "Expected wServicePackMajor to be equal, was: %i, %i for %s\n", info->wServicePackMajor, v2.wServicePackMajor, shim); winetest_ok(info->wServicePackMinor == v2.wServicePackMinor, "Expected wServicePackMinor to be equal, was: %i, %i for %s\n", info->wServicePackMinor, v2.wServicePackMinor, shim); @@ -222,24 +224,24 @@ static void run_test(LPCSTR shim, const VersionLieInfo* info) return; } ok(hook != NULL, "Expected hook to be a valid pointer for %s\n", shim); - if (info->dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) + if (info->wFlags & FLAG_AlternateHookOrder) { ok(num_shims == 3, "Expected num_shims to be 3, was: %u for %s\n", num_shims, shim); if (hook && num_shims == 3) { - int off = info->dwBuildNumber == 0x040A08AE ? 0 : 1, same = 0; - expect_shim(hook + ((0+off)%3), "KERNEL32.DLL", "GetVersionExA", shim, &same); - verify_shima(hook + ((0+off)%3), info, shim, same); - expect_shim(hook + ((1+off)%3), "KERNEL32.DLL", "GetVersionExW", shim, &same); - verify_shimw(hook + ((1+off)%3), info, shim, same, 0); - expect_shim(hook + ((2+off)%3), "KERNEL32.DLL", "GetVersion", shim, &same); - verify_shim(hook + ((2+off)%3), info, shim, same); + int same = 0; + expect_shim(hook + 0, "KERNEL32.DLL", "GetVersion", shim, &same); + verify_shim(hook + 0, info, shim, same); + expect_shim(hook + 1, "KERNEL32.DLL", "GetVersionExA", shim, &same); + verify_shima(hook + 1, info, shim, same); + expect_shim(hook + 2, "KERNEL32.DLL", "GetVersionExW", shim, &same); + verify_shimw(hook + 2, info, shim, same, 0); } } else { - int shimnum_ok = num_shims == 4 || ((ver < WINVER_WINXP) && (num_shims == 3)); - ok(shimnum_ok, "Expected num_shims to be 4%s, was: %u for %s\n", ((ver < WINVER_WINXP) ? " or 3":""), num_shims, shim); + int shimnum_ok = num_shims == 4 || ((ver < _WIN32_WINNT_WINXP) && (num_shims == 3)); + ok(shimnum_ok, "Expected num_shims to be 4%s, was: %u for %s\n", ((ver < _WIN32_WINNT_WINXP) ? " or 3":""), num_shims, shim); if (hook && shimnum_ok) { int same = 0; @@ -259,9 +261,9 @@ static void run_test(LPCSTR shim, const VersionLieInfo* info) } -VersionLieInfo g_Win95 = { 0xC3B60004, 4, 0, 950, VER_PLATFORM_WIN32_WINDOWS, 0, 0 }; -VersionLieInfo g_WinNT4SP5 = { 0x05650004, 4, 0, 1381, VER_PLATFORM_WIN32_NT, 5, 0 }; -VersionLieInfo g_Win98 = { 0xC0000A04, 4, 10, 0x040A08AE, VER_PLATFORM_WIN32_WINDOWS, 0, 0 }; +VersionLieInfo g_Win95 = { 0xC3B60004, 4, 0, 950, VER_PLATFORM_WIN32_WINDOWS, 0, 0, FLAG_BUGGY_ServicePackMajorMinor | FLAG_AlternateHookOrder }; +VersionLieInfo g_WinNT4SP5 = { 0x05650004, 4, 0, 1381, VER_PLATFORM_WIN32_NT, 5, 0, FLAG_BUGGY_ServicePackMajorMinor }; +VersionLieInfo g_Win98 = { 0xC0000A04, 4, 10, 0x040A08AE, VER_PLATFORM_WIN32_WINDOWS, 0, 0, FLAG_BUGGY_ServicePackMajorMinor }; VersionLieInfo g_Win2000 = { 0x08930005, 5, 0, 2195, VER_PLATFORM_WIN32_NT, 0, 0 }; VersionLieInfo g_Win2000SP1 = { 0x08930005, 5, 0, 2195, VER_PLATFORM_WIN32_NT, 1, 0 };
5 years, 7 months
1
0
0
0
[reactos] 01/01: [HIDParser] Fix MSVC build
by jimtabor
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b3b40b35c9e1e7110396d…
commit b3b40b35c9e1e7110396d21b9dd664922ae2e156 Author: jimtabor <james.tabor(a)reactos.org> AuthorDate: Thu May 2 14:33:07 2019 -0500 Commit: jimtabor <james.tabor(a)reactos.org> CommitDate: Thu May 2 14:33:07 2019 -0500 [HIDParser] Fix MSVC build Attempt to fix build for MSVC. This effected local build GCC system with newer Ninja version. Not sure if this has an effect. --- sdk/lib/drivers/hidparser/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/sdk/lib/drivers/hidparser/CMakeLists.txt b/sdk/lib/drivers/hidparser/CMakeLists.txt index 783a67d671..2a032e6e87 100644 --- a/sdk/lib/drivers/hidparser/CMakeLists.txt +++ b/sdk/lib/drivers/hidparser/CMakeLists.txt @@ -13,9 +13,7 @@ list(APPEND SOURCE add_library(hidparser_um ${SOURCE}) add_importlibs(hidparser_um ntdll) add_dependencies(hidparser_um bugcodes xdk) -add_pch(hidparser_um parser.h SOURCE) add_library(hidparser_km ${SOURCE}) add_importlibs(hidparser_km ntoskrnl) add_dependencies(hidparser_km bugcodes xdk) -add_pch(hidparser_km parser.h SOURCE)
5 years, 7 months
1
0
0
0
[reactos] 01/01: [POWERPROF] ValidatePowerPolicies: Do not fail because of legal power states which were set by FixSystemPowerState.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5164c852e853ba2530c55…
commit 5164c852e853ba2530c55ac974799364b241b3db Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Thu May 2 20:21:32 2019 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Thu May 2 20:39:58 2019 +0200 [POWERPROF] ValidatePowerPolicies: Do not fail because of legal power states which were set by FixSystemPowerState. --- dll/win32/powrprof/powrprof.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dll/win32/powrprof/powrprof.c b/dll/win32/powrprof/powrprof.c index d176c2ae04..287c09769a 100644 --- a/dll/win32/powrprof/powrprof.c +++ b/dll/win32/powrprof/powrprof.c @@ -874,7 +874,7 @@ ValidatePowerPolicies(PGLOBAL_POWER_POLICY pGPP, PPOWER_POLICY pPP) SetLastError(ERROR_GEN_FAILURE); return FALSE; } - if ((int)pGPP->mach.LidOpenWakeAc >= PowerSystemShutdown) + if ((int)pGPP->mach.LidOpenWakeAc > PowerSystemShutdown) { SetLastError(ERROR_GEN_FAILURE); return FALSE; @@ -884,7 +884,7 @@ ValidatePowerPolicies(PGLOBAL_POWER_POLICY pGPP, PPOWER_POLICY pPP) SetLastError(ERROR_GEN_FAILURE); return FALSE; } - if ((int)pGPP->mach.LidOpenWakeDc >= PowerSystemShutdown) + if ((int)pGPP->mach.LidOpenWakeDc > PowerSystemShutdown) { SetLastError(ERROR_GEN_FAILURE); return FALSE; @@ -963,22 +963,22 @@ ValidatePowerPolicies(PGLOBAL_POWER_POLICY pGPP, PPOWER_POLICY pPP) SetLastError(ERROR_GEN_FAILURE); return FALSE; } - if (pPP->mach.ReducedLatencySleepAc == PowerSystemUnspecified) + if ((int)pPP->mach.ReducedLatencySleepAc == PowerSystemUnspecified) { SetLastError(ERROR_GEN_FAILURE); return FALSE; } - if ((int)pPP->mach.ReducedLatencySleepAc >= PowerSystemShutdown) + if ((int)pPP->mach.ReducedLatencySleepAc > PowerSystemShutdown) { SetLastError(ERROR_GEN_FAILURE); return FALSE; } - if (pPP->mach.ReducedLatencySleepDc < PowerSystemWorking) + if ((int)pPP->mach.ReducedLatencySleepDc < PowerSystemWorking) { SetLastError(ERROR_GEN_FAILURE); return FALSE; } - if ((int)pPP->mach.ReducedLatencySleepDc >= PowerSystemShutdown) + if ((int)pPP->mach.ReducedLatencySleepDc > PowerSystemShutdown) { SetLastError(ERROR_GEN_FAILURE); return FALSE;
5 years, 7 months
1
0
0
0
[reactos] 04/04: [HID] Use hidparser static library for HidP_* functions
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7033ab18dfa936168a279…
commit 7033ab18dfa936168a279913035587858dd143e7 Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Sat Apr 27 14:17:10 2019 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Thu May 2 20:06:47 2019 +0200 [HID] Use hidparser static library for HidP_* functions hid.dll and hidparse.sys must understand the same HID preparsed data, so use the same code in hid.dll and in hidparse.sys At the same time, this permis implementation of some HidP_* functions. --- dll/win32/hid/CMakeLists.txt | 5 +- dll/win32/hid/hid.c | 103 ++++----- dll/win32/hid/stubs.c | 378 ------------------------------- sdk/lib/drivers/hidparser/CMakeLists.txt | 5 + 4 files changed, 59 insertions(+), 432 deletions(-) diff --git a/dll/win32/hid/CMakeLists.txt b/dll/win32/hid/CMakeLists.txt index edc34638fa..1c5e6e4dc9 100644 --- a/dll/win32/hid/CMakeLists.txt +++ b/dll/win32/hid/CMakeLists.txt @@ -3,9 +3,11 @@ spec2def(hid.dll hid.spec ADD_IMPORTLIB) list(APPEND SOURCE hid.c - stubs.c precomp.h) +include_directories( + ${REACTOS_SOURCE_DIR}/sdk/lib/drivers/hidparser) + add_library(hid MODULE ${SOURCE} hid.rc @@ -13,5 +15,6 @@ add_library(hid MODULE set_module_type(hid win32dll UNICODE) add_importlibs(hid msvcrt kernel32 ntdll) +target_link_libraries(hid hidparser_um) add_pch(hid precomp.h SOURCE) add_cd_file(TARGET hid DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/hid/hid.c b/dll/win32/hid/hid.c index a73b9e592a..50e1bf431b 100644 --- a/dll/win32/hid/hid.c +++ b/dll/win32/hid/hid.c @@ -27,17 +27,67 @@ */ #include "precomp.h" +#include <stdarg.h> #include <winbase.h> #define NDEBUG #include <debug.h> +#include "hidp.h" HINSTANCE hDllInstance; /* device interface GUID for HIDClass devices */ const GUID HidClassGuid = {0x4D1E55B2, 0xF16F, 0x11CF, {0x88,0xCB,0x00,0x11,0x11,0x00,0x00,0x30}}; +PVOID +NTAPI +AllocFunction( + IN ULONG ItemSize) +{ + return LocalAlloc(LHND, ItemSize); +} + +VOID +NTAPI +FreeFunction( + IN PVOID Item) +{ + LocalFree((HLOCAL)Item); +} + +VOID +NTAPI +ZeroFunction( + IN PVOID Item, + IN ULONG ItemSize) +{ + memset(Item, 0, ItemSize); +} + +VOID +NTAPI +CopyFunction( + IN PVOID Target, + IN PVOID Source, + IN ULONG Length) +{ + memcpy(Target, Source, Length); +} + +VOID +__cdecl +DebugFunction( + IN LPCSTR FormatStr, ...) +{ +#if 0 + va_arg list; + va_start(list, FormatStr); + vDbgPrintEx(FormatStr, list); + va_end(list); +#endif +} + BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, @@ -123,23 +173,6 @@ HidD_GetAttributes(IN HANDLE HidDeviceObject, } -/* - * HidP_GetButtonCaps EXPORTED - * - * @implemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_GetButtonCaps(IN HIDP_REPORT_TYPE ReportType, - OUT PHIDP_BUTTON_CAPS ButtonCaps, - IN OUT PUSHORT ButtonCapsLength, - IN PHIDP_PREPARSED_DATA PreparsedData) -{ - return HidP_GetSpecificButtonCaps(ReportType, 0, 0, 0, ButtonCaps, - ButtonCapsLength, PreparsedData); -} - - /* * HidD_GetFeature EXPORTED * @@ -340,23 +373,6 @@ HidD_GetSerialNumberString(IN HANDLE HidDeviceObject, } -/* - * HidP_GetValueCaps EXPORTED - * - * @implemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_GetValueCaps(IN HIDP_REPORT_TYPE ReportType, - OUT PHIDP_VALUE_CAPS ValueCaps, - IN OUT PUSHORT ValueCapsLength, - IN PHIDP_PREPARSED_DATA PreparsedData) -{ - return HidP_GetSpecificValueCaps(ReportType, 0, 0, 0, ValueCaps, - ValueCapsLength, PreparsedData); -} - - /* * HidD_Hello EXPORTED * @@ -525,23 +541,4 @@ HidD_SetConfiguration(IN HANDLE HidDeviceObject, return Ret; } -/* - * HidP_GetUsagesEx EXPORTED - * - * @implemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_GetUsagesEx(IN HIDP_REPORT_TYPE ReportType, - IN USHORT LinkCollection, - OUT PUSAGE_AND_PAGE ButtonList, - IN OUT ULONG *UsageLength, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN PCHAR Report, - IN ULONG ReportLength) -{ - return HidP_GetUsages(ReportType, ButtonList->UsagePage, LinkCollection, &ButtonList->Usage, UsageLength, PreparsedData, Report, ReportLength); -} - - /* EOF */ diff --git a/dll/win32/hid/stubs.c b/dll/win32/hid/stubs.c deleted file mode 100644 index b086ac877a..0000000000 --- a/dll/win32/hid/stubs.c +++ /dev/null @@ -1,378 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS Hid User Library - * FILE: lib/hid/stubs.c - * PURPOSE: hid.dll stubs - * NOTES: If you implement a function, remove it from this file - * - * UPDATE HISTORY: - * 07/12/2004 Created - */ - -#include "precomp.h" - -#define NDEBUG -#include <debug.h> - -/* - * @unimplemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_GetCaps(IN PHIDP_PREPARSED_DATA PreparsedData, - OUT PHIDP_CAPS Capabilities) -{ - UNIMPLEMENTED; - return HIDP_STATUS_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_GetData(IN HIDP_REPORT_TYPE ReportType, - OUT PHIDP_DATA DataList, - IN OUT PULONG DataLength, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - return HIDP_STATUS_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_GetExtendedAttributes(IN HIDP_REPORT_TYPE ReportType, - IN USHORT DataIndex, - IN PHIDP_PREPARSED_DATA PreparsedData, - OUT PHIDP_EXTENDED_ATTRIBUTES Attributes, - IN OUT PULONG LengthAttributes) -{ - UNIMPLEMENTED; - return HIDP_STATUS_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_GetLinkCollectionNodes(OUT PHIDP_LINK_COLLECTION_NODE LinkCollectionNodes, - IN OUT PULONG LinkCollectionNodesLength, - IN PHIDP_PREPARSED_DATA PreparsedData) -{ - UNIMPLEMENTED; - return HIDP_STATUS_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_GetScaledUsageValue(IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection OPTIONAL, - IN USAGE Usage, - OUT PLONG UsageValue, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - return HIDP_STATUS_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_GetSpecificButtonCaps(IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection, - IN USAGE Usage, - OUT PHIDP_BUTTON_CAPS ButtonCaps, - IN OUT PUSHORT ButtonCapsLength, - IN PHIDP_PREPARSED_DATA PreparsedData) -{ - UNIMPLEMENTED; - return HIDP_STATUS_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_GetSpecificValueCaps(IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection, - IN USAGE Usage, - OUT PHIDP_VALUE_CAPS ValueCaps, - IN OUT PUSHORT ValueCapsLength, - IN PHIDP_PREPARSED_DATA PreparsedData) -{ - UNIMPLEMENTED; - return HIDP_STATUS_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_GetUsageValue(IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection, - IN USAGE Usage, - OUT PULONG UsageValue, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - return HIDP_STATUS_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_GetUsageValueArray(IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection OPTIONAL, - IN USAGE Usage, - OUT PCHAR UsageValue, - IN USHORT UsageValueByteLength, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - return HIDP_STATUS_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_GetUsages(IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection OPTIONAL, - OUT USAGE *UsageList, - IN OUT ULONG *UsageLength, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - return HIDP_STATUS_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_InitializeReportForID(IN HIDP_REPORT_TYPE ReportType, - IN UCHAR ReportID, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN OUT PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - return HIDP_STATUS_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -HIDAPI -ULONG WINAPI -HidP_MaxDataListLength(IN HIDP_REPORT_TYPE ReportType, - IN PHIDP_PREPARSED_DATA PreparsedData) -{ - UNIMPLEMENTED; - return 0; -} - - -/* - * @unimplemented - */ -HIDAPI -ULONG WINAPI -HidP_MaxUsageListLength(IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage OPTIONAL, - IN PHIDP_PREPARSED_DATA PreparsedData) -{ - UNIMPLEMENTED; - return 0; -} - - -/* - * @unimplemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_SetData(IN HIDP_REPORT_TYPE ReportType, - IN PHIDP_DATA DataList, - IN OUT PULONG DataLength, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN OUT PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - return HIDP_STATUS_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_SetScaledUsageValue(IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection OPTIONAL, - IN USAGE Usage, - IN LONG UsageValue, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN OUT PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - return HIDP_STATUS_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_SetUsageValue(IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection, - IN USAGE Usage, - IN ULONG UsageValue, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN OUT PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - return HIDP_STATUS_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_SetUsageValueArray(IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection OPTIONAL, - IN USAGE Usage, - IN PCHAR UsageValue, - IN USHORT UsageValueByteLength, - IN PHIDP_PREPARSED_DATA PreparsedData, - OUT PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - return HIDP_STATUS_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_SetUsages(IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection OPTIONAL, - IN PUSAGE UsageList, - IN OUT PULONG UsageLength, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN OUT PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - return HIDP_STATUS_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_TranslateUsagesToI8042ScanCodes(IN PUSAGE ChangedUsageList, - IN ULONG UsageListLength, - IN HIDP_KEYBOARD_DIRECTION KeyAction, - IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState, - IN PHIDP_INSERT_SCANCODES InsertCodesProcedure, - IN PVOID InsertCodesContext) -{ - UNIMPLEMENTED; - return HIDP_STATUS_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_UnsetUsages(IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection OPTIONAL, - IN PUSAGE UsageList, - IN OUT PULONG UsageLength, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN OUT PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - return HIDP_STATUS_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -HIDAPI -NTSTATUS WINAPI -HidP_UsageListDifference(IN PUSAGE PreviousUsageList, - IN PUSAGE CurrentUsageList, - OUT PUSAGE BreakUsageList, - OUT PUSAGE MakeUsageList, - IN ULONG UsageListLength) -{ - UNIMPLEMENTED; - return HIDP_STATUS_NOT_IMPLEMENTED; -} - -/* EOF */ diff --git a/sdk/lib/drivers/hidparser/CMakeLists.txt b/sdk/lib/drivers/hidparser/CMakeLists.txt index ba03f996e5..783a67d671 100644 --- a/sdk/lib/drivers/hidparser/CMakeLists.txt +++ b/sdk/lib/drivers/hidparser/CMakeLists.txt @@ -10,6 +10,11 @@ list(APPEND SOURCE hidp.c hidp.h) +add_library(hidparser_um ${SOURCE}) +add_importlibs(hidparser_um ntdll) +add_dependencies(hidparser_um bugcodes xdk) +add_pch(hidparser_um parser.h SOURCE) + add_library(hidparser_km ${SOURCE}) add_importlibs(hidparser_km ntoskrnl) add_dependencies(hidparser_km bugcodes xdk)
5 years, 7 months
1
0
0
0
[reactos] 03/04: [HIDPARSE/HIDPARSER] Move HidP_* functions from hidparse.sys to hidparser library
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2978d4b61b206eee4dc6c…
commit 2978d4b61b206eee4dc6c2e46dca92e4bcce3e94 Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Sat Apr 27 11:19:46 2019 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Thu May 2 20:06:47 2019 +0200 [HIDPARSE/HIDPARSER] Move HidP_* functions from hidparse.sys to hidparser library Interface between both is not anymore the HidParser_* functions, but the HidP_* functions and the AllocFunction/FreeFunction/DebugFunctions/ ZeroFunction/CopyFunction. --- drivers/hid/hidparse/CMakeLists.txt | 2 +- drivers/hid/hidparse/hidparse.c | 588 +-------------------- drivers/hid/hidparse/hidparse.h | 1 - sdk/lib/drivers/hidparser/CMakeLists.txt | 11 +- .../hidparse.c => sdk/lib/drivers/hidparser/hidp.c | 102 +--- sdk/lib/drivers/hidparser/hidp.h | 6 + sdk/lib/drivers/hidparser/hidparser.h | 2 +- 7 files changed, 23 insertions(+), 689 deletions(-) diff --git a/drivers/hid/hidparse/CMakeLists.txt b/drivers/hid/hidparse/CMakeLists.txt index 57cabdbb3c..af02183db0 100644 --- a/drivers/hid/hidparse/CMakeLists.txt +++ b/drivers/hid/hidparse/CMakeLists.txt @@ -10,5 +10,5 @@ include_directories( add_library(hidparse MODULE hidparse.c hidparse.rc ${CMAKE_CURRENT_BINARY_DIR}/hidparse.def) set_module_type(hidparse kernelmodedriver) add_importlibs(hidparse ntoskrnl) -target_link_libraries(hidparse hidparser) +target_link_libraries(hidparse hidparser_km) add_cd_file(TARGET hidparse DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/hid/hidparse/hidparse.c b/drivers/hid/hidparse/hidparse.c index bc8e856605..cdfbb1ed83 100644 --- a/drivers/hid/hidparse/hidparse.c +++ b/drivers/hid/hidparse/hidparse.c @@ -9,6 +9,7 @@ */ #include "hidparse.h" +#include "hidp.h" #define NDEBUG #include <debug.h> @@ -86,593 +87,6 @@ DebugFunction( #endif } -VOID -NTAPI -HidP_FreeCollectionDescription( - IN PHIDP_DEVICE_DESC DeviceDescription) -{ - HID_PARSER Parser; - - // - // init parser - // - HidParser_InitParser(AllocFunction, FreeFunction, ZeroFunction, CopyFunction, DebugFunction, &Parser); - - // - // free collection - // - HidParser_FreeCollectionDescription(&Parser, DeviceDescription); -} - - -HIDAPI -NTSTATUS -NTAPI -HidP_GetCaps( - IN PHIDP_PREPARSED_DATA PreparsedData, - OUT PHIDP_CAPS Capabilities) -{ - HID_PARSER Parser; - - // - // init parser - // - HidParser_InitParser(AllocFunction, FreeFunction, ZeroFunction, CopyFunction, DebugFunction, &Parser); - - // - // get caps - // - return HidParser_GetCaps(&Parser, PreparsedData, Capabilities); -} - -NTSTATUS -TranslateStatusForUpperLayer( - IN HIDPARSER_STATUS Status) -{ - // - // now we are handling only this values, for others just return - // status as it is. - // - switch (Status) - { - case HIDPARSER_STATUS_INSUFFICIENT_RESOURCES: - return STATUS_INSUFFICIENT_RESOURCES; - case HIDPARSER_STATUS_INVALID_REPORT_TYPE: - return HIDP_STATUS_INVALID_REPORT_TYPE; - case HIDPARSER_STATUS_BUFFER_TOO_SMALL: - return STATUS_BUFFER_TOO_SMALL; - case HIDPARSER_STATUS_COLLECTION_NOT_FOUND: - return STATUS_NO_DATA_DETECTED; - default: - return Status; - } -} - -NTSTATUS -NTAPI -HidP_GetCollectionDescription( - IN PHIDP_REPORT_DESCRIPTOR ReportDesc, - IN ULONG DescLength, - IN POOL_TYPE PoolType, - OUT PHIDP_DEVICE_DESC DeviceDescription) -{ - HID_PARSER Parser; - NTSTATUS Status; - - // - // init parser - // - HidParser_InitParser(AllocFunction, FreeFunction, ZeroFunction, CopyFunction, DebugFunction, &Parser); - - // - // get description; - // - Status = HidParser_GetCollectionDescription(&Parser, ReportDesc, DescLength, PoolType, DeviceDescription); - return TranslateStatusForUpperLayer(Status); -} - -HIDAPI -ULONG -NTAPI -HidP_MaxUsageListLength( - IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage OPTIONAL, - IN PHIDP_PREPARSED_DATA PreparsedData) -{ - HID_PARSER Parser; - - // - // sanity check - // - ASSERT(ReportType == HidP_Input || ReportType == HidP_Output || ReportType == HidP_Feature); - - // - // init parser - // - HidParser_InitParser(AllocFunction, FreeFunction, ZeroFunction, CopyFunction, DebugFunction, &Parser); - - - // - // get usage length - // - return HidParser_MaxUsageListLength(&Parser, PreparsedData, ReportType, UsagePage); -} - -HIDAPI -NTSTATUS -NTAPI -HidP_GetSpecificValueCaps( - IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection, - IN USAGE Usage, - OUT PHIDP_VALUE_CAPS ValueCaps, - IN OUT PUSHORT ValueCapsLength, - IN PHIDP_PREPARSED_DATA PreparsedData) -{ - HID_PARSER Parser; - - // - // sanity check - // - ASSERT(ReportType == HidP_Input || ReportType == HidP_Output || ReportType == HidP_Feature); - - // - // init parser - // - HidParser_InitParser(AllocFunction, FreeFunction, ZeroFunction, CopyFunction, DebugFunction, &Parser); - - // - // get value caps - // - return HidParser_GetSpecificValueCaps(&Parser, PreparsedData, ReportType, UsagePage, LinkCollection, Usage, ValueCaps, ValueCapsLength); -} - -HIDAPI -NTSTATUS -NTAPI -HidP_GetUsages( - IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection OPTIONAL, - OUT PUSAGE UsageList, - IN OUT PULONG UsageLength, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN PCHAR Report, - IN ULONG ReportLength) -{ - HID_PARSER Parser; - - // - // sanity check - // - ASSERT(ReportType == HidP_Input || ReportType == HidP_Output || ReportType == HidP_Feature); - - // - // init parser - // - HidParser_InitParser(AllocFunction, FreeFunction, ZeroFunction, CopyFunction, DebugFunction, &Parser); - - // - // get usages - // - return HidParser_GetUsages(&Parser, PreparsedData, ReportType, UsagePage, LinkCollection, UsageList, UsageLength, Report, ReportLength); -} - - -#undef HidP_GetButtonCaps - -HIDAPI -NTSTATUS -NTAPI -HidP_UsageListDifference( - IN PUSAGE PreviousUsageList, - IN PUSAGE CurrentUsageList, - OUT PUSAGE BreakUsageList, - OUT PUSAGE MakeUsageList, - IN ULONG UsageListLength) -{ - return HidParser_UsageListDifference(PreviousUsageList, CurrentUsageList, BreakUsageList, MakeUsageList, UsageListLength); -} - -HIDAPI -NTSTATUS -NTAPI -HidP_GetUsagesEx( - IN HIDP_REPORT_TYPE ReportType, - IN USHORT LinkCollection, - OUT PUSAGE_AND_PAGE ButtonList, - IN OUT ULONG *UsageLength, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN PCHAR Report, - IN ULONG ReportLength) -{ - return HidP_GetUsages(ReportType, HID_USAGE_PAGE_UNDEFINED, LinkCollection, &ButtonList->Usage, UsageLength, PreparsedData, Report, ReportLength); -} - -HIDAPI -NTSTATUS -NTAPI -HidP_UsageAndPageListDifference( - IN PUSAGE_AND_PAGE PreviousUsageList, - IN PUSAGE_AND_PAGE CurrentUsageList, - OUT PUSAGE_AND_PAGE BreakUsageList, - OUT PUSAGE_AND_PAGE MakeUsageList, - IN ULONG UsageListLength) -{ - return HidParser_UsageAndPageListDifference(PreviousUsageList, CurrentUsageList, BreakUsageList, MakeUsageList, UsageListLength); -} - -HIDAPI -NTSTATUS -NTAPI -HidP_GetScaledUsageValue( - IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection OPTIONAL, - IN USAGE Usage, - OUT PLONG UsageValue, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN PCHAR Report, - IN ULONG ReportLength) -{ - HID_PARSER Parser; - - // - // sanity check - // - ASSERT(ReportType == HidP_Input || ReportType == HidP_Output || ReportType == HidP_Feature); - - // - // init parser - // - HidParser_InitParser(AllocFunction, FreeFunction, ZeroFunction, CopyFunction, DebugFunction, &Parser); - - // - // get scaled usage value - // - return HidParser_GetScaledUsageValue(&Parser, PreparsedData, ReportType, UsagePage, LinkCollection, Usage, UsageValue, Report, ReportLength); -} - -HIDAPI -NTSTATUS -NTAPI -HidP_GetUsageValue( - IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection, - IN USAGE Usage, - OUT PULONG UsageValue, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN PCHAR Report, - IN ULONG ReportLength) -{ - HID_PARSER Parser; - - // - // sanity check - // - ASSERT(ReportType == HidP_Input || ReportType == HidP_Output || ReportType == HidP_Feature); - - // - // init parser - // - HidParser_InitParser(AllocFunction, FreeFunction, ZeroFunction, CopyFunction, DebugFunction, &Parser); - - // - // get scaled usage value - // - return HidParser_GetUsageValue(&Parser, PreparsedData, ReportType, UsagePage, LinkCollection, Usage, UsageValue, Report, ReportLength); -} - - -HIDAPI -NTSTATUS -NTAPI -HidP_TranslateUsageAndPagesToI8042ScanCodes( - IN PUSAGE_AND_PAGE ChangedUsageList, - IN ULONG UsageListLength, - IN HIDP_KEYBOARD_DIRECTION KeyAction, - IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState, - IN PHIDP_INSERT_SCANCODES InsertCodesProcedure, - IN PVOID InsertCodesContext) -{ - HID_PARSER Parser; - - // - // init parser - // - HidParser_InitParser(AllocFunction, FreeFunction, ZeroFunction, CopyFunction, DebugFunction, &Parser); - - // - // translate usage pages - // - return HidParser_TranslateUsageAndPagesToI8042ScanCodes(&Parser, ChangedUsageList, UsageListLength, KeyAction, ModifierState, InsertCodesProcedure, InsertCodesContext); -} - -HIDAPI -NTSTATUS -NTAPI -HidP_GetButtonCaps( - HIDP_REPORT_TYPE ReportType, - PHIDP_BUTTON_CAPS ButtonCaps, - PUSHORT ButtonCapsLength, - PHIDP_PREPARSED_DATA PreparsedData) -{ - return HidP_GetSpecificButtonCaps(ReportType, HID_USAGE_PAGE_UNDEFINED, 0, 0, ButtonCaps, ButtonCapsLength, PreparsedData); -} - -HIDAPI -NTSTATUS -NTAPI -HidP_GetSpecificButtonCaps( - IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection, - IN USAGE Usage, - OUT PHIDP_BUTTON_CAPS ButtonCaps, - IN OUT PUSHORT ButtonCapsLength, - IN PHIDP_PREPARSED_DATA PreparsedData) -{ - UNIMPLEMENTED; - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; -} - -HIDAPI -NTSTATUS -NTAPI -HidP_GetData( - IN HIDP_REPORT_TYPE ReportType, - OUT PHIDP_DATA DataList, - IN OUT PULONG DataLength, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; -} - -HIDAPI -NTSTATUS -NTAPI -HidP_GetExtendedAttributes( - IN HIDP_REPORT_TYPE ReportType, - IN USHORT DataIndex, - IN PHIDP_PREPARSED_DATA PreparsedData, - OUT PHIDP_EXTENDED_ATTRIBUTES Attributes, - IN OUT PULONG LengthAttributes) -{ - UNIMPLEMENTED; - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; -} - -HIDAPI -NTSTATUS -NTAPI -HidP_GetLinkCollectionNodes( - OUT PHIDP_LINK_COLLECTION_NODE LinkCollectionNodes, - IN OUT PULONG LinkCollectionNodesLength, - IN PHIDP_PREPARSED_DATA PreparsedData) -{ - UNIMPLEMENTED; - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; -} - -NTSTATUS -NTAPI -HidP_SysPowerEvent( - IN PCHAR HidPacket, - IN USHORT HidPacketLength, - IN PHIDP_PREPARSED_DATA Ppd, - OUT PULONG OutputBuffer) -{ - UNIMPLEMENTED; - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; -} - -NTSTATUS -NTAPI -HidP_SysPowerCaps( - IN PHIDP_PREPARSED_DATA Ppd, - OUT PULONG OutputBuffer) -{ - UNIMPLEMENTED; - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; -} - -HIDAPI -NTSTATUS -NTAPI -HidP_GetUsageValueArray( - IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection OPTIONAL, - IN USAGE Usage, - OUT PCHAR UsageValue, - IN USHORT UsageValueByteLength, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; -} - - -HIDAPI -NTSTATUS -NTAPI -HidP_UnsetUsages( - IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection, - IN PUSAGE UsageList, - IN OUT PULONG UsageLength, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN OUT PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; -} - -HIDAPI -NTSTATUS -NTAPI -HidP_TranslateUsagesToI8042ScanCodes( - IN PUSAGE ChangedUsageList, - IN ULONG UsageListLength, - IN HIDP_KEYBOARD_DIRECTION KeyAction, - IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState, - IN PHIDP_INSERT_SCANCODES InsertCodesProcedure, - IN PVOID InsertCodesContext) -{ - UNIMPLEMENTED; - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; -} - -HIDAPI -NTSTATUS -NTAPI -HidP_SetUsages( - IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection, - IN PUSAGE UsageList, - IN OUT PULONG UsageLength, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN OUT PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; -} - -HIDAPI -NTSTATUS -NTAPI -HidP_SetUsageValueArray( - IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection OPTIONAL, - IN USAGE Usage, - IN PCHAR UsageValue, - IN USHORT UsageValueByteLength, - IN PHIDP_PREPARSED_DATA PreparsedData, - OUT PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; -} - -HIDAPI -NTSTATUS -NTAPI -HidP_SetUsageValue( - IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection, - IN USAGE Usage, - IN ULONG UsageValue, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN OUT PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; -} - -HIDAPI -NTSTATUS -NTAPI -HidP_SetScaledUsageValue( - IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, - IN USHORT LinkCollection OPTIONAL, - IN USAGE Usage, - IN LONG UsageValue, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN OUT PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; -} - -HIDAPI -NTSTATUS -NTAPI -HidP_SetData( - IN HIDP_REPORT_TYPE ReportType, - IN PHIDP_DATA DataList, - IN OUT PULONG DataLength, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN OUT PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; -} - -HIDAPI -ULONG -NTAPI -HidP_MaxDataListLength( - IN HIDP_REPORT_TYPE ReportType, - IN PHIDP_PREPARSED_DATA PreparsedData) -{ - UNIMPLEMENTED; - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; -} - -HIDAPI -NTSTATUS -NTAPI -HidP_InitializeReportForID( - IN HIDP_REPORT_TYPE ReportType, - IN UCHAR ReportID, - IN PHIDP_PREPARSED_DATA PreparsedData, - IN OUT PCHAR Report, - IN ULONG ReportLength) -{ - UNIMPLEMENTED; - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; -} - -#undef HidP_GetValueCaps - -HIDAPI -NTSTATUS -NTAPI -HidP_GetValueCaps( - HIDP_REPORT_TYPE ReportType, - PHIDP_VALUE_CAPS ValueCaps, - PUSHORT ValueCapsLength, - PHIDP_PREPARSED_DATA PreparsedData) -{ - UNIMPLEMENTED; - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; -} - NTSTATUS NTAPI DriverEntry( diff --git a/drivers/hid/hidparse/hidparse.h b/drivers/hid/hidparse/hidparse.h index c3602a3300..3ee1ba54e1 100644 --- a/drivers/hid/hidparse/hidparse.h +++ b/drivers/hid/hidparse/hidparse.h @@ -5,7 +5,6 @@ #include <ntddk.h> #include <hidpddi.h> #include <hidpi.h> -#include "hidparser.h" #include <stdio.h> #define HIDPARSE_TAG 'PdiH' diff --git a/sdk/lib/drivers/hidparser/CMakeLists.txt b/sdk/lib/drivers/hidparser/CMakeLists.txt index 1becfe528d..ba03f996e5 100644 --- a/sdk/lib/drivers/hidparser/CMakeLists.txt +++ b/sdk/lib/drivers/hidparser/CMakeLists.txt @@ -6,8 +6,11 @@ list(APPEND SOURCE hidparser.c parser.c api.c - parser.h) + parser.h + hidp.c + hidp.h) -add_library(hidparser ${SOURCE}) -add_dependencies(hidparser bugcodes xdk) -add_pch(hidparser parser.h SOURCE) +add_library(hidparser_km ${SOURCE}) +add_importlibs(hidparser_km ntoskrnl) +add_dependencies(hidparser_km bugcodes xdk) +add_pch(hidparser_km parser.h SOURCE) diff --git a/drivers/hid/hidparse/hidparse.c b/sdk/lib/drivers/hidparser/hidp.c similarity index 89% copy from drivers/hid/hidparse/hidparse.c copy to sdk/lib/drivers/hidparser/hidp.c index bc8e856605..b179b1f140 100644 --- a/drivers/hid/hidparse/hidparse.c +++ b/sdk/lib/drivers/hidparser/hidp.c @@ -1,90 +1,12 @@ -/* - * PROJECT: ReactOS Universal Serial Bus Bulk Enhanced Host Controller Interface - * LICENSE: GPL - See COPYING in the top level directory - * FILE: drivers/usb/hidparse/hidparse.c - * PURPOSE: HID Parser - * PROGRAMMERS: - * Michael Martin (michael.martin(a)reactos.org) - * Johannes Anderwald (johannes.anderwald(a)reactos.org) - */ - -#include "hidparse.h" - -#define NDEBUG -#include <debug.h> - -PVOID -NTAPI -AllocFunction( - IN ULONG ItemSize) -{ - PVOID Item = ExAllocatePoolWithTag(NonPagedPool, ItemSize, HIDPARSE_TAG); - if (Item) - { - // - // zero item - // - RtlZeroMemory(Item, ItemSize); - } - - // - // done - // - return Item; -} - -VOID -NTAPI -FreeFunction( - IN PVOID Item) -{ - // - // free item - // - ExFreePoolWithTag(Item, HIDPARSE_TAG); -} - -VOID -NTAPI -ZeroFunction( - IN PVOID Item, - IN ULONG ItemSize) -{ - // - // zero item - // - RtlZeroMemory(Item, ItemSize); -} +#define _HIDPI_ +#define _HIDPI_NO_FUNCTION_MACROS_ +#include <ntddk.h> +#include <hidpddi.h> -VOID -NTAPI -CopyFunction( - IN PVOID Target, - IN PVOID Source, - IN ULONG Length) -{ - // - // copy item - // - RtlCopyMemory(Target, Source, Length); -} +#include "hidparser.h" +#include "hidp.h" -VOID -__cdecl -DebugFunction( - IN LPCSTR FormatStr, ...) -{ -#if HID_DBG - va_list args; - char printbuffer[1024]; - - va_start(args, FormatStr); - vsprintf(printbuffer, FormatStr, args); - va_end(args); - - DbgPrint(printbuffer); -#endif -} +#define UNIMPLEMENTED DebugFunction("%s is UNIMPLEMENTED\n", __FUNCTION__) VOID NTAPI @@ -672,13 +594,3 @@ HidP_GetValueCaps( ASSERT(FALSE); return STATUS_NOT_IMPLEMENTED; } - -NTSTATUS -NTAPI -DriverEntry( - IN PDRIVER_OBJECT DriverObject, - IN PUNICODE_STRING RegPath) -{ - DPRINT("********* HID PARSE *********\n"); - return STATUS_SUCCESS; -} diff --git a/sdk/lib/drivers/hidparser/hidp.h b/sdk/lib/drivers/hidparser/hidp.h new file mode 100644 index 0000000000..629bc86bf3 --- /dev/null +++ b/sdk/lib/drivers/hidparser/hidp.h @@ -0,0 +1,6 @@ +PVOID NTAPI AllocFunction(ULONG Size); +VOID NTAPI FreeFunction(PVOID Item); +VOID NTAPI ZeroFunction(PVOID Item, ULONG Size); +VOID NTAPI CopyFunction(PVOID Target, PVOID Source, ULONG Size); +VOID __cdecl DebugFunction(LPCSTR Src, ...); + diff --git a/sdk/lib/drivers/hidparser/hidparser.h b/sdk/lib/drivers/hidparser/hidparser.h index 581193a319..befcd32bda 100644 --- a/sdk/lib/drivers/hidparser/hidparser.h +++ b/sdk/lib/drivers/hidparser/hidparser.h @@ -57,7 +57,7 @@ typedef struct // // free function // - PFREE_FUNCTION Free; + PHIDPARSER_FREE_FUNCTION Free; // // zero function
5 years, 7 months
1
0
0
0
[reactos] 02/04: [SERIAL] Immediately complete read IRP if all requested bytes have been found in circular buffer
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bef39dd62ee62a2b7c0eb…
commit bef39dd62ee62a2b7c0eb1a3749dee0c700b5188 Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Thu May 2 13:26:46 2019 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Thu May 2 20:06:47 2019 +0200 [SERIAL] Immediately complete read IRP if all requested bytes have been found in circular buffer Previously, we had to wait to receive another byte to finish the first IRP. --- drivers/serial/serial/rw.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/serial/serial/rw.c b/drivers/serial/serial/rw.c index df101ca07b..4179ac820b 100644 --- a/drivers/serial/serial/rw.c +++ b/drivers/serial/serial/rw.c @@ -65,7 +65,7 @@ ReadBytes( } /* while buffer is not fully filled */ - while (Length > 0) + while (TRUE) { /* read already received bytes from buffer */ KeAcquireSpinLock(&DeviceExtension->InputBufferLock, &Irql); @@ -81,6 +81,12 @@ ReadBytes( KeClearEvent(&DeviceExtension->InputBufferNotEmpty); KeReleaseSpinLock(&DeviceExtension->InputBufferLock, Irql); + if (Length == 0) + { + INFO_(SERIAL, "All bytes read\n"); + break; + } + if (WorkItemData->DontWait && !(WorkItemData->ReadAtLeastOneByte && Information == 0)) {
5 years, 7 months
1
0
0
0
[reactos] 01/04: [I8042PRT] Do not assert on unknown IOCTL
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ebd39aa2663a510ad539a…
commit ebd39aa2663a510ad539ab63a3c84c4af9dfa8f6 Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Sat Apr 27 23:07:39 2019 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Thu May 2 20:06:47 2019 +0200 [I8042PRT] Do not assert on unknown IOCTL --- drivers/input/i8042prt/keyboard.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/i8042prt/keyboard.c b/drivers/input/i8042prt/keyboard.c index 198ec8f35d..177443ea62 100644 --- a/drivers/input/i8042prt/keyboard.c +++ b/drivers/input/i8042prt/keyboard.c @@ -465,7 +465,6 @@ i8042KbdDeviceControl( { ERR_(I8042PRT, "IRP_MJ_DEVICE_CONTROL / unknown ioctl code 0x%lx\n", Stack->Parameters.DeviceIoControl.IoControlCode); - ASSERT(FALSE); return ForwardIrpAndForget(DeviceObject, Irp); } }
5 years, 7 months
1
0
0
0
[reactos] 01/01: [NtGDI] Set Xform flags if a changed
by jimtabor
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2cc766b0c6cdf04152d4c…
commit 2cc766b0c6cdf04152d4c1eab0f669440dbf3c47 Author: jimtabor <james.tabor(a)reactos.org> AuthorDate: Thu May 2 11:56:55 2019 -0500 Commit: jimtabor <james.tabor(a)reactos.org> CommitDate: Thu May 2 11:56:55 2019 -0500 [NtGDI] Set Xform flags if a changed Missed more flags changes. --- win32ss/gdi/ntgdi/gdibatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/win32ss/gdi/ntgdi/gdibatch.c b/win32ss/gdi/ntgdi/gdibatch.c index b9f7b2d1d3..cccc706265 100644 --- a/win32ss/gdi/ntgdi/gdibatch.c +++ b/win32ss/gdi/ntgdi/gdibatch.c @@ -350,6 +350,7 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr) dc->pdcattr->ulDirty_ &= ~SLOW_WIDTHS; } dc->pdcattr->ulDirty_ |= saveflags | flags; + dc->pdcattr->flXform |= saveflXform | flXform; break; } @@ -408,6 +409,7 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr) dc->pdcattr->ulBackgroundClr = ulBackgroundClr; } dc->pdcattr->ulDirty_ |= saveflags | flags; + dc->pdcattr->flXform |= saveflXform | flXform; break; } @@ -523,5 +525,3 @@ NtGdiFlushUserBatch(VOID) // FIXME: On Windows XP the function returns &pTeb->RealClientId, maybe VOID? return STATUS_SUCCESS; } - -
5 years, 7 months
1
0
0
0
[reactos] 01/01: [NtGDI] Set Xform flags if a changed
by jimtabor
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b2ce1ae206f994b200057…
commit b2ce1ae206f994b200057dea94e1134c4455b25a Author: jimtabor <james.tabor(a)reactos.org> AuthorDate: Thu May 2 10:16:50 2019 -0500 Commit: jimtabor <james.tabor(a)reactos.org> CommitDate: Thu May 2 10:16:50 2019 -0500 [NtGDI] Set Xform flags if a changed Missed flags changes. --- win32ss/gdi/ntgdi/gdibatch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/win32ss/gdi/ntgdi/gdibatch.c b/win32ss/gdi/ntgdi/gdibatch.c index d292e2e831..b9f7b2d1d3 100644 --- a/win32ss/gdi/ntgdi/gdibatch.c +++ b/win32ss/gdi/ntgdi/gdibatch.c @@ -298,6 +298,7 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr) flXform = (PAGE_XLATE_CHANGED|WORLD_XFORM_CHANGED|DEVICE_TO_WORLD_INVALID); } + dc->pdcattr->flXform |= flXform; dc->pdcattr->ulDirty_ |= flags; jBkMode = dc->pdcattr->jBkMode; @@ -382,6 +383,7 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr) flXform = (PAGE_XLATE_CHANGED|WORLD_XFORM_CHANGED|DEVICE_TO_WORLD_INVALID); } + dc->pdcattr->flXform |= flXform; dc->pdcattr->ulDirty_ |= flags; IntExtTextOutW( dc,
5 years, 7 months
1
0
0
0
← Newer
1
...
12
13
14
15
16
17
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Results per page:
10
25
50
100
200