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
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
July 2020
----- 2025 -----
January 2025
----- 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
14 participants
55 discussions
Start a n
N
ew thread
[reactos] 01/01: [WinSpool.idl] Add File Info Structure
by James Tabor
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6df223ebdfee6a81e2906…
commit 6df223ebdfee6a81e290658ce0528216208b6db3 Author: James Tabor <james.tabor(a)reactos.org> AuthorDate: Fri Jul 31 12:45:18 2020 -0500 Commit: James Tabor <james.tabor(a)reactos.org> CommitDate: Fri Jul 31 12:45:18 2020 -0500 [WinSpool.idl] Add File Info Structure This is for 2 RPC functions. Update at a later time. --- sdk/include/reactos/idl/winspool.idl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sdk/include/reactos/idl/winspool.idl b/sdk/include/reactos/idl/winspool.idl index 736b53262cf..558b0302f4e 100644 --- a/sdk/include/reactos/idl/winspool.idl +++ b/sdk/include/reactos/idl/winspool.idl @@ -834,6 +834,26 @@ typedef [switch_type(DWORD)] union _WINSPOOL_V2_UREPLY_PRINTER } WINSPOOL_V2_UREPLY_PRINTER; +typedef struct _WINSPOOL_FILE_INFO +{ + BOOL bInheritHandle; + HANDLE hSpoolFileHandle; + DWORD dwOptions; +} +WINSPOOL_FILE_INFO_1; + +typedef struct _WINSPOOL_FILE_INFO_CONTAINER +{ + DWORD Level; + + [switch_is(Level)] union + { + [case(1)] + WINSPOOL_FILE_INFO_1 *pFileInfo1; + } + FileInfo; +} +WINSPOOL_FILE_INFO_CONTAINER; /* * The actual interface
4 years, 5 months
1
0
0
0
[reactos] 01/01: [WinSpool] Fix Header Order
by James Tabor
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dbaa8b132d3ff5f756416…
commit dbaa8b132d3ff5f756416cdedf8a54b0fec576a7 Author: James Tabor <james.tabor(a)reactos.org> AuthorDate: Fri Jul 31 12:12:59 2020 -0500 Commit: James Tabor <james.tabor(a)reactos.org> CommitDate: Fri Jul 31 12:12:59 2020 -0500 [WinSpool] Fix Header Order Found another issue with the header. --- sdk/include/psdk/winspool.h | 59 ++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/sdk/include/psdk/winspool.h b/sdk/include/psdk/winspool.h index fa03a2acfbb..6c4d8383762 100644 --- a/sdk/include/psdk/winspool.h +++ b/sdk/include/psdk/winspool.h @@ -640,6 +640,35 @@ __MINGW_TYPEDEF_AW(LPDRIVER_INFO_8) __MINGW_TYPEDEF_AW(PFORM_INFO_1) __MINGW_TYPEDEF_AW(LPFORM_INFO_1) +typedef struct _FORM_INFO_2A { + DWORD Flags; + LPSTR pName; + SIZEL Size; + RECTL ImageableArea; + LPCSTR pKeyword; + DWORD StringType; + LPCSTR pMuiDll; + DWORD dwResourceId; + LPCSTR pDisplayName; + LANGID wLangId; +} FORM_INFO_2A, *PFORM_INFO_2A; + +typedef struct _FORM_INFO_2W { + DWORD Flags; + LPWSTR pName; + SIZEL Size; + RECTL ImageableArea; + LPCSTR pKeyword; + DWORD StringType; + LPCWSTR pMuiDll; + DWORD dwResourceId; + LPCWSTR pDisplayName; + LANGID wLangId; +} FORM_INFO_2W, *PFORM_INFO_2W; + +__MINGW_TYPEDEF_AW(FORM_INFO_2) +__MINGW_TYPEDEF_AW(PFORM_INFO_2) + typedef struct _DOC_INFO_2A { LPSTR pDocName; LPSTR pOutputFile; @@ -1480,36 +1509,6 @@ HRESULT DocumentEventW( PVOID pvOut ); - -typedef struct _FORM_INFO_2A { - DWORD Flags; - LPSTR pName; - SIZEL Size; - RECTL ImageableArea; - LPCSTR pKeyword; - DWORD StringType; - LPCSTR pMuiDll; - DWORD dwResourceId; - LPCSTR pDisplayName; - LANGID wLangId; -} FORM_INFO_2A, *PFORM_INFO_2A; - -typedef struct _FORM_INFO_2W { - DWORD Flags; - LPWSTR pName; - SIZEL Size; - RECTL ImageableArea; - LPCSTR pKeyword; - DWORD StringType; - LPCWSTR pMuiDll; - DWORD dwResourceId; - LPCWSTR pDisplayName; - LANGID wLangId; -} FORM_INFO_2W, *PFORM_INFO_2W; - -__MINGW_TYPEDEF_AW(FORM_INFO_2) -__MINGW_TYPEDEF_AW(PFORM_INFO_2) - typedef struct _PRINTPROCESSOR_CAPS_2 { DWORD dwLevel; DWORD dwNupOptions;
4 years, 5 months
1
0
0
0
[reactos] 02/02: [HIDPARSER] Remove HIDPARSER specific error codes, and remplace them by HIDP_* NTSTATUS codes
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c4055c455f8c3fb9c45a5…
commit c4055c455f8c3fb9c45a5983797fbe18c8661d73 Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Fri Apr 17 23:54:14 2020 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Fri Jul 31 14:32:08 2020 +0200 [HIDPARSER] Remove HIDPARSER specific error codes, and remplace them by HIDP_* NTSTATUS codes Remove now useless TranslateHidParserStatus() function. --- sdk/lib/drivers/hidparser/api.c | 58 ++++++++--------- sdk/lib/drivers/hidparser/context.c | 4 +- sdk/lib/drivers/hidparser/hidp.c | 10 +-- sdk/lib/drivers/hidparser/hidparser.c | 114 +++++++--------------------------- sdk/lib/drivers/hidparser/hidparser.h | 27 +------- sdk/lib/drivers/hidparser/parser.c | 100 ++++++++++++++--------------- sdk/lib/drivers/hidparser/parser.h | 16 ++--- 7 files changed, 117 insertions(+), 212 deletions(-) diff --git a/sdk/lib/drivers/hidparser/api.c b/sdk/lib/drivers/hidparser/api.c index 6941bd79d07..3ed6b24d0db 100644 --- a/sdk/lib/drivers/hidparser/api.c +++ b/sdk/lib/drivers/hidparser/api.c @@ -61,7 +61,7 @@ static struct #define NTOHS(n) (((((unsigned short)(n) & 0xFF)) << 8) | (((unsigned short)(n) & 0xFF00) >> 8)) -HIDPARSER_STATUS +NTSTATUS HidParser_GetCollectionUsagePage( IN PVOID CollectionContext, OUT PUSHORT Usage, @@ -78,7 +78,7 @@ HidParser_GetCollectionUsagePage( // // collection not found // - return HIDPARSER_STATUS_COLLECTION_NOT_FOUND; + return HIDP_STATUS_USAGE_NOT_FOUND; } // @@ -86,7 +86,7 @@ HidParser_GetCollectionUsagePage( // *UsagePage = (Collection->Usage >> 16); *Usage = (Collection->Usage & 0xFFFF); - return HIDPARSER_STATUS_SUCCESS; + return HIDP_STATUS_SUCCESS; } ULONG @@ -250,7 +250,7 @@ HidParser_GetMaxUsageListLengthWithReportAndPage( return ItemCount; } -HIDPARSER_STATUS +NTSTATUS HidParser_GetSpecificValueCapsWithReport( IN PVOID CollectionContext, IN UCHAR ReportType, @@ -274,7 +274,7 @@ HidParser_GetSpecificValueCapsWithReport( // // no such report // - return HIDPARSER_STATUS_REPORT_NOT_FOUND; + return HIDP_STATUS_REPORT_DOES_NOT_EXIST; } for(Index = 0; Index < Report->ItemCount; Index++) @@ -330,16 +330,16 @@ HidParser_GetSpecificValueCapsWithReport( // // success // - return HIDPARSER_STATUS_SUCCESS; + return HIDP_STATUS_SUCCESS; } // // item not found // - return HIDPARSER_STATUS_USAGE_NOT_FOUND; + return HIDP_STATUS_USAGE_NOT_FOUND; } -HIDPARSER_STATUS +NTSTATUS HidParser_GetUsagesWithReport( IN PVOID CollectionContext, IN UCHAR ReportType, @@ -367,7 +367,7 @@ HidParser_GetUsagesWithReport( // // no such report // - return HIDPARSER_STATUS_REPORT_NOT_FOUND; + return HIDP_STATUS_REPORT_DOES_NOT_EXIST; } if (Report->ReportSize / 8 != (ReportDescriptorLength - 1)) @@ -375,7 +375,7 @@ HidParser_GetUsagesWithReport( // // invalid report descriptor length // - return HIDPARSER_STATUS_INVALID_REPORT_LENGTH; + return HIDP_STATUS_INVALID_REPORT_LENGTH; } // @@ -490,7 +490,7 @@ HidParser_GetUsagesWithReport( // // list too small // - return HIDPARSER_STATUS_BUFFER_TOO_SMALL; + return HIDP_STATUS_BUFFER_TOO_SMALL; } if (UsagePage == HID_USAGE_PAGE_UNDEFINED) @@ -517,7 +517,7 @@ HidParser_GetUsagesWithReport( // // done // - return HIDPARSER_STATUS_SUCCESS; + return HIDP_STATUS_SUCCESS; } ULONG @@ -546,7 +546,7 @@ HidParser_UsesReportId( } -HIDPARSER_STATUS +NTSTATUS HidParser_GetUsageValueWithReport( IN PVOID CollectionContext, IN UCHAR ReportType, @@ -571,7 +571,7 @@ HidParser_GetUsageValueWithReport( // // no such report // - return HIDPARSER_STATUS_REPORT_NOT_FOUND; + return HIDP_STATUS_REPORT_DOES_NOT_EXIST; } if (Report->ReportSize / 8 != (ReportDescriptorLength - 1)) @@ -579,7 +579,7 @@ HidParser_GetUsageValueWithReport( // // invalid report descriptor length // - return HIDPARSER_STATUS_INVALID_REPORT_LENGTH; + return HIDP_STATUS_INVALID_REPORT_LENGTH; } for (Index = 0; Index < Report->ItemCount; Index++) @@ -631,18 +631,18 @@ HidParser_GetUsageValueWithReport( // store result // *UsageValue = Data; - return HIDPARSER_STATUS_SUCCESS; + return HIDP_STATUS_SUCCESS; } // // usage not found // - return HIDPARSER_STATUS_USAGE_NOT_FOUND; + return HIDP_STATUS_USAGE_NOT_FOUND; } -HIDPARSER_STATUS +NTSTATUS HidParser_GetScaledUsageValueWithReport( IN PVOID CollectionContext, IN UCHAR ReportType, @@ -667,7 +667,7 @@ HidParser_GetScaledUsageValueWithReport( // // no such report // - return HIDPARSER_STATUS_REPORT_NOT_FOUND; + return HIDP_STATUS_REPORT_DOES_NOT_EXIST; } if (Report->ReportSize / 8 != (ReportDescriptorLength - 1)) @@ -675,7 +675,7 @@ HidParser_GetScaledUsageValueWithReport( // // invalid report descriptor length // - return HIDPARSER_STATUS_INVALID_REPORT_LENGTH; + return HIDP_STATUS_INVALID_REPORT_LENGTH; } for (Index = 0; Index < Report->ItemCount; Index++) @@ -738,20 +738,20 @@ HidParser_GetScaledUsageValueWithReport( else { // logical boundaries are absolute values - return HIDPARSER_STATUS_BAD_LOG_PHY_VALUES; + return HIDP_STATUS_BAD_LOG_PHY_VALUES; } // // store result // *UsageValue = Data; - return HIDPARSER_STATUS_SUCCESS; + return HIDP_STATUS_SUCCESS; } // // usage not found // - return HIDPARSER_STATUS_USAGE_NOT_FOUND; + return HIDP_STATUS_USAGE_NOT_FOUND; } ULONG @@ -847,7 +847,7 @@ HidParser_DispatchKey( } } -HIDPARSER_STATUS +NTSTATUS HidParser_TranslateKbdUsage( IN USAGE Usage, IN HIDP_KEYBOARD_DIRECTION KeyAction, @@ -869,7 +869,7 @@ HidParser_TranslateKbdUsage( // invalid lookup or no scan code available // DPRINT1("No Scan code for Usage %x\n", Usage); - return HIDPARSER_STATUS_I8042_TRANS_UNKNOWN; + return HIDP_STATUS_I8042_TRANS_UNKNOWN; } if (ScanCode & 0xFF00) @@ -906,10 +906,10 @@ HidParser_TranslateKbdUsage( // // done // - return HIDPARSER_STATUS_SUCCESS; + return HIDP_STATUS_SUCCESS; } -HIDPARSER_STATUS +NTSTATUS HidParser_TranslateCustUsage( IN USAGE Usage, IN HIDP_KEYBOARD_DIRECTION KeyAction, @@ -929,7 +929,7 @@ HidParser_TranslateCustUsage( // invalid lookup or no scan code available // DPRINT1("No Scan code for Usage %x\n", Usage); - return HIDPARSER_STATUS_I8042_TRANS_UNKNOWN; + return HIDP_STATUS_I8042_TRANS_UNKNOWN; } if (ScanCode & 0xFF00) @@ -948,5 +948,5 @@ HidParser_TranslateCustUsage( // // done // - return HIDPARSER_STATUS_SUCCESS; + return HIDP_STATUS_SUCCESS; } diff --git a/sdk/lib/drivers/hidparser/context.c b/sdk/lib/drivers/hidparser/context.c index b97ef67ebac..0047a63c0e3 100644 --- a/sdk/lib/drivers/hidparser/context.c +++ b/sdk/lib/drivers/hidparser/context.c @@ -181,7 +181,7 @@ HidParser_StoreCollection( return CurrentOffset - InitialOffset; } -HIDPARSER_STATUS +NTSTATUS HidParser_BuildCollectionContext( IN PHID_COLLECTION RootCollection, IN PVOID Context, @@ -213,7 +213,7 @@ HidParser_BuildCollectionContext( // // done // - return HIDPARSER_STATUS_SUCCESS; + return HIDP_STATUS_SUCCESS; } PHID_REPORT diff --git a/sdk/lib/drivers/hidparser/hidp.c b/sdk/lib/drivers/hidparser/hidp.c index 2d99ed89e72..d9b721a1c76 100644 --- a/sdk/lib/drivers/hidparser/hidp.c +++ b/sdk/lib/drivers/hidparser/hidp.c @@ -35,7 +35,7 @@ HidP_GetCaps( NTSTATUS TranslateStatusForUpperLayer( - IN HIDPARSER_STATUS Status) + IN NTSTATUS Status) { // // now we are handling only this values, for others just return @@ -43,13 +43,13 @@ TranslateStatusForUpperLayer( // switch (Status) { - case HIDPARSER_STATUS_INSUFFICIENT_RESOURCES: + case HIDP_STATUS_INTERNAL_ERROR: return STATUS_INSUFFICIENT_RESOURCES; - case HIDPARSER_STATUS_INVALID_REPORT_TYPE: + case HIDP_STATUS_INVALID_REPORT_TYPE: return HIDP_STATUS_INVALID_REPORT_TYPE; - case HIDPARSER_STATUS_BUFFER_TOO_SMALL: + case HIDP_STATUS_BUFFER_TOO_SMALL: return STATUS_BUFFER_TOO_SMALL; - case HIDPARSER_STATUS_COLLECTION_NOT_FOUND: + case HIDP_STATUS_USAGE_NOT_FOUND: return STATUS_NO_DATA_DETECTED; default: return Status; diff --git a/sdk/lib/drivers/hidparser/hidparser.c b/sdk/lib/drivers/hidparser/hidparser.c index 10b6e3ddcf2..19c5c777578 100644 --- a/sdk/lib/drivers/hidparser/hidparser.c +++ b/sdk/lib/drivers/hidparser/hidparser.c @@ -13,37 +13,6 @@ #define NDEBUG #include <debug.h> -NTSTATUS -TranslateHidParserStatus( - IN HIDPARSER_STATUS Status) -{ - switch(Status) - { - case HIDPARSER_STATUS_INSUFFICIENT_RESOURCES: - return HIDP_STATUS_INTERNAL_ERROR; - case HIDPARSER_STATUS_NOT_IMPLEMENTED: - return HIDP_STATUS_NOT_IMPLEMENTED; - case HIDPARSER_STATUS_REPORT_NOT_FOUND: - return HIDP_STATUS_REPORT_DOES_NOT_EXIST; - case HIDPARSER_STATUS_INVALID_REPORT_LENGTH: - return HIDP_STATUS_INVALID_REPORT_LENGTH; - case HIDPARSER_STATUS_INVALID_REPORT_TYPE: - return HIDP_STATUS_INVALID_REPORT_TYPE; - case HIDPARSER_STATUS_BUFFER_TOO_SMALL: - return HIDP_STATUS_BUFFER_TOO_SMALL; - case HIDPARSER_STATUS_USAGE_NOT_FOUND: - return HIDP_STATUS_USAGE_NOT_FOUND; - case HIDPARSER_STATUS_I8042_TRANS_UNKNOWN: - return HIDP_STATUS_I8042_TRANS_UNKNOWN; - case HIDPARSER_STATUS_COLLECTION_NOT_FOUND: - return HIDP_STATUS_NOT_IMPLEMENTED; //FIXME - case HIDPARSER_STATUS_BAD_LOG_PHY_VALUES: - return HIDP_STATUS_BAD_LOG_PHY_VALUES; - } - DPRINT1("TranslateHidParserStatus Status %ld not implemented\n", Status); - return HIDP_STATUS_NOT_IMPLEMENTED; -} - NTSTATUS NTAPI HidParser_GetCollectionDescription( @@ -52,7 +21,7 @@ HidParser_GetCollectionDescription( IN POOL_TYPE PoolType, OUT PHIDP_DEVICE_DESC DeviceDescription) { - HIDPARSER_STATUS ParserStatus; + NTSTATUS ParserStatus; ULONG CollectionCount; ULONG Index; PVOID ParserContext; @@ -61,7 +30,7 @@ HidParser_GetCollectionDescription( // first parse the report descriptor // ParserStatus = HidParser_ParseReportDescriptor(ReportDesc, DescLength, &ParserContext); - if (ParserStatus != HIDPARSER_STATUS_SUCCESS) + if (ParserStatus != HIDP_STATUS_SUCCESS) { // // failed to parse report descriptor @@ -120,7 +89,7 @@ HidParser_GetCollectionDescription( // DeviceDescription->CollectionDesc[Index].PreparsedDataLength = HidParser_GetContextSize(ParserContext, Index); ParserStatus = HidParser_BuildContext(ParserContext, Index, DeviceDescription->CollectionDesc[Index].PreparsedDataLength, (PVOID*)&DeviceDescription->CollectionDesc[Index].PreparsedData); - if (ParserStatus != HIDPARSER_STATUS_SUCCESS) + if (ParserStatus != HIDP_STATUS_SUCCESS) { // // no memory @@ -154,7 +123,7 @@ HidParser_GetCollectionDescription( // get collection usage page // ParserStatus = HidParser_GetCollectionUsagePage((PVOID)DeviceDescription->CollectionDesc[Index].PreparsedData, &DeviceDescription->CollectionDesc[Index].Usage, &DeviceDescription->CollectionDesc[Index].UsagePage); - if (ParserStatus != HIDPARSER_STATUS_SUCCESS) + if (ParserStatus != HIDP_STATUS_SUCCESS) { // collection not found FreeFunction(DeviceDescription->CollectionDesc); @@ -358,7 +327,7 @@ HidParser_GetSpecificValueCaps( OUT PHIDP_VALUE_CAPS ValueCaps, IN OUT PUSHORT ValueCapsLength) { - HIDPARSER_STATUS ParserStatus; + NTSTATUS ParserStatus; // // FIXME: implement searching in specific collection @@ -394,19 +363,10 @@ HidParser_GetSpecificValueCaps( return HIDP_STATUS_INVALID_REPORT_TYPE; } - - if (ParserStatus == HIDPARSER_STATUS_SUCCESS) - { - // - // success - // - return HIDP_STATUS_SUCCESS; - } - // - // translate error + // return status // - return TranslateHidParserStatus(ParserStatus); + return ParserStatus; } HIDAPI @@ -551,7 +511,7 @@ HidParser_GetUsages( IN PCHAR Report, IN ULONG ReportLength) { - HIDPARSER_STATUS ParserStatus; + NTSTATUS ParserStatus; // // FIXME: implement searching in specific collection @@ -587,18 +547,10 @@ HidParser_GetUsages( return HIDP_STATUS_INVALID_REPORT_TYPE; } - if (ParserStatus == HIDPARSER_STATUS_SUCCESS) - { - // - // success - // - return HIDP_STATUS_SUCCESS; - } - // - // translate error + // return status // - return TranslateHidParserStatus(ParserStatus); + return ParserStatus; } HIDAPI @@ -614,7 +566,7 @@ HidParser_GetScaledUsageValue( IN PCHAR Report, IN ULONG ReportLength) { - HIDPARSER_STATUS ParserStatus; + NTSTATUS ParserStatus; // // FIXME: implement searching in specific collection @@ -650,18 +602,10 @@ HidParser_GetScaledUsageValue( return HIDP_STATUS_INVALID_REPORT_TYPE; } - if (ParserStatus == HIDPARSER_STATUS_SUCCESS) - { - // - // success - // - return HIDP_STATUS_SUCCESS; - } - // - // translate error + // return status // - return TranslateHidParserStatus(ParserStatus); + return ParserStatus; } HIDAPI @@ -676,7 +620,7 @@ HidParser_TranslateUsageAndPagesToI8042ScanCodes( IN PVOID InsertCodesContext) { ULONG Index; - HIDPARSER_STATUS Status = HIDPARSER_STATUS_SUCCESS; + NTSTATUS Status = HIDP_STATUS_SUCCESS; for(Index = 0; Index < UsageListLength; Index++) { @@ -708,27 +652,19 @@ HidParser_TranslateUsageAndPagesToI8042ScanCodes( // // check status // - if (Status != HIDPARSER_STATUS_SUCCESS) + if (Status != HIDP_STATUS_SUCCESS) { // // failed // - return TranslateHidParserStatus(Status); + return Status; } } - if (Status != HIDPARSER_STATUS_SUCCESS) - { - // - // failed - // - return TranslateHidParserStatus(Status); - } - // - // done + // return status // - return HIDP_STATUS_SUCCESS; + return Status; } @@ -951,7 +887,7 @@ HidParser_GetUsageValue( IN PCHAR Report, IN ULONG ReportLength) { - HIDPARSER_STATUS ParserStatus; + NTSTATUS ParserStatus; // // FIXME: implement searching in specific collection @@ -987,18 +923,10 @@ HidParser_GetUsageValue( return HIDP_STATUS_INVALID_REPORT_TYPE; } - if (ParserStatus == HIDPARSER_STATUS_SUCCESS) - { - // - // success - // - return HIDP_STATUS_SUCCESS; - } - // - // translate error + // return status // - return TranslateHidParserStatus(ParserStatus); + return ParserStatus; } NTSTATUS diff --git a/sdk/lib/drivers/hidparser/hidparser.h b/sdk/lib/drivers/hidparser/hidparser.h index 333bbe1502b..7c851bf9a14 100644 --- a/sdk/lib/drivers/hidparser/hidparser.h +++ b/sdk/lib/drivers/hidparser/hidparser.h @@ -10,29 +10,6 @@ #pragma once -// -// status code -// -typedef long HIDPARSER_STATUS; - -// -// result codes -// -typedef enum -{ - HIDPARSER_STATUS_SUCCESS = 0, - HIDPARSER_STATUS_INSUFFICIENT_RESOURCES = -1, - HIDPARSER_STATUS_NOT_IMPLEMENTED = -2, - HIDPARSER_STATUS_REPORT_NOT_FOUND = -3, - HIDPARSER_STATUS_COLLECTION_NOT_FOUND = -4, - HIDPARSER_STATUS_INVALID_REPORT_LENGTH = -5, - HIDPARSER_STATUS_INVALID_REPORT_TYPE = -6, - HIDPARSER_STATUS_BUFFER_TOO_SMALL = -7, - HIDPARSER_STATUS_USAGE_NOT_FOUND = -8, - HIDPARSER_STATUS_I8042_TRANS_UNKNOWN = -9, - HIDPARSER_STATUS_BAD_LOG_PHY_VALUES = -10 -}HIDPARSER_STATUS_CODES; - NTSTATUS NTAPI HidParser_GetCollectionDescription( @@ -344,7 +321,7 @@ HidParser_InitializeReportForID( IN OUT PCHAR Report, IN ULONG ReportLength); -HIDPARSER_STATUS +NTSTATUS HidParser_TranslateKbdUsage( IN USAGE Usage, IN HIDP_KEYBOARD_DIRECTION KeyAction, @@ -352,7 +329,7 @@ HidParser_TranslateKbdUsage( IN PHIDP_INSERT_SCANCODES InsertCodesProcedure, IN PVOID InsertCodesContext); -HIDPARSER_STATUS +NTSTATUS HidParser_TranslateCustUsage( IN USAGE Usage, IN HIDP_KEYBOARD_DIRECTION KeyAction, diff --git a/sdk/lib/drivers/hidparser/parser.c b/sdk/lib/drivers/hidparser/parser.c index b2ce3d4b7a1..6d35cbe41fc 100644 --- a/sdk/lib/drivers/hidparser/parser.c +++ b/sdk/lib/drivers/hidparser/parser.c @@ -33,7 +33,7 @@ HidParser_FreeCollection( // } -HIDPARSER_STATUS +NTSTATUS HidParser_AllocateCollection( IN PHID_COLLECTION ParentCollection, IN UCHAR Type, @@ -52,7 +52,7 @@ HidParser_AllocateCollection( // // no memory // - return HIDPARSER_STATUS_INSUFFICIENT_RESOURCES; + return HIDP_STATUS_INTERNAL_ERROR; } // @@ -119,10 +119,10 @@ HidParser_AllocateCollection( // // done // - return HIDPARSER_STATUS_SUCCESS; + return HIDP_STATUS_SUCCESS; } -HIDPARSER_STATUS +NTSTATUS HidParser_AddCollection( IN PHID_COLLECTION CurrentCollection, IN PHID_COLLECTION NewCollection) @@ -144,7 +144,7 @@ HidParser_AddCollection( // // no memory // - return HIDPARSER_STATUS_INSUFFICIENT_RESOURCES; + return HIDP_STATUS_INTERNAL_ERROR; } if (CurrentCollection->NodeCount) @@ -175,10 +175,10 @@ HidParser_AddCollection( // // done // - return HIDPARSER_STATUS_SUCCESS; + return HIDP_STATUS_SUCCESS; } -HIDPARSER_STATUS +NTSTATUS HidParser_FindReportInCollection( IN PHID_COLLECTION Collection, IN UCHAR ReportType, @@ -186,7 +186,7 @@ HidParser_FindReportInCollection( OUT PHID_REPORT *OutReport) { ULONG Index; - HIDPARSER_STATUS Status; + NTSTATUS Status; // // search in local list @@ -199,7 +199,7 @@ HidParser_FindReportInCollection( // found report // *OutReport = Collection->Reports[Index]; - return HIDPARSER_STATUS_SUCCESS; + return HIDP_STATUS_SUCCESS; } } @@ -209,7 +209,7 @@ HidParser_FindReportInCollection( for(Index = 0; Index < Collection->NodeCount; Index++) { Status = HidParser_FindReportInCollection(Collection->Nodes[Index], ReportType, ReportID, OutReport); - if (Status == HIDPARSER_STATUS_SUCCESS) + if (Status == HIDP_STATUS_SUCCESS) return Status; } @@ -217,11 +217,11 @@ HidParser_FindReportInCollection( // no such report found // *OutReport = NULL; - return HIDPARSER_STATUS_REPORT_NOT_FOUND; + return HIDP_STATUS_REPORT_DOES_NOT_EXIST; } -HIDPARSER_STATUS +NTSTATUS HidParser_FindReport( IN PHID_PARSER_CONTEXT ParserContext, IN UCHAR ReportType, @@ -234,7 +234,7 @@ HidParser_FindReport( return HidParser_FindReportInCollection(ParserContext->RootCollection->Nodes[ParserContext->RootCollection->NodeCount-1], ReportType, ReportID, OutReport); } -HIDPARSER_STATUS +NTSTATUS HidParser_AllocateReport( IN UCHAR ReportType, IN UCHAR ReportID, @@ -251,7 +251,7 @@ HidParser_AllocateReport( // // no memory // - return HIDPARSER_STATUS_INSUFFICIENT_RESOURCES; + return HIDP_STATUS_INTERNAL_ERROR; } // @@ -264,10 +264,10 @@ HidParser_AllocateReport( // done // *OutReport = Report; - return HIDPARSER_STATUS_SUCCESS; + return HIDP_STATUS_SUCCESS; } -HIDPARSER_STATUS +NTSTATUS HidParser_AddReportToCollection( IN PHID_PARSER_CONTEXT ParserContext, IN PHID_COLLECTION CurrentCollection, @@ -284,7 +284,7 @@ HidParser_AddReportToCollection( // // no memory // - return HIDPARSER_STATUS_INSUFFICIENT_RESOURCES; + return HIDP_STATUS_INTERNAL_ERROR; } if (CurrentCollection->ReportCount) @@ -310,10 +310,10 @@ HidParser_AddReportToCollection( // // completed successfully // - return HIDPARSER_STATUS_SUCCESS; + return HIDP_STATUS_SUCCESS; } -HIDPARSER_STATUS +NTSTATUS HidParser_GetReport( IN PHID_PARSER_CONTEXT ParserContext, IN PHID_COLLECTION Collection, @@ -322,13 +322,13 @@ HidParser_GetReport( IN UCHAR CreateIfNotExists, OUT PHID_REPORT *OutReport) { - HIDPARSER_STATUS Status; + NTSTATUS Status; // // try finding existing report // Status = HidParser_FindReport(ParserContext, ReportType, ReportID, OutReport); - if (Status == HIDPARSER_STATUS_SUCCESS || CreateIfNotExists == FALSE) + if (Status == HIDP_STATUS_SUCCESS || CreateIfNotExists == FALSE) { // // founed report @@ -340,7 +340,7 @@ HidParser_GetReport( // allocate new report // Status = HidParser_AllocateReport(ReportType, ReportID, OutReport); - if (Status != HIDPARSER_STATUS_SUCCESS) + if (Status != HIDP_STATUS_SUCCESS) { // // failed to allocate report @@ -352,7 +352,7 @@ HidParser_GetReport( // add report // Status = HidParser_AddReportToCollection(ParserContext, Collection, *OutReport); - if (Status != HIDPARSER_STATUS_SUCCESS) + if (Status != HIDP_STATUS_SUCCESS) { // // failed to allocate report @@ -366,7 +366,7 @@ HidParser_GetReport( return Status; } -HIDPARSER_STATUS +NTSTATUS HidParser_ReserveReportItems( IN PHID_REPORT Report, IN ULONG ReportCount, @@ -381,7 +381,7 @@ HidParser_ReserveReportItems( // space is already allocated // *OutReport = Report; - return HIDPARSER_STATUS_SUCCESS; + return HIDP_STATUS_SUCCESS; } // @@ -399,7 +399,7 @@ HidParser_ReserveReportItems( // // no memory // - return HIDPARSER_STATUS_INSUFFICIENT_RESOURCES; + return HIDP_STATUS_INTERNAL_ERROR; } @@ -421,7 +421,7 @@ HidParser_ReserveReportItems( // // completed sucessfully // - return HIDPARSER_STATUS_SUCCESS; + return HIDP_STATUS_SUCCESS; } VOID @@ -452,7 +452,7 @@ HidParser_SignRange( *NewMaximum = Maximum; } -HIDPARSER_STATUS +NTSTATUS HidParser_InitReportItem( IN PHID_REPORT Report, IN PHID_REPORT_ITEM ReportItem, @@ -575,7 +575,7 @@ HidParser_InitReportItem( // // completed successfully // - return HIDPARSER_STATUS_SUCCESS; + return HIDP_STATUS_SUCCESS; } BOOLEAN @@ -640,7 +640,7 @@ HidParser_UpdateCollectionReport( } -HIDPARSER_STATUS +NTSTATUS HidParser_AddMainItem( IN PHID_PARSER_CONTEXT ParserContext, IN PHID_REPORT Report, @@ -649,7 +649,7 @@ HidParser_AddMainItem( IN PMAIN_ITEM_DATA ItemData, IN PHID_COLLECTION Collection) { - HIDPARSER_STATUS Status; + NTSTATUS Status; ULONG Index; PHID_REPORT NewReport; BOOLEAN Found; @@ -658,7 +658,7 @@ HidParser_AddMainItem( // first grow report item array // Status = HidParser_ReserveReportItems(Report, GlobalItemState->ReportCount, &NewReport); - if (Status != HIDPARSER_STATUS_SUCCESS) + if (Status != HIDP_STATUS_SUCCESS) { // // failed to allocate memory @@ -683,7 +683,7 @@ HidParser_AddMainItem( for(Index = 0; Index < GlobalItemState->ReportCount; Index++) { Status = HidParser_InitReportItem(NewReport, &NewReport->Items[NewReport->ItemCount], GlobalItemState, LocalItemState, ItemData, Index); - if (Status != HIDPARSER_STATUS_SUCCESS) + if (Status != HIDP_STATUS_SUCCESS) { // // failed to init report item @@ -700,10 +700,10 @@ HidParser_AddMainItem( // // done // - return HIDPARSER_STATUS_SUCCESS; + return HIDP_STATUS_SUCCESS; } -HIDPARSER_STATUS +NTSTATUS HidParser_ParseReportDescriptor( IN PUCHAR ReportDescriptor, IN ULONG ReportLength, @@ -712,7 +712,7 @@ HidParser_ParseReportDescriptor( PGLOBAL_ITEM_STATE LinkedGlobalItemState, NextLinkedGlobalItemState; ULONG Index; PUSAGE_VALUE NewUsageStack, UsageValue; - HIDPARSER_STATUS Status; + NTSTATUS Status; PHID_COLLECTION CurrentCollection, NewCollection; PUCHAR CurrentOffset, ReportEnd; PITEM_PREFIX CurrentItem; @@ -729,14 +729,14 @@ HidParser_ParseReportDescriptor( ReportEnd = ReportDescriptor + ReportLength; if (ReportDescriptor >= ReportEnd) - return HIDPARSER_STATUS_COLLECTION_NOT_FOUND; + return HIDP_STATUS_USAGE_NOT_FOUND; // // allocate parser // ParserContext = AllocFunction(sizeof(HID_PARSER_CONTEXT)); if (!ParserContext) - return HIDPARSER_STATUS_INSUFFICIENT_RESOURCES; + return HIDP_STATUS_INTERNAL_ERROR; // @@ -750,14 +750,14 @@ HidParser_ParseReportDescriptor( // no memory // FreeFunction(ParserContext); - return HIDPARSER_STATUS_INSUFFICIENT_RESOURCES; + return HIDP_STATUS_INTERNAL_ERROR; } // // now allocate root collection // Status = HidParser_AllocateCollection(NULL, COLLECTION_LOGICAL, &ParserContext->LocalItemState, &ParserContext->RootCollection); - if (Status != HIDPARSER_STATUS_SUCCESS) + if (Status != HIDP_STATUS_SUCCESS) { // // no memory @@ -765,7 +765,7 @@ HidParser_ParseReportDescriptor( FreeFunction(ParserContext->LocalItemState.UsageStack); ParserContext->LocalItemState.UsageStack = NULL; FreeFunction(ParserContext); - return HIDPARSER_STATUS_INSUFFICIENT_RESOURCES; + return HIDP_STATUS_INTERNAL_ERROR; } // @@ -870,13 +870,13 @@ HidParser_ParseReportDescriptor( // allocate new collection // Status = HidParser_AllocateCollection(CurrentCollection, (UCHAR)Data, &ParserContext->LocalItemState, &NewCollection); - ASSERT(Status == HIDPARSER_STATUS_SUCCESS); + ASSERT(Status == HIDP_STATUS_SUCCESS); // // add new collection to current collection // Status = HidParser_AddCollection(CurrentCollection, NewCollection); - ASSERT(Status == HIDPARSER_STATUS_SUCCESS); + ASSERT(Status == HIDP_STATUS_SUCCESS); // // make new collection current @@ -926,7 +926,7 @@ HidParser_ParseReportDescriptor( // get report // Status = HidParser_GetReport(ParserContext, CurrentCollection, ReportType, ParserContext->GlobalItemState.ReportId, TRUE, &Report); - ASSERT(Status == HIDPARSER_STATUS_SUCCESS); + ASSERT(Status == HIDP_STATUS_SUCCESS); // fill in a sensible default if the index isn't set if (!ParserContext->LocalItemState.DesignatorIndexSet) { @@ -946,7 +946,7 @@ HidParser_ParseReportDescriptor( // add states & data to the report // Status = HidParser_AddMainItem(ParserContext, Report, &ParserContext->GlobalItemState, &ParserContext->LocalItemState, MainItemData, CurrentCollection); - ASSERT(Status == HIDPARSER_STATUS_SUCCESS); + ASSERT(Status == HIDP_STATUS_SUCCESS); } // @@ -1241,7 +1241,7 @@ HidParser_ParseReportDescriptor( // // done // - return HIDPARSER_STATUS_SUCCESS; + return HIDP_STATUS_SUCCESS; } PHID_COLLECTION @@ -1299,7 +1299,7 @@ HidParser_NumberOfTopCollections( return ParserContext->RootCollection->NodeCount; } -HIDPARSER_STATUS +NTSTATUS HidParser_BuildContext( IN PVOID ParserContext, IN ULONG CollectionIndex, @@ -1308,7 +1308,7 @@ HidParser_BuildContext( { PHID_COLLECTION Collection; PVOID Context; - HIDPARSER_STATUS Status; + NTSTATUS Status; // // lets get the collection @@ -1325,14 +1325,14 @@ HidParser_BuildContext( // // no memory // - return HIDPARSER_STATUS_INSUFFICIENT_RESOURCES; + return HIDP_STATUS_INTERNAL_ERROR; } // // lets build the context // Status = HidParser_BuildCollectionContext(Collection, Context, ContextSize); - if (Status == HIDPARSER_STATUS_SUCCESS) + if (Status == HIDP_STATUS_SUCCESS) { // // store context diff --git a/sdk/lib/drivers/hidparser/parser.h b/sdk/lib/drivers/hidparser/parser.h index 176461a6438..5e115399b50 100644 --- a/sdk/lib/drivers/hidparser/parser.h +++ b/sdk/lib/drivers/hidparser/parser.h @@ -266,7 +266,7 @@ HidParser_UsesReportId( IN PVOID CollectionContext, IN UCHAR ReportType); -HIDPARSER_STATUS +NTSTATUS HidParser_GetCollectionUsagePage( IN PVOID CollectionContext, OUT PUSHORT Usage, @@ -294,7 +294,7 @@ HidParser_GetMaxUsageListLengthWithReportAndPage( IN UCHAR ReportType, IN USAGE UsagePage OPTIONAL); -HIDPARSER_STATUS +NTSTATUS HidParser_GetSpecificValueCapsWithReport( IN PVOID CollectionContext, IN UCHAR ReportType, @@ -304,7 +304,7 @@ HidParser_GetSpecificValueCapsWithReport( IN OUT PUSHORT ValueCapsLength); -HIDPARSER_STATUS +NTSTATUS HidParser_GetUsagesWithReport( IN PVOID CollectionContext, IN UCHAR ReportType, @@ -314,7 +314,7 @@ HidParser_GetUsagesWithReport( IN PCHAR ReportDescriptor, IN ULONG ReportDescriptorLength); -HIDPARSER_STATUS +NTSTATUS HidParser_GetScaledUsageValueWithReport( IN PVOID CollectionContext, IN UCHAR ReportType, @@ -324,7 +324,7 @@ HidParser_GetScaledUsageValueWithReport( IN PCHAR ReportDescriptor, IN ULONG ReportDescriptorLength); -HIDPARSER_STATUS +NTSTATUS HidParser_GetUsageValueWithReport( IN PVOID CollectionContext, IN UCHAR ReportType, @@ -336,7 +336,7 @@ HidParser_GetUsageValueWithReport( /* parser.c */ -HIDPARSER_STATUS +NTSTATUS HidParser_BuildContext( IN PVOID ParserContext, IN ULONG CollectionIndex, @@ -347,7 +347,7 @@ ULONG HidParser_CalculateContextSize( IN PHID_COLLECTION Collection); -HIDPARSER_STATUS +NTSTATUS HidParser_ParseReportDescriptor( PUCHAR Report, ULONG ReportSize, @@ -373,7 +373,7 @@ ULONG HidParser_GetTotalCollectionCount( IN PVOID CollectionContext); -HIDPARSER_STATUS +NTSTATUS HidParser_BuildCollectionContext( IN PHID_COLLECTION RootCollection, IN PVOID Context,
4 years, 5 months
1
0
0
0
[reactos] 01/02: [HIDPARSER] Remove HID_PARSER class, and directly use functions
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c151f8a1c7979e670f322…
commit c151f8a1c7979e670f322b2e5532116011fbb084 Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Fri May 3 13:24:05 2019 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Fri Jul 31 14:31:27 2020 +0200 [HIDPARSER] Remove HID_PARSER class, and directly use functions --- sdk/lib/drivers/hidparser/api.c | 33 ++------ sdk/lib/drivers/hidparser/context.c | 10 +-- sdk/lib/drivers/hidparser/hidp.c | 81 +++---------------- sdk/lib/drivers/hidparser/hidparser.c | 91 ++++++++------------- sdk/lib/drivers/hidparser/hidparser.h | 80 ------------------ sdk/lib/drivers/hidparser/parser.c | 148 +++++++++++++++------------------- sdk/lib/drivers/hidparser/parser.h | 13 +-- 7 files changed, 118 insertions(+), 338 deletions(-) diff --git a/sdk/lib/drivers/hidparser/api.c b/sdk/lib/drivers/hidparser/api.c index d4eb327a9a4..6941bd79d07 100644 --- a/sdk/lib/drivers/hidparser/api.c +++ b/sdk/lib/drivers/hidparser/api.c @@ -206,23 +206,6 @@ HidParser_GetReportItemTypeCountFromReportType( return ItemCount; } - -VOID -HidParser_InitParser( - IN PHIDPARSER_ALLOC_FUNCTION AllocFunction, - IN PHIDPARSER_FREE_FUNCTION FreeFunction, - IN PHIDPARSER_ZERO_FUNCTION ZeroFunction, - IN PHIDPARSER_COPY_FUNCTION CopyFunction, - IN PHIDPARSER_DEBUG_FUNCTION DebugFunction, - OUT PHID_PARSER Parser) -{ - Parser->Alloc = AllocFunction; - Parser->Free = FreeFunction; - Parser->Zero = ZeroFunction; - Parser->Copy = CopyFunction; - Parser->Debug = DebugFunction; -} - ULONG HidParser_GetMaxUsageListLengthWithReportAndPage( IN PVOID CollectionContext, @@ -269,7 +252,6 @@ HidParser_GetMaxUsageListLengthWithReportAndPage( HIDPARSER_STATUS HidParser_GetSpecificValueCapsWithReport( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN UCHAR ReportType, IN USHORT UsagePage, @@ -313,7 +295,7 @@ HidParser_GetSpecificValueCapsWithReport( // // zero caps // - Parser->Zero(&ValueCaps[ItemCount], sizeof(HIDP_VALUE_CAPS)); + ZeroFunction(&ValueCaps[ItemCount], sizeof(HIDP_VALUE_CAPS)); // // init caps @@ -359,7 +341,6 @@ HidParser_GetSpecificValueCapsWithReport( HIDPARSER_STATUS HidParser_GetUsagesWithReport( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN UCHAR ReportType, IN USAGE UsagePage, @@ -517,14 +498,14 @@ HidParser_GetUsagesWithReport( // // success, clear rest of array // - Parser->Zero(&UsageAndPage[ItemCount], (*UsageLength - ItemCount) * sizeof(USAGE_AND_PAGE)); + ZeroFunction(&UsageAndPage[ItemCount], (*UsageLength - ItemCount) * sizeof(USAGE_AND_PAGE)); } else { // // success, clear rest of array // - Parser->Zero(&UsageList[ItemCount], (*UsageLength - ItemCount) * sizeof(USAGE)); + ZeroFunction(&UsageList[ItemCount], (*UsageLength - ItemCount) * sizeof(USAGE)); } @@ -567,7 +548,6 @@ HidParser_UsesReportId( HIDPARSER_STATUS HidParser_GetUsageValueWithReport( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN UCHAR ReportType, IN USAGE UsagePage, @@ -635,7 +615,7 @@ HidParser_GetUsageValueWithReport( // one extra shift for skipping the prepended report id // Data = 0; - Parser->Copy(&Data, &ReportDescriptor[ReportItem->ByteOffset + 1], min(sizeof(ULONG), ReportDescriptorLength - (ReportItem->ByteOffset + 1))); + CopyFunction(&Data, &ReportDescriptor[ReportItem->ByteOffset + 1], min(sizeof(ULONG), ReportDescriptorLength - (ReportItem->ByteOffset + 1))); // // shift data @@ -664,7 +644,6 @@ HidParser_GetUsageValueWithReport( HIDPARSER_STATUS HidParser_GetScaledUsageValueWithReport( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN UCHAR ReportType, IN USAGE UsagePage, @@ -732,7 +711,7 @@ HidParser_GetScaledUsageValueWithReport( // one extra shift for skipping the prepended report id // Data = 0; - Parser->Copy(&Data, &ReportDescriptor[ReportItem->ByteOffset + 1], min(sizeof(ULONG), ReportDescriptorLength - (ReportItem->ByteOffset + 1))); + CopyFunction(&Data, &ReportDescriptor[ReportItem->ByteOffset + 1], min(sizeof(ULONG), ReportDescriptorLength - (ReportItem->ByteOffset + 1))); // // shift data @@ -870,7 +849,6 @@ HidParser_DispatchKey( HIDPARSER_STATUS HidParser_TranslateKbdUsage( - IN PHID_PARSER Parser, IN USAGE Usage, IN HIDP_KEYBOARD_DIRECTION KeyAction, IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState, @@ -933,7 +911,6 @@ HidParser_TranslateKbdUsage( HIDPARSER_STATUS HidParser_TranslateCustUsage( - IN PHID_PARSER Parser, IN USAGE Usage, IN HIDP_KEYBOARD_DIRECTION KeyAction, IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState, diff --git a/sdk/lib/drivers/hidparser/context.c b/sdk/lib/drivers/hidparser/context.c index 455d9af8c2a..b97ef67ebac 100644 --- a/sdk/lib/drivers/hidparser/context.c +++ b/sdk/lib/drivers/hidparser/context.c @@ -81,7 +81,6 @@ HidParser_CalculateContextSize( ULONG HidParser_StoreCollection( - IN PHID_PARSER Parser, IN PHID_COLLECTION Collection, IN PHID_COLLECTION_CONTEXT CollectionContext, IN ULONG CurrentOffset) @@ -105,7 +104,7 @@ HidParser_StoreCollection( // // first copy the collection details // - Parser->Copy(TargetCollection, Collection, sizeof(HID_COLLECTION)); + CopyFunction(TargetCollection, Collection, sizeof(HID_COLLECTION)); // // calulcate collection size @@ -140,7 +139,7 @@ HidParser_StoreCollection( // // copy report item // - Parser->Copy(&CollectionContext->RawData[CurrentOffset], Collection->Reports[Index], ReportSize); + CopyFunction(&CollectionContext->RawData[CurrentOffset], Collection->Reports[Index], ReportSize); // // store offset to report item @@ -168,7 +167,7 @@ HidParser_StoreCollection( // // store sub collections // - CurrentOffset += HidParser_StoreCollection(Parser, Collection->Nodes[Index], CollectionContext, CurrentOffset); + CurrentOffset += HidParser_StoreCollection(Collection->Nodes[Index], CollectionContext, CurrentOffset); // // sanity check @@ -184,7 +183,6 @@ HidParser_StoreCollection( HIDPARSER_STATUS HidParser_BuildCollectionContext( - IN PHID_PARSER Parser, IN PHID_COLLECTION RootCollection, IN PVOID Context, IN ULONG ContextSize) @@ -201,7 +199,7 @@ HidParser_BuildCollectionContext( // // store collections // - CollectionSize = HidParser_StoreCollection(Parser, RootCollection, CollectionContext, 0); + CollectionSize = HidParser_StoreCollection(RootCollection, CollectionContext, 0); // // sanity check diff --git a/sdk/lib/drivers/hidparser/hidp.c b/sdk/lib/drivers/hidparser/hidp.c index cd2d4a2004a..2d99ed89e72 100644 --- a/sdk/lib/drivers/hidparser/hidp.c +++ b/sdk/lib/drivers/hidparser/hidp.c @@ -13,17 +13,10 @@ 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); + HidParser_FreeCollectionDescription(DeviceDescription); } @@ -34,17 +27,10 @@ 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); + return HidParser_GetCaps(PreparsedData, Capabilities); } NTSTATUS @@ -78,18 +64,12 @@ HidP_GetCollectionDescription( 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); + Status = HidParser_GetCollectionDescription(ReportDesc, DescLength, PoolType, DeviceDescription); return TranslateStatusForUpperLayer(Status); } @@ -101,23 +81,15 @@ HidP_MaxUsageListLength( 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); + return HidParser_MaxUsageListLength(PreparsedData, ReportType, UsagePage); } HIDAPI @@ -132,22 +104,15 @@ HidP_GetSpecificValueCaps( 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); + return HidParser_GetSpecificValueCaps(PreparsedData, ReportType, UsagePage, LinkCollection, Usage, ValueCaps, ValueCapsLength); } HIDAPI @@ -163,22 +128,15 @@ HidP_GetUsages( 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); + return HidParser_GetUsages(PreparsedData, ReportType, UsagePage, LinkCollection, UsageList, UsageLength, Report, ReportLength); } @@ -238,22 +196,15 @@ HidP_GetScaledUsageValue( 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); + return HidParser_GetScaledUsageValue(PreparsedData, ReportType, UsagePage, LinkCollection, Usage, UsageValue, Report, ReportLength); } HIDAPI @@ -269,22 +220,15 @@ HidP_GetUsageValue( 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); + return HidParser_GetUsageValue(PreparsedData, ReportType, UsagePage, LinkCollection, Usage, UsageValue, Report, ReportLength); } @@ -299,17 +243,10 @@ HidP_TranslateUsageAndPagesToI8042ScanCodes( 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); + return HidParser_TranslateUsageAndPagesToI8042ScanCodes(ChangedUsageList, UsageListLength, KeyAction, ModifierState, InsertCodesProcedure, InsertCodesContext); } HIDAPI diff --git a/sdk/lib/drivers/hidparser/hidparser.c b/sdk/lib/drivers/hidparser/hidparser.c index 957f47cbf83..10b6e3ddcf2 100644 --- a/sdk/lib/drivers/hidparser/hidparser.c +++ b/sdk/lib/drivers/hidparser/hidparser.c @@ -47,7 +47,6 @@ TranslateHidParserStatus( NTSTATUS NTAPI HidParser_GetCollectionDescription( - IN PHID_PARSER Parser, IN PHIDP_REPORT_DESCRIPTOR ReportDesc, IN ULONG DescLength, IN POOL_TYPE PoolType, @@ -61,13 +60,13 @@ HidParser_GetCollectionDescription( // // first parse the report descriptor // - ParserStatus = HidParser_ParseReportDescriptor(Parser, ReportDesc, DescLength, &ParserContext); + ParserStatus = HidParser_ParseReportDescriptor(ReportDesc, DescLength, &ParserContext); if (ParserStatus != HIDPARSER_STATUS_SUCCESS) { // // failed to parse report descriptor // - Parser->Debug("[HIDPARSER] Failed to parse report descriptor with %x\n", ParserStatus); + DebugFunction("[HIDPARSER] Failed to parse report descriptor with %x\n", ParserStatus); return ParserStatus; } @@ -87,12 +86,12 @@ HidParser_GetCollectionDescription( // // zero description // - Parser->Zero(DeviceDescription, sizeof(HIDP_DEVICE_DESC)); + ZeroFunction(DeviceDescription, sizeof(HIDP_DEVICE_DESC)); // // allocate collection // - DeviceDescription->CollectionDesc = (PHIDP_COLLECTION_DESC)Parser->Alloc(sizeof(HIDP_COLLECTION_DESC) * CollectionCount); + DeviceDescription->CollectionDesc = (PHIDP_COLLECTION_DESC)AllocFunction(sizeof(HIDP_COLLECTION_DESC) * CollectionCount); if (!DeviceDescription->CollectionDesc) { // @@ -104,13 +103,13 @@ HidParser_GetCollectionDescription( // // allocate report description // - DeviceDescription->ReportIDs = (PHIDP_REPORT_IDS)Parser->Alloc(sizeof(HIDP_REPORT_IDS) * CollectionCount); + DeviceDescription->ReportIDs = (PHIDP_REPORT_IDS)AllocFunction(sizeof(HIDP_REPORT_IDS) * CollectionCount); if (!DeviceDescription->ReportIDs) { // // no memory // - Parser->Free(DeviceDescription->CollectionDesc); + FreeFunction(DeviceDescription->CollectionDesc); return STATUS_INSUFFICIENT_RESOURCES; } @@ -119,15 +118,15 @@ HidParser_GetCollectionDescription( // // set preparsed data length // - DeviceDescription->CollectionDesc[Index].PreparsedDataLength = HidParser_GetContextSize(Parser, ParserContext, Index); - ParserStatus = HidParser_BuildContext(Parser, ParserContext, Index, DeviceDescription->CollectionDesc[Index].PreparsedDataLength, (PVOID*)&DeviceDescription->CollectionDesc[Index].PreparsedData); + DeviceDescription->CollectionDesc[Index].PreparsedDataLength = HidParser_GetContextSize(ParserContext, Index); + ParserStatus = HidParser_BuildContext(ParserContext, Index, DeviceDescription->CollectionDesc[Index].PreparsedDataLength, (PVOID*)&DeviceDescription->CollectionDesc[Index].PreparsedData); if (ParserStatus != HIDPARSER_STATUS_SUCCESS) { // // no memory // - Parser->Free(DeviceDescription->CollectionDesc); - Parser->Free(DeviceDescription->ReportIDs); + FreeFunction(DeviceDescription->CollectionDesc); + FreeFunction(DeviceDescription->ReportIDs); return ParserStatus; } @@ -158,8 +157,8 @@ HidParser_GetCollectionDescription( if (ParserStatus != HIDPARSER_STATUS_SUCCESS) { // collection not found - Parser->Free(DeviceDescription->CollectionDesc); - Parser->Free(DeviceDescription->ReportIDs); + FreeFunction(DeviceDescription->CollectionDesc); + FreeFunction(DeviceDescription->ReportIDs); return ParserStatus; } @@ -193,7 +192,6 @@ HidParser_GetCollectionDescription( VOID NTAPI HidParser_FreeCollectionDescription( - IN PHID_PARSER Parser, IN PHIDP_DEVICE_DESC DeviceDescription) { ULONG Index; @@ -206,32 +204,31 @@ HidParser_FreeCollectionDescription( // // free collection context // - Parser->Free(DeviceDescription->CollectionDesc[Index].PreparsedData); + FreeFunction(DeviceDescription->CollectionDesc[Index].PreparsedData); } // // now free collection description // - Parser->Free(DeviceDescription->CollectionDesc); + FreeFunction(DeviceDescription->CollectionDesc); // // free report description // - Parser->Free(DeviceDescription->ReportIDs); + FreeFunction(DeviceDescription->ReportIDs); } HIDAPI NTSTATUS NTAPI HidParser_GetCaps( - IN PHID_PARSER Parser, IN PVOID CollectionContext, OUT PHIDP_CAPS Capabilities) { // // zero capabilities // - Parser->Zero(Capabilities, sizeof(HIDP_CAPS)); + ZeroFunction(Capabilities, sizeof(HIDP_CAPS)); // // init capabilities @@ -285,7 +282,6 @@ HIDAPI ULONG NTAPI HidParser_MaxUsageListLength( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage OPTIONAL) @@ -342,20 +338,18 @@ HIDAPI NTSTATUS NTAPI HidParser_GetButtonCaps( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN PHIDP_BUTTON_CAPS ButtonCaps, IN PUSHORT ButtonCapsLength) { - return HidParser_GetSpecificButtonCaps(Parser, CollectionContext, ReportType, HID_USAGE_PAGE_UNDEFINED, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_PAGE_UNDEFINED, ButtonCaps, (PULONG)ButtonCapsLength); + return HidParser_GetSpecificButtonCaps(CollectionContext, ReportType, HID_USAGE_PAGE_UNDEFINED, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_PAGE_UNDEFINED, ButtonCaps, (PULONG)ButtonCapsLength); } HIDAPI NTSTATUS NTAPI HidParser_GetSpecificValueCaps( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -376,21 +370,21 @@ HidParser_GetSpecificValueCaps( // // input report // - ParserStatus = HidParser_GetSpecificValueCapsWithReport(Parser, CollectionContext, HID_REPORT_TYPE_INPUT, UsagePage, Usage, ValueCaps, ValueCapsLength); + ParserStatus = HidParser_GetSpecificValueCapsWithReport(CollectionContext, HID_REPORT_TYPE_INPUT, UsagePage, Usage, ValueCaps, ValueCapsLength); } else if (ReportType == HidP_Output) { // // input report // - ParserStatus = HidParser_GetSpecificValueCapsWithReport(Parser, CollectionContext, HID_REPORT_TYPE_OUTPUT, UsagePage, Usage, ValueCaps, ValueCapsLength); + ParserStatus = HidParser_GetSpecificValueCapsWithReport(CollectionContext, HID_REPORT_TYPE_OUTPUT, UsagePage, Usage, ValueCaps, ValueCapsLength); } else if (ReportType == HidP_Feature) { // // input report // - ParserStatus = HidParser_GetSpecificValueCapsWithReport(Parser, CollectionContext, HID_REPORT_TYPE_FEATURE, UsagePage, Usage, ValueCaps, ValueCapsLength); + ParserStatus = HidParser_GetSpecificValueCapsWithReport(CollectionContext, HID_REPORT_TYPE_FEATURE, UsagePage, Usage, ValueCaps, ValueCapsLength); } else { @@ -548,7 +542,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetUsages( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -570,21 +563,21 @@ HidParser_GetUsages( // // input report // - ParserStatus = HidParser_GetUsagesWithReport(Parser, CollectionContext, HID_REPORT_TYPE_INPUT, UsagePage, UsageList, UsageLength, Report, ReportLength); + ParserStatus = HidParser_GetUsagesWithReport(CollectionContext, HID_REPORT_TYPE_INPUT, UsagePage, UsageList, UsageLength, Report, ReportLength); } else if (ReportType == HidP_Output) { // // input report // - ParserStatus = HidParser_GetUsagesWithReport(Parser, CollectionContext, HID_REPORT_TYPE_OUTPUT, UsagePage, UsageList, UsageLength, Report, ReportLength); + ParserStatus = HidParser_GetUsagesWithReport(CollectionContext, HID_REPORT_TYPE_OUTPUT, UsagePage, UsageList, UsageLength, Report, ReportLength); } else if (ReportType == HidP_Feature) { // // input report // - ParserStatus = HidParser_GetUsagesWithReport(Parser, CollectionContext, HID_REPORT_TYPE_FEATURE, UsagePage, UsageList, UsageLength, Report, ReportLength); + ParserStatus = HidParser_GetUsagesWithReport(CollectionContext, HID_REPORT_TYPE_FEATURE, UsagePage, UsageList, UsageLength, Report, ReportLength); } else { @@ -612,7 +605,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetScaledUsageValue( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -634,21 +626,21 @@ HidParser_GetScaledUsageValue( // // input report // - ParserStatus = HidParser_GetScaledUsageValueWithReport(Parser, CollectionContext, HID_REPORT_TYPE_INPUT, UsagePage, Usage, UsageValue, Report, ReportLength); + ParserStatus = HidParser_GetScaledUsageValueWithReport(CollectionContext, HID_REPORT_TYPE_INPUT, UsagePage, Usage, UsageValue, Report, ReportLength); } else if (ReportType == HidP_Output) { // // input report // - ParserStatus = HidParser_GetScaledUsageValueWithReport(Parser, CollectionContext, HID_REPORT_TYPE_OUTPUT, UsagePage, Usage, UsageValue, Report, ReportLength); + ParserStatus = HidParser_GetScaledUsageValueWithReport(CollectionContext, HID_REPORT_TYPE_OUTPUT, UsagePage, Usage, UsageValue, Report, ReportLength); } else if (ReportType == HidP_Feature) { // // input report // - ParserStatus = HidParser_GetScaledUsageValueWithReport(Parser, CollectionContext, HID_REPORT_TYPE_FEATURE, UsagePage, Usage, UsageValue, Report, ReportLength); + ParserStatus = HidParser_GetScaledUsageValueWithReport(CollectionContext, HID_REPORT_TYPE_FEATURE, UsagePage, Usage, UsageValue, Report, ReportLength); } else { @@ -676,7 +668,6 @@ HIDAPI NTSTATUS NTAPI HidParser_TranslateUsageAndPagesToI8042ScanCodes( - IN PHID_PARSER Parser, IN PUSAGE_AND_PAGE ChangedUsageList, IN ULONG UsageListLength, IN HIDP_KEYBOARD_DIRECTION KeyAction, @@ -697,14 +688,14 @@ HidParser_TranslateUsageAndPagesToI8042ScanCodes( // // process keyboard usage // - Status = HidParser_TranslateKbdUsage(Parser, ChangedUsageList[Index].Usage, KeyAction, ModifierState, InsertCodesProcedure, InsertCodesContext); + Status = HidParser_TranslateKbdUsage(ChangedUsageList[Index].Usage, KeyAction, ModifierState, InsertCodesProcedure, InsertCodesContext); } else if (ChangedUsageList[Index].UsagePage == HID_USAGE_PAGE_CONSUMER) { // // process consumer usage // - Status = HidParser_TranslateCustUsage(Parser, ChangedUsageList[Index].Usage, KeyAction, ModifierState, InsertCodesProcedure, InsertCodesContext); + Status = HidParser_TranslateCustUsage(ChangedUsageList[Index].Usage, KeyAction, ModifierState, InsertCodesProcedure, InsertCodesContext); } else { @@ -745,7 +736,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetUsagesEx( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USHORT LinkCollection, @@ -754,7 +744,7 @@ HidParser_GetUsagesEx( IN PCHAR Report, IN ULONG ReportLength) { - return HidParser_GetUsages(Parser, CollectionContext, ReportType, HID_USAGE_PAGE_UNDEFINED, LinkCollection, (PUSAGE)ButtonList, UsageLength, Report, ReportLength); + return HidParser_GetUsages(CollectionContext, ReportType, HID_USAGE_PAGE_UNDEFINED, LinkCollection, (PUSAGE)ButtonList, UsageLength, Report, ReportLength); } HIDAPI @@ -890,7 +880,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetSpecificButtonCaps( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -909,7 +898,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetData( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, OUT PHIDP_DATA DataList, @@ -926,7 +914,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetExtendedAttributes( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USHORT DataIndex, @@ -942,7 +929,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetLinkCollectionNodes( - IN PHID_PARSER Parser, IN PVOID CollectionContext, OUT PHIDP_LINK_COLLECTION_NODE LinkCollectionNodes, IN OUT PULONG LinkCollectionNodesLength) @@ -956,7 +942,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetUsageValue( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -978,21 +963,21 @@ HidParser_GetUsageValue( // // input report // - ParserStatus = HidParser_GetUsageValueWithReport(Parser, CollectionContext, HID_REPORT_TYPE_INPUT, UsagePage, Usage, UsageValue, Report, ReportLength); + ParserStatus = HidParser_GetUsageValueWithReport(CollectionContext, HID_REPORT_TYPE_INPUT, UsagePage, Usage, UsageValue, Report, ReportLength); } else if (ReportType == HidP_Output) { // // input report // - ParserStatus = HidParser_GetUsageValueWithReport(Parser, CollectionContext, HID_REPORT_TYPE_OUTPUT, UsagePage, Usage, UsageValue, Report, ReportLength); + ParserStatus = HidParser_GetUsageValueWithReport(CollectionContext, HID_REPORT_TYPE_OUTPUT, UsagePage, Usage, UsageValue, Report, ReportLength); } else if (ReportType == HidP_Feature) { // // input report // - ParserStatus = HidParser_GetUsageValueWithReport(Parser, CollectionContext, HID_REPORT_TYPE_FEATURE, UsagePage, Usage, UsageValue, Report, ReportLength); + ParserStatus = HidParser_GetUsageValueWithReport(CollectionContext, HID_REPORT_TYPE_FEATURE, UsagePage, Usage, UsageValue, Report, ReportLength); } else { @@ -1019,7 +1004,6 @@ HidParser_GetUsageValue( NTSTATUS NTAPI HidParser_SysPowerEvent( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN PCHAR HidPacket, IN USHORT HidPacketLength, @@ -1033,7 +1017,6 @@ HidParser_SysPowerEvent( NTSTATUS NTAPI HidParser_SysPowerCaps ( - IN PHID_PARSER Parser, IN PVOID CollectionContext, OUT PULONG OutputBuffer) { @@ -1046,7 +1029,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetUsageValueArray( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -1066,7 +1048,6 @@ HIDAPI NTSTATUS NTAPI HidParser_UnsetUsages( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -1101,7 +1082,6 @@ HIDAPI NTSTATUS NTAPI HidParser_SetUsages( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -1120,7 +1100,6 @@ HIDAPI NTSTATUS NTAPI HidParser_SetUsageValueArray( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -1140,7 +1119,6 @@ HIDAPI NTSTATUS NTAPI HidParser_SetUsageValue( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -1159,7 +1137,6 @@ HIDAPI NTSTATUS NTAPI HidParser_SetScaledUsageValue( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -1178,7 +1155,6 @@ HIDAPI NTSTATUS NTAPI HidParser_SetData( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN PHIDP_DATA DataList, @@ -1195,7 +1171,6 @@ HIDAPI ULONG NTAPI HidParser_MaxDataListLength( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType) { @@ -1208,7 +1183,6 @@ HIDAPI NTSTATUS NTAPI HidParser_InitializeReportForID( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN UCHAR ReportID, @@ -1226,7 +1200,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetValueCaps( - IN PHID_PARSER Parser, IN PVOID CollectionContext, HIDP_REPORT_TYPE ReportType, PHIDP_VALUE_CAPS ValueCaps, diff --git a/sdk/lib/drivers/hidparser/hidparser.h b/sdk/lib/drivers/hidparser/hidparser.h index befcd32bda6..333bbe1502b 100644 --- a/sdk/lib/drivers/hidparser/hidparser.h +++ b/sdk/lib/drivers/hidparser/hidparser.h @@ -10,15 +10,6 @@ #pragma once -// -// function prototypes -// -typedef PVOID (NTAPI *PHIDPARSER_ALLOC_FUNCTION)(ULONG Size); -typedef VOID (NTAPI *PHIDPARSER_FREE_FUNCTION)(PVOID Item); -typedef VOID (NTAPI *PHIDPARSER_ZERO_FUNCTION)(PVOID Item, ULONG Size); -typedef VOID (NTAPI *PHIDPARSER_COPY_FUNCTION)(PVOID Target, PVOID Source, ULONG Size); -typedef VOID (__cdecl *PHIDPARSER_DEBUG_FUNCTION)(LPCSTR Src, ...); - // // status code // @@ -42,52 +33,9 @@ typedef enum HIDPARSER_STATUS_BAD_LOG_PHY_VALUES = -10 }HIDPARSER_STATUS_CODES; -typedef struct -{ - // - // size of struct - // - unsigned long Size; - - // - // allocation function - // - PHIDPARSER_ALLOC_FUNCTION Alloc; - - // - // free function - // - PHIDPARSER_FREE_FUNCTION Free; - - // - // zero function - // - PHIDPARSER_ZERO_FUNCTION Zero; - - // - // copy function - // - PHIDPARSER_COPY_FUNCTION Copy; - - // - // debug function - // - PHIDPARSER_DEBUG_FUNCTION Debug; -}HID_PARSER, *PHID_PARSER; - -VOID -HidParser_InitParser( - IN PHIDPARSER_ALLOC_FUNCTION AllocFunction, - IN PHIDPARSER_FREE_FUNCTION FreeFunction, - IN PHIDPARSER_ZERO_FUNCTION ZeroFunction, - IN PHIDPARSER_COPY_FUNCTION CopyFunction, - IN PHIDPARSER_DEBUG_FUNCTION DebugFunction, - OUT PHID_PARSER Parser); - NTSTATUS NTAPI HidParser_GetCollectionDescription( - IN PHID_PARSER Parser, IN PHIDP_REPORT_DESCRIPTOR ReportDesc, IN ULONG DescLength, IN POOL_TYPE PoolType, @@ -96,14 +44,12 @@ HidParser_GetCollectionDescription( VOID NTAPI HidParser_FreeCollectionDescription( - IN PHID_PARSER Parser, IN PHIDP_DEVICE_DESC DeviceDescription); HIDAPI NTSTATUS NTAPI HidParser_GetCaps( - IN PHID_PARSER Parser, IN PVOID CollectionContext, OUT PHIDP_CAPS Capabilities); @@ -111,7 +57,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetSpecificValueCaps( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -125,7 +70,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetButtonCaps( - IN PHID_PARSER Parser, IN PVOID CollectionContext, HIDP_REPORT_TYPE ReportType, PHIDP_BUTTON_CAPS ButtonCaps, @@ -135,7 +79,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetSpecificButtonCaps( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -148,7 +91,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetScaledUsageValue( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -163,7 +105,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetData( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, OUT PHIDP_DATA DataList, @@ -175,7 +116,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetExtendedAttributes( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USHORT DataIndex, @@ -186,7 +126,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetLinkCollectionNodes( - IN PHID_PARSER Parser, IN PVOID CollectionContext, OUT PHIDP_LINK_COLLECTION_NODE LinkCollectionNodes, IN OUT PULONG LinkCollectionNodesLength); @@ -196,7 +135,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetUsageValue( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -221,7 +159,6 @@ HIDAPI ULONG NTAPI HidParser_MaxUsageListLength( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage OPTIONAL); @@ -230,7 +167,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetUsages( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -244,7 +180,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetUsagesEx( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USHORT LinkCollection, @@ -257,7 +192,6 @@ HidParser_GetUsagesEx( NTSTATUS NTAPI HidParser_SysPowerEvent ( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN PCHAR HidPacket, IN USHORT HidPacketLength, @@ -266,7 +200,6 @@ HidParser_SysPowerEvent ( NTSTATUS NTAPI HidParser_SysPowerCaps ( - IN PHID_PARSER Parser, IN PVOID CollectionContext, OUT PULONG OutputBuffer); @@ -274,7 +207,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetUsageValueArray( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -300,7 +232,6 @@ HIDAPI NTSTATUS NTAPI HidParser_UnsetUsages( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -325,7 +256,6 @@ HIDAPI NTSTATUS NTAPI HidParser_TranslateUsageAndPagesToI8042ScanCodes( - IN PHID_PARSER Parser, IN PUSAGE_AND_PAGE ChangedUsageList, IN ULONG UsageListLength, IN HIDP_KEYBOARD_DIRECTION KeyAction, @@ -337,7 +267,6 @@ HIDAPI NTSTATUS NTAPI HidParser_SetUsages( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -351,7 +280,6 @@ HIDAPI NTSTATUS NTAPI HidParser_SetUsageValueArray( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -366,7 +294,6 @@ HIDAPI NTSTATUS NTAPI HidParser_SetUsageValue( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -380,7 +307,6 @@ HIDAPI NTSTATUS NTAPI HidParser_SetScaledUsageValue( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, @@ -394,7 +320,6 @@ HIDAPI NTSTATUS NTAPI HidParser_SetData( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN PHIDP_DATA DataList, @@ -406,7 +331,6 @@ HIDAPI ULONG NTAPI HidParser_MaxDataListLength( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType); @@ -414,7 +338,6 @@ HIDAPI NTSTATUS NTAPI HidParser_InitializeReportForID( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN UCHAR ReportID, @@ -423,7 +346,6 @@ HidParser_InitializeReportForID( HIDPARSER_STATUS HidParser_TranslateKbdUsage( - IN PHID_PARSER Parser, IN USAGE Usage, IN HIDP_KEYBOARD_DIRECTION KeyAction, IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState, @@ -432,7 +354,6 @@ HidParser_TranslateKbdUsage( HIDPARSER_STATUS HidParser_TranslateCustUsage( - IN PHID_PARSER Parser, IN USAGE Usage, IN HIDP_KEYBOARD_DIRECTION KeyAction, IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState, @@ -443,7 +364,6 @@ HIDAPI NTSTATUS NTAPI HidParser_GetValueCaps( - PHID_PARSER Parser, IN PVOID CollectionContext, HIDP_REPORT_TYPE ReportType, PHIDP_VALUE_CAPS ValueCaps, diff --git a/sdk/lib/drivers/hidparser/parser.c b/sdk/lib/drivers/hidparser/parser.c index e0208f6f99f..b2ce3d4b7a1 100644 --- a/sdk/lib/drivers/hidparser/parser.c +++ b/sdk/lib/drivers/hidparser/parser.c @@ -17,7 +17,6 @@ static UCHAR ItemSize[4] = { 0, 1, 2, 4 }; VOID HidParser_DeleteReport( - IN PHID_PARSER Parser, IN PHID_REPORT Report) { // @@ -27,7 +26,6 @@ HidParser_DeleteReport( VOID HidParser_FreeCollection( - IN PHID_PARSER Parser, IN PHID_COLLECTION Collection) { // @@ -37,7 +35,6 @@ HidParser_FreeCollection( HIDPARSER_STATUS HidParser_AllocateCollection( - IN PHID_PARSER Parser, IN PHID_COLLECTION ParentCollection, IN UCHAR Type, IN PLOCAL_ITEM_STATE LocalItemState, @@ -49,7 +46,7 @@ HidParser_AllocateCollection( // // first allocate the collection // - Collection = (PHID_COLLECTION)Parser->Alloc(sizeof(HID_COLLECTION)); + Collection = (PHID_COLLECTION)AllocFunction(sizeof(HID_COLLECTION)); if (!Collection) { // @@ -105,7 +102,7 @@ HidParser_AllocateCollection( // // no usage set // - Parser->Debug("HIDPARSE] No usage set\n"); + DebugFunction("HIDPARSE] No usage set\n"); UsageValue.u.Extended = 0; } @@ -127,7 +124,6 @@ HidParser_AllocateCollection( HIDPARSER_STATUS HidParser_AddCollection( - IN PHID_PARSER Parser, IN PHID_COLLECTION CurrentCollection, IN PHID_COLLECTION NewCollection) { @@ -142,7 +138,7 @@ HidParser_AddCollection( // // allocate new collection // - NewAllocCollection = (PHID_COLLECTION*)Parser->Alloc(sizeof(PHID_COLLECTION) * CollectionCount); + NewAllocCollection = (PHID_COLLECTION*)AllocFunction(sizeof(PHID_COLLECTION) * CollectionCount); if (!NewAllocCollection) { // @@ -156,12 +152,12 @@ HidParser_AddCollection( // // copy old array // - Parser->Copy(NewAllocCollection, CurrentCollection->Nodes, CurrentCollection->NodeCount * sizeof(PHID_COLLECTION)); + CopyFunction(NewAllocCollection, CurrentCollection->Nodes, CurrentCollection->NodeCount * sizeof(PHID_COLLECTION)); // // delete old array // - Parser->Free(CurrentCollection->Nodes); + FreeFunction(CurrentCollection->Nodes); } // @@ -227,7 +223,6 @@ HidParser_FindReportInCollection( HIDPARSER_STATUS HidParser_FindReport( - IN PHID_PARSER Parser, IN PHID_PARSER_CONTEXT ParserContext, IN UCHAR ReportType, IN UCHAR ReportID, @@ -241,7 +236,6 @@ HidParser_FindReport( HIDPARSER_STATUS HidParser_AllocateReport( - IN PHID_PARSER Parser, IN UCHAR ReportType, IN UCHAR ReportID, OUT PHID_REPORT *OutReport) @@ -251,7 +245,7 @@ HidParser_AllocateReport( // // allocate report // - Report = (PHID_REPORT)Parser->Alloc(sizeof(HID_REPORT)); + Report = (PHID_REPORT)AllocFunction(sizeof(HID_REPORT)); if (!Report) { // @@ -275,7 +269,6 @@ HidParser_AllocateReport( HIDPARSER_STATUS HidParser_AddReportToCollection( - IN PHID_PARSER Parser, IN PHID_PARSER_CONTEXT ParserContext, IN PHID_COLLECTION CurrentCollection, IN PHID_REPORT NewReport) @@ -285,7 +278,7 @@ HidParser_AddReportToCollection( // // allocate new report array // - NewReportArray = (PHID_REPORT*)Parser->Alloc(sizeof(PHID_REPORT) * (CurrentCollection->ReportCount + 1)); + NewReportArray = (PHID_REPORT*)AllocFunction(sizeof(PHID_REPORT) * (CurrentCollection->ReportCount + 1)); if (!NewReportArray) { // @@ -299,12 +292,12 @@ HidParser_AddReportToCollection( // // copy old array contents // - Parser->Copy(NewReportArray, CurrentCollection->Reports, sizeof(PHID_REPORT) * CurrentCollection->ReportCount); + CopyFunction(NewReportArray, CurrentCollection->Reports, sizeof(PHID_REPORT) * CurrentCollection->ReportCount); // // free old array // - Parser->Free(CurrentCollection->Reports); + FreeFunction(CurrentCollection->Reports); } // @@ -322,7 +315,6 @@ HidParser_AddReportToCollection( HIDPARSER_STATUS HidParser_GetReport( - IN PHID_PARSER Parser, IN PHID_PARSER_CONTEXT ParserContext, IN PHID_COLLECTION Collection, IN UCHAR ReportType, @@ -335,7 +327,7 @@ HidParser_GetReport( // // try finding existing report // - Status = HidParser_FindReport(Parser, ParserContext, ReportType, ReportID, OutReport); + Status = HidParser_FindReport(ParserContext, ReportType, ReportID, OutReport); if (Status == HIDPARSER_STATUS_SUCCESS || CreateIfNotExists == FALSE) { // @@ -347,7 +339,7 @@ HidParser_GetReport( // // allocate new report // - Status = HidParser_AllocateReport(Parser, ReportType, ReportID, OutReport); + Status = HidParser_AllocateReport(ReportType, ReportID, OutReport); if (Status != HIDPARSER_STATUS_SUCCESS) { // @@ -359,13 +351,13 @@ HidParser_GetReport( // // add report // - Status = HidParser_AddReportToCollection(Parser, ParserContext, Collection, *OutReport); + Status = HidParser_AddReportToCollection(ParserContext, Collection, *OutReport); if (Status != HIDPARSER_STATUS_SUCCESS) { // // failed to allocate report // - Parser->Free(*OutReport); + FreeFunction(*OutReport); } // @@ -376,7 +368,6 @@ HidParser_GetReport( HIDPARSER_STATUS HidParser_ReserveReportItems( - IN PHID_PARSER Parser, IN PHID_REPORT Report, IN ULONG ReportCount, OUT PHID_REPORT *OutReport) @@ -402,7 +393,7 @@ HidParser_ReserveReportItems( // // allocate memory // - NewReport = (PHID_REPORT)Parser->Alloc(Size + OldSize); + NewReport = (PHID_REPORT)AllocFunction(Size + OldSize); if (!NewReport) { // @@ -415,7 +406,7 @@ HidParser_ReserveReportItems( // // copy old report // - Parser->Copy(NewReport, Report, OldSize); + CopyFunction(NewReport, Report, OldSize); // // increase array size @@ -651,7 +642,6 @@ HidParser_UpdateCollectionReport( HIDPARSER_STATUS HidParser_AddMainItem( - IN PHID_PARSER Parser, IN PHID_PARSER_CONTEXT ParserContext, IN PHID_REPORT Report, IN PGLOBAL_ITEM_STATE GlobalItemState, @@ -667,7 +657,7 @@ HidParser_AddMainItem( // // first grow report item array // - Status = HidParser_ReserveReportItems(Parser, Report, GlobalItemState->ReportCount, &NewReport); + Status = HidParser_ReserveReportItems(Report, GlobalItemState->ReportCount, &NewReport); if (Status != HIDPARSER_STATUS_SUCCESS) { // @@ -715,7 +705,6 @@ HidParser_AddMainItem( HIDPARSER_STATUS HidParser_ParseReportDescriptor( - IN PHID_PARSER Parser, IN PUCHAR ReportDescriptor, IN ULONG ReportLength, OUT PVOID *OutParser) @@ -745,7 +734,7 @@ HidParser_ParseReportDescriptor( // // allocate parser // - ParserContext = Parser->Alloc(sizeof(HID_PARSER_CONTEXT));; + ParserContext = AllocFunction(sizeof(HID_PARSER_CONTEXT)); if (!ParserContext) return HIDPARSER_STATUS_INSUFFICIENT_RESOURCES; @@ -754,28 +743,28 @@ HidParser_ParseReportDescriptor( // allocate usage stack // ParserContext->LocalItemState.UsageStackAllocated = 10; - ParserContext->LocalItemState.UsageStack = (PUSAGE_VALUE)Parser->Alloc(ParserContext->LocalItemState.UsageStackAllocated * sizeof(USAGE_VALUE)); + ParserContext->LocalItemState.UsageStack = (PUSAGE_VALUE)AllocFunction(ParserContext->LocalItemState.UsageStackAllocated * sizeof(USAGE_VALUE)); if (!ParserContext->LocalItemState.UsageStack) { // // no memory // - Parser->Free(ParserContext); + FreeFunction(ParserContext); return HIDPARSER_STATUS_INSUFFICIENT_RESOURCES; } // // now allocate root collection // - Status = HidParser_AllocateCollection(Parser, NULL, COLLECTION_LOGICAL, &ParserContext->LocalItemState, &ParserContext->RootCollection); + Status = HidParser_AllocateCollection(NULL, COLLECTION_LOGICAL, &ParserContext->LocalItemState, &ParserContext->RootCollection); if (Status != HIDPARSER_STATUS_SUCCESS) { // // no memory // - Parser->Free(ParserContext->LocalItemState.UsageStack); + FreeFunction(ParserContext->LocalItemState.UsageStack); ParserContext->LocalItemState.UsageStack = NULL; - Parser->Free(ParserContext); + FreeFunction(ParserContext); return HIDPARSER_STATUS_INSUFFICIENT_RESOURCES; } @@ -827,11 +816,11 @@ HidParser_ParseReportDescriptor( // // invalid item size // - //Parser->Debug("CurrentItem invalid item size %lu\n", CurrentItemSize); + //DebugFunction("CurrentItem invalid item size %lu\n", CurrentItemSize); } } - Parser->Debug("Tag %x Type %x Size %x Offset %lu Length %lu\n", CurrentItem->Tag, CurrentItem->Type, CurrentItem->Size, ((ULONG_PTR)CurrentItem - (ULONG_PTR)ReportDescriptor), ReportLength); + DebugFunction("Tag %x Type %x Size %x Offset %lu Length %lu\n", CurrentItem->Tag, CurrentItem->Type, CurrentItem->Size, ((ULONG_PTR)CurrentItem - (ULONG_PTR)ReportDescriptor), ReportLength); // // handle items // @@ -880,13 +869,13 @@ HidParser_ParseReportDescriptor( // // allocate new collection // - Status = HidParser_AllocateCollection(Parser, CurrentCollection, (UCHAR)Data, &ParserContext->LocalItemState, &NewCollection); + Status = HidParser_AllocateCollection(CurrentCollection, (UCHAR)Data, &ParserContext->LocalItemState, &NewCollection); ASSERT(Status == HIDPARSER_STATUS_SUCCESS); // // add new collection to current collection // - Status = HidParser_AddCollection(Parser, CurrentCollection, NewCollection); + Status = HidParser_AddCollection(CurrentCollection, NewCollection); ASSERT(Status == HIDPARSER_STATUS_SUCCESS); // @@ -925,7 +914,7 @@ HidParser_ParseReportDescriptor( break; default: - Parser->Debug("[HIDPARSE] Unknown ReportType Tag %x Type %x Size %x CurrentItemSize %x\n", CurrentItem->Tag, CurrentItem->Type, CurrentItem->Size, CurrentItemSize); + DebugFunction("[HIDPARSE] Unknown ReportType Tag %x Type %x Size %x CurrentItemSize %x\n", CurrentItem->Tag, CurrentItem->Type, CurrentItem->Size, CurrentItemSize); ASSERT(FALSE); break; } @@ -936,7 +925,7 @@ HidParser_ParseReportDescriptor( // // get report // - Status = HidParser_GetReport(Parser, ParserContext, CurrentCollection, ReportType, ParserContext->GlobalItemState.ReportId, TRUE, &Report); + Status = HidParser_GetReport(ParserContext, CurrentCollection, ReportType, ParserContext->GlobalItemState.ReportId, TRUE, &Report); ASSERT(Status == HIDPARSER_STATUS_SUCCESS); // fill in a sensible default if the index isn't set @@ -956,7 +945,7 @@ HidParser_ParseReportDescriptor( // // add states & data to the report // - Status = HidParser_AddMainItem(Parser, ParserContext, Report, &ParserContext->GlobalItemState, &ParserContext->LocalItemState, MainItemData, CurrentCollection); + Status = HidParser_AddMainItem(ParserContext, Report, &ParserContext->GlobalItemState, &ParserContext->LocalItemState, MainItemData, CurrentCollection); ASSERT(Status == HIDPARSER_STATUS_SUCCESS); } @@ -969,7 +958,7 @@ HidParser_ParseReportDescriptor( // // reset the local item state and clear the usage stack // - Parser->Zero(&ParserContext->LocalItemState, sizeof(LOCAL_ITEM_STATE)); + ZeroFunction(&ParserContext->LocalItemState, sizeof(LOCAL_ITEM_STATE)); // // restore stack @@ -982,68 +971,68 @@ HidParser_ParseReportDescriptor( { switch (CurrentItem->Tag) { case ITEM_TAG_GLOBAL_USAGE_PAGE: - Parser->Debug("[HIDPARSE] ITEM_TAG_GLOBAL_USAGE_PAGE %x\n", Data); + DebugFunction("[HIDPARSE] ITEM_TAG_GLOBAL_USAGE_PAGE %x\n", Data); ParserContext->GlobalItemState.UsagePage = Data; break; case ITEM_TAG_GLOBAL_LOGICAL_MINIMUM: - Parser->Debug("[HIDPARSE] ITEM_TAG_GLOBAL_LOGICAL_MINIMUM %x\n", Data); + DebugFunction("[HIDPARSE] ITEM_TAG_GLOBAL_LOGICAL_MINIMUM %x\n", Data); ParserContext->GlobalItemState.LogicalMinimum = Data; break; case ITEM_TAG_GLOBAL_LOGICAL_MAXIMUM: - Parser->Debug("[HIDPARSE] ITEM_TAG_GLOBAL_LOCAL_MAXIMUM %x\n", Data); + DebugFunction("[HIDPARSE] ITEM_TAG_GLOBAL_LOCAL_MAXIMUM %x\n", Data); ParserContext->GlobalItemState.LogicialMaximum = Data; break; case ITEM_TAG_GLOBAL_PHYSICAL_MINIMUM: - Parser->Debug("[HIDPARSE] ITEM_TAG_GLOBAL_PHYSICAL_MINIMUM %x\n", Data); + DebugFunction("[HIDPARSE] ITEM_TAG_GLOBAL_PHYSICAL_MINIMUM %x\n", Data); ParserContext->GlobalItemState.PhysicalMinimum = Data; break; case ITEM_TAG_GLOBAL_PHYSICAL_MAXIMUM: - Parser->Debug("[HIDPARSE] ITEM_TAG_GLOBAL_PHYSICAL_MAXIMUM %x\n", Data); + DebugFunction("[HIDPARSE] ITEM_TAG_GLOBAL_PHYSICAL_MAXIMUM %x\n", Data); ParserContext->GlobalItemState.PhysicalMaximum = Data; break; case ITEM_TAG_GLOBAL_UNIT_EXPONENT: - Parser->Debug("[HIDPARSE] ITEM_TAG_GLOBAL_REPORT_UNIT_EXPONENT %x\n", Data); + DebugFunction("[HIDPARSE] ITEM_TAG_GLOBAL_REPORT_UNIT_EXPONENT %x\n", Data); ParserContext->GlobalItemState.UnitExponent = Data; break; case ITEM_TAG_GLOBAL_UNIT: - Parser->Debug("[HIDPARSE] ITEM_TAG_GLOBAL_REPORT_UNIT %x\n", Data); + DebugFunction("[HIDPARSE] ITEM_TAG_GLOBAL_REPORT_UNIT %x\n", Data); ParserContext->GlobalItemState.Unit = Data; break; case ITEM_TAG_GLOBAL_REPORT_SIZE: - Parser->Debug("[HIDPARSE] ITEM_TAG_GLOBAL_REPORT_SIZE %x\n", Data); + DebugFunction("[HIDPARSE] ITEM_TAG_GLOBAL_REPORT_SIZE %x\n", Data); ParserContext->GlobalItemState.ReportSize = Data; break; case ITEM_TAG_GLOBAL_REPORT_ID: - Parser->Debug("[HIDPARSE] ITEM_TAG_GLOBAL_REPORT_ID %x\n", Data); + DebugFunction("[HIDPARSE] ITEM_TAG_GLOBAL_REPORT_ID %x\n", Data); ParserContext->GlobalItemState.ReportId = Data; ParserContext->UseReportIDs = TRUE; break; case ITEM_TAG_GLOBAL_REPORT_COUNT: - Parser->Debug("[HIDPARSE] ITEM_TAG_GLOBAL_REPORT_COUNT %x\n", Data); + DebugFunction("[HIDPARSE] ITEM_TAG_GLOBAL_REPORT_COUNT %x\n", Data); ParserContext->GlobalItemState.ReportCount = Data; break; case ITEM_TAG_GLOBAL_PUSH: { - Parser->Debug("[HIDPARSE] ITEM_TAG_GLOBAL_PUSH\n"); + DebugFunction("[HIDPARSE] ITEM_TAG_GLOBAL_PUSH\n"); // // allocate global item state // - LinkedGlobalItemState = (PGLOBAL_ITEM_STATE)Parser->Alloc(sizeof(GLOBAL_ITEM_STATE)); + LinkedGlobalItemState = (PGLOBAL_ITEM_STATE)AllocFunction(sizeof(GLOBAL_ITEM_STATE)); ASSERT(LinkedGlobalItemState); // // copy global item state // - Parser->Copy(LinkedGlobalItemState, &ParserContext->GlobalItemState, sizeof(GLOBAL_ITEM_STATE)); + CopyFunction(LinkedGlobalItemState, &ParserContext->GlobalItemState, sizeof(GLOBAL_ITEM_STATE)); // // store pushed item in link member @@ -1053,7 +1042,7 @@ HidParser_ParseReportDescriptor( } case ITEM_TAG_GLOBAL_POP: { - Parser->Debug("[HIDPARSE] ITEM_TAG_GLOBAL_POP\n"); + DebugFunction("[HIDPARSE] ITEM_TAG_GLOBAL_POP\n"); if (ParserContext->GlobalItemState.Next == NULL) { // @@ -1071,12 +1060,12 @@ HidParser_ParseReportDescriptor( // // replace current item with linked one // - Parser->Copy(&ParserContext->GlobalItemState, LinkedGlobalItemState, sizeof(GLOBAL_ITEM_STATE)); + CopyFunction(&ParserContext->GlobalItemState, LinkedGlobalItemState, sizeof(GLOBAL_ITEM_STATE)); // // free item // - Parser->Free(LinkedGlobalItemState); + FreeFunction(LinkedGlobalItemState); break; } @@ -1106,18 +1095,18 @@ HidParser_ParseReportDescriptor( // // build new usage stack // - NewUsageStack = (PUSAGE_VALUE)Parser->Alloc(sizeof(USAGE_VALUE) * ParserContext->LocalItemState.UsageStackAllocated); + NewUsageStack = (PUSAGE_VALUE)AllocFunction(sizeof(USAGE_VALUE) * ParserContext->LocalItemState.UsageStackAllocated); ASSERT(NewUsageStack); // // copy old usage stack // - Parser->Copy(NewUsageStack, ParserContext->LocalItemState.UsageStack, sizeof(USAGE_VALUE) * (ParserContext->LocalItemState.UsageStackAllocated - 10)); + CopyFunction(NewUsageStack, ParserContext->LocalItemState.UsageStack, sizeof(USAGE_VALUE) * (ParserContext->LocalItemState.UsageStackAllocated - 10)); // // free old usage stack // - Parser->Free(ParserContext->LocalItemState.UsageStack); + FreeFunction(ParserContext->LocalItemState.UsageStack); // // replace with new usage stack @@ -1144,7 +1133,7 @@ HidParser_ParseReportDescriptor( } case ITEM_TAG_LOCAL_USAGE_MINIMUM: - Parser->Debug("[HIDPARSE] ITEM_TAG_LOCAL_USAGE_MINIMUM Data %x\n", Data); + DebugFunction("[HIDPARSE] ITEM_TAG_LOCAL_USAGE_MINIMUM Data %x\n", Data); ParserContext->LocalItemState.UsageMinimum.u.Extended = Data; ParserContext->LocalItemState.UsageMinimum.IsExtended = CurrentItemSize == sizeof(ULONG); @@ -1152,7 +1141,7 @@ HidParser_ParseReportDescriptor( break; case ITEM_TAG_LOCAL_USAGE_MAXIMUM: - Parser->Debug("[HIDPARSE] ITEM_TAG_LOCAL_USAGE_MAXIMUM Data %x ItemSize %x %x\n", Data, CurrentItemSize, CurrentItem->Size); + DebugFunction("[HIDPARSE] ITEM_TAG_LOCAL_USAGE_MAXIMUM Data %x ItemSize %x %x\n", Data, CurrentItemSize, CurrentItem->Size); ParserContext->LocalItemState.UsageMaximum.u.Extended = Data; ParserContext->LocalItemState.UsageMaximum.IsExtended = CurrentItemSize == sizeof(ULONG); @@ -1160,39 +1149,39 @@ HidParser_ParseReportDescriptor( break; case ITEM_TAG_LOCAL_DESIGNATOR_INDEX: - Parser->Debug("[HIDPARSE] ITEM_TAG_LOCAL_DESIGNATOR_INDEX Data %x\n", Data); + DebugFunction("[HIDPARSE] ITEM_TAG_LOCAL_DESIGNATOR_INDEX Data %x\n", Data); ParserContext->LocalItemState.DesignatorIndex = Data; ParserContext->LocalItemState.DesignatorIndexSet = TRUE; break; case ITEM_TAG_LOCAL_DESIGNATOR_MINIMUM: - Parser->Debug("[HIDPARSE] ITEM_TAG_LOCAL_DESIGNATOR_MINIMUM Data %x\n", Data); + DebugFunction("[HIDPARSE] ITEM_TAG_LOCAL_DESIGNATOR_MINIMUM Data %x\n", Data); ParserContext->LocalItemState.DesignatorMinimum = Data; break; case ITEM_TAG_LOCAL_DESIGNATOR_MAXIMUM: - Parser->Debug("[HIDPARSE] ITEM_TAG_LOCAL_DESIGNATOR_MAXIMUM Data %x\n", Data); + DebugFunction("[HIDPARSE] ITEM_TAG_LOCAL_DESIGNATOR_MAXIMUM Data %x\n", Data); ParserContext->LocalItemState.DesignatorMaximum = Data; break; case ITEM_TAG_LOCAL_STRING_INDEX: - Parser->Debug("[HIDPARSE] ITEM_TAG_LOCAL_STRING_INDEX Data %x\n", Data); + DebugFunction("[HIDPARSE] ITEM_TAG_LOCAL_STRING_INDEX Data %x\n", Data); ParserContext->LocalItemState.StringIndex = Data; ParserContext->LocalItemState.StringIndexSet = TRUE; break; case ITEM_TAG_LOCAL_STRING_MINIMUM: - Parser->Debug("[HIDPARSE] ITEM_TAG_LOCAL_STRING_MINIMUM Data %x\n", Data); + DebugFunction("[HIDPARSE] ITEM_TAG_LOCAL_STRING_MINIMUM Data %x\n", Data); ParserContext->LocalItemState.StringMinimum = Data; break; case ITEM_TAG_LOCAL_STRING_MAXIMUM: - Parser->Debug("[HIDPARSE] ITEM_TAG_LOCAL_STRING_MAXIMUM Data %x\n", Data); + DebugFunction("[HIDPARSE] ITEM_TAG_LOCAL_STRING_MAXIMUM Data %x\n", Data); ParserContext->LocalItemState.StringMaximum = Data; break; default: - Parser->Debug("Unknown Local Item Tag %x\n", CurrentItem->Tag); + DebugFunction("Unknown Local Item Tag %x\n", CurrentItem->Tag); ASSERT(FALSE); break; } @@ -1202,7 +1191,7 @@ HidParser_ParseReportDescriptor( case ITEM_TYPE_LONG: { CurrentLongItem = (PLONG_ITEM)CurrentItem; - Parser->Debug("Unsupported ITEM_TYPE_LONG Tag %x\n", CurrentLongItem->LongItemTag); + DebugFunction("Unsupported ITEM_TYPE_LONG Tag %x\n", CurrentLongItem->LongItemTag); break; } } @@ -1221,7 +1210,7 @@ HidParser_ParseReportDescriptor( LinkedGlobalItemState = (PGLOBAL_ITEM_STATE)ParserContext->GlobalItemState.Next; while(LinkedGlobalItemState != NULL) { - Parser->Debug("[HIDPARSE] Freeing GlobalState %p\n", LinkedGlobalItemState); + DebugFunction("[HIDPARSE] Freeing GlobalState %p\n", LinkedGlobalItemState); // // free global item state // @@ -1230,7 +1219,7 @@ HidParser_ParseReportDescriptor( // // free state // - Parser->Free(LinkedGlobalItemState); + FreeFunction(LinkedGlobalItemState); // // move to next global state @@ -1241,7 +1230,7 @@ HidParser_ParseReportDescriptor( // // free usage stack // - Parser->Free(ParserContext->LocalItemState.UsageStack); + FreeFunction(ParserContext->LocalItemState.UsageStack); ParserContext->LocalItemState.UsageStack = NULL; // @@ -1257,7 +1246,6 @@ HidParser_ParseReportDescriptor( PHID_COLLECTION HidParser_GetCollection( - IN PHID_PARSER Parser, PHID_PARSER_CONTEXT ParserContext, IN ULONG CollectionNumber) { @@ -1282,7 +1270,7 @@ HidParser_GetCollection( // // no such collection // - Parser->Debug("HIDPARSE] No such collection %lu\n", CollectionNumber); + DebugFunction("HIDPARSE] No such collection %lu\n", CollectionNumber); return NULL; } @@ -1313,7 +1301,6 @@ HidParser_NumberOfTopCollections( HIDPARSER_STATUS HidParser_BuildContext( - IN PHID_PARSER Parser, IN PVOID ParserContext, IN ULONG CollectionIndex, IN ULONG ContextSize, @@ -1326,13 +1313,13 @@ HidParser_BuildContext( // // lets get the collection // - Collection = HidParser_GetCollection(Parser, (PHID_PARSER_CONTEXT)ParserContext, CollectionIndex); + Collection = HidParser_GetCollection((PHID_PARSER_CONTEXT)ParserContext, CollectionIndex); ASSERT(Collection); // // lets allocate the context // - Context = Parser->Alloc(ContextSize); + Context = AllocFunction(ContextSize); if (Context == NULL) { // @@ -1344,7 +1331,7 @@ HidParser_BuildContext( // // lets build the context // - Status = HidParser_BuildCollectionContext(Parser, Collection, Context, ContextSize); + Status = HidParser_BuildCollectionContext(Collection, Context, ContextSize); if (Status == HIDPARSER_STATUS_SUCCESS) { // @@ -1362,7 +1349,6 @@ HidParser_BuildContext( ULONG HidParser_GetContextSize( - IN PHID_PARSER Parser, IN PVOID ParserContext, IN ULONG CollectionIndex) { @@ -1372,7 +1358,7 @@ HidParser_GetContextSize( // // lets get the collection // - Collection = HidParser_GetCollection(Parser, (PHID_PARSER_CONTEXT)ParserContext, CollectionIndex); + Collection = HidParser_GetCollection((PHID_PARSER_CONTEXT)ParserContext, CollectionIndex); // // calculate size diff --git a/sdk/lib/drivers/hidparser/parser.h b/sdk/lib/drivers/hidparser/parser.h index 1a8f0ce49f7..176461a6438 100644 --- a/sdk/lib/drivers/hidparser/parser.h +++ b/sdk/lib/drivers/hidparser/parser.h @@ -8,6 +8,7 @@ #include <hidpddi.h> #include "hidparser.h" +#include "hidp.h" /* * Copyright 2007, Haiku, Inc. All Rights Reserved. @@ -276,10 +277,6 @@ HidParser_GetReportLength( IN PVOID CollectionContext, IN UCHAR ReportType); -UCHAR -HidParser_IsReportIDUsed( - IN PHID_PARSER Parser); - ULONG HidParser_GetReportItemCountFromReportType( IN PVOID CollectionContext, @@ -299,7 +296,6 @@ HidParser_GetMaxUsageListLengthWithReportAndPage( HIDPARSER_STATUS HidParser_GetSpecificValueCapsWithReport( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN UCHAR ReportType, IN USHORT UsagePage, @@ -310,7 +306,6 @@ HidParser_GetSpecificValueCapsWithReport( HIDPARSER_STATUS HidParser_GetUsagesWithReport( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN UCHAR ReportType, IN USAGE UsagePage, @@ -321,7 +316,6 @@ HidParser_GetUsagesWithReport( HIDPARSER_STATUS HidParser_GetScaledUsageValueWithReport( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN UCHAR ReportType, IN USAGE UsagePage, @@ -332,7 +326,6 @@ HidParser_GetScaledUsageValueWithReport( HIDPARSER_STATUS HidParser_GetUsageValueWithReport( - IN PHID_PARSER Parser, IN PVOID CollectionContext, IN UCHAR ReportType, IN USAGE UsagePage, @@ -345,7 +338,6 @@ HidParser_GetUsageValueWithReport( HIDPARSER_STATUS HidParser_BuildContext( - IN PHID_PARSER Parser, IN PVOID ParserContext, IN ULONG CollectionIndex, IN ULONG ContextSize, @@ -357,7 +349,6 @@ HidParser_CalculateContextSize( HIDPARSER_STATUS HidParser_ParseReportDescriptor( - PHID_PARSER Parser, PUCHAR Report, ULONG ReportSize, OUT PVOID *ParserContext); @@ -368,7 +359,6 @@ HidParser_NumberOfTopCollections( ULONG HidParser_GetContextSize( - IN PHID_PARSER Parser, IN PVOID ParserContext, IN ULONG CollectionNumber); @@ -385,7 +375,6 @@ HidParser_GetTotalCollectionCount( HIDPARSER_STATUS HidParser_BuildCollectionContext( - IN PHID_PARSER Parser, IN PHID_COLLECTION RootCollection, IN PVOID Context, IN ULONG ContextSize);
4 years, 5 months
1
0
0
0
[reactos] 01/01: [ISAPNP] Properly stub IRP_MJ_POWER
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9df05ba4b65631942d006…
commit 9df05ba4b65631942d006f36a4ad1d848f0bf61f Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Sun Jul 12 15:37:20 2020 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Thu Jul 30 13:24:29 2020 +0200 [ISAPNP] Properly stub IRP_MJ_POWER --- drivers/bus/isapnp/isapnp.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/bus/isapnp/isapnp.c b/drivers/bus/isapnp/isapnp.c index 913721b3acd..f14894de6c8 100644 --- a/drivers/bus/isapnp/isapnp.c +++ b/drivers/bus/isapnp/isapnp.c @@ -807,6 +807,28 @@ IsaAddDevice( return STATUS_SUCCESS; } +DRIVER_DISPATCH IsaPower; +NTSTATUS +NTAPI +IsaPower( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +{ + PISAPNP_COMMON_EXTENSION DevExt = DeviceObject->DeviceExtension; + NTSTATUS Status; + + if (!DevExt->IsFdo) + { + Status = Irp->IoStatus.Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; + } + + PoStartNextPowerIrp(Irp); + IoSkipCurrentIrpStackLocation(Irp); + return PoCallDriver(((PISAPNP_FDO_EXTENSION)DevExt)->Ldo, Irp); +} + static DRIVER_DISPATCH IsaPnp; static @@ -849,6 +871,7 @@ DriverEntry( DriverObject->MajorFunction[IRP_MJ_WRITE] = IsaReadWrite; DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = IsaIoctl; DriverObject->MajorFunction[IRP_MJ_PNP] = IsaPnp; + DriverObject->MajorFunction[IRP_MJ_POWER] = IsaPower; DriverObject->DriverExtension->AddDevice = IsaAddDevice; return STATUS_SUCCESS;
4 years, 5 months
1
0
0
0
[reactos] 01/01: [WinSpool] Fix Header Order.
by James Tabor
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c2b65c3feaafca79558fc…
commit c2b65c3feaafca79558fc2bc9fc0f1dbb6e3891a Author: James Tabor <james.tabor(a)reactos.org> AuthorDate: Wed Jul 29 13:06:07 2020 -0500 Commit: James Tabor <james.tabor(a)reactos.org> CommitDate: Wed Jul 29 13:06:07 2020 -0500 [WinSpool] Fix Header Order. Found an issue with the header. --- sdk/include/psdk/winspool.h | 118 ++++++++++++++++++++++---------------------- 1 file changed, 60 insertions(+), 58 deletions(-) diff --git a/sdk/include/psdk/winspool.h b/sdk/include/psdk/winspool.h index 0116d18f978..fa03a2acfbb 100644 --- a/sdk/include/psdk/winspool.h +++ b/sdk/include/psdk/winspool.h @@ -533,6 +533,66 @@ extern "C" { __MINGW_TYPEDEF_AW(PDRIVER_INFO_6) __MINGW_TYPEDEF_AW(LPDRIVER_INFO_6) +typedef struct _DRIVER_INFO_8W { + DWORD cVersion; + LPWSTR pName; + LPWSTR pEnvironment; + LPWSTR pDriverPath; + LPWSTR pDataFile; + LPWSTR pConfigFile; + LPWSTR pHelpFile; + LPWSTR pDependentFiles; + LPWSTR pMonitorName; + LPWSTR pDefaultDataType; + LPWSTR pszzPreviousNames; + FILETIME ftDriverDate; + DWORDLONG dwlDriverVersion; + LPWSTR pszMfgName; + LPWSTR pszOEMUrl; + LPWSTR pszHardwareID; + LPWSTR pszProvider; + LPWSTR pszPrintProcessor; + LPWSTR pszVendorSetup; + LPWSTR pszzColorProfiles; + LPWSTR pszInfPath; + DWORD dwPrinterDriverAttributes; + LPWSTR pszzCoreDriverDependencies; + FILETIME ftMinInboxDriverVerDate; + DWORDLONG dwlMinInboxDriverVerVersion; +} DRIVER_INFO_8W, *PDRIVER_INFO_8W, *LPDRIVER_INFO_8W; + +typedef struct _DRIVER_INFO_8A { + DWORD cVersion; + LPSTR pName; + LPSTR pEnvironment; + LPSTR pDriverPath; + LPSTR pDataFile; + LPSTR pConfigFile; + LPSTR pHelpFile; + LPSTR pDependentFiles; + LPSTR pMonitorName; + LPSTR pDefaultDataType; + LPSTR pszzPreviousNames; + FILETIME ftDriverDate; + DWORDLONG dwlDriverVersion; + LPSTR pszMfgName; + LPSTR pszOEMUrl; + LPSTR pszHardwareID; + LPSTR pszProvider; + LPSTR pszPrintProcessor; + LPSTR pszVendorSetup; + LPSTR pszzColorProfiles; + LPSTR pszInfPath; + DWORD dwPrinterDriverAttributes; + LPSTR pszzCoreDriverDependencies; + FILETIME ftMinInboxDriverVerDate; + DWORDLONG dwlMinInboxDriverVerVersion; +} DRIVER_INFO_8A, *PDRIVER_INFO_8A, *LPDRIVER_INFO_8A; + +__MINGW_TYPEDEF_AW(DRIVER_INFO_8) +__MINGW_TYPEDEF_AW(PDRIVER_INFO_8) +__MINGW_TYPEDEF_AW(LPDRIVER_INFO_8) + #define DRIVER_KERNELMODE 0x00000001 #define DRIVER_USERMODE 0x00000002 @@ -1420,61 +1480,6 @@ HRESULT DocumentEventW( PVOID pvOut ); -typedef struct _DRIVER_INFO_8W { - DWORD cVersion; - LPWSTR pName; - LPWSTR pEnvironment; - LPWSTR pDriverPath; - LPWSTR pDataFile; - LPWSTR pConfigFile; - LPWSTR pHelpFile; - LPWSTR pDependentFiles; - LPWSTR pMonitorName; - LPWSTR pDefaultDataType; - LPWSTR pszzPreviousNames; - FILETIME ftDriverDate; - DWORDLONG dwlDriverVersion; - LPWSTR pszMfgName; - LPWSTR pszOEMUrl; - LPWSTR pszHardwareID; - LPWSTR pszProvider; - LPWSTR pszPrintProcessor; - LPWSTR pszVendorSetup; - LPWSTR pszzColorProfiles; - LPWSTR pszInfPath; - DWORD dwPrinterDriverAttributes; - LPWSTR pszzCoreDriverDependencies; - FILETIME ftMinInboxDriverVerDate; - DWORDLONG dwlMinInboxDriverVerVersion; -} DRIVER_INFO_8W, *PDRIVER_INFO_8W, *LPDRIVER_INFO_8W; - -typedef struct _DRIVER_INFO_8A { - DWORD cVersion; - LPSTR pName; - LPSTR pEnvironment; - LPSTR pDriverPath; - LPSTR pDataFile; - LPSTR pConfigFile; - LPSTR pHelpFile; - LPSTR pDependentFiles; - LPSTR pMonitorName; - LPSTR pDefaultDataType; - LPSTR pszzPreviousNames; - FILETIME ftDriverDate; - DWORDLONG dwlDriverVersion; - LPSTR pszMfgName; - LPSTR pszOEMUrl; - LPSTR pszHardwareID; - LPSTR pszProvider; - LPSTR pszPrintProcessor; - LPSTR pszVendorSetup; - LPSTR pszzColorProfiles; - LPSTR pszInfPath; - DWORD dwPrinterDriverAttributes; - LPSTR pszzCoreDriverDependencies; - FILETIME ftMinInboxDriverVerDate; - DWORDLONG dwlMinInboxDriverVerVersion; -} DRIVER_INFO_8A, *PDRIVER_INFO_8A, *LPDRIVER_INFO_8A; typedef struct _FORM_INFO_2A { DWORD Flags; @@ -1502,9 +1507,6 @@ typedef struct _FORM_INFO_2W { LANGID wLangId; } FORM_INFO_2W, *PFORM_INFO_2W; -__MINGW_TYPEDEF_AW(DRIVER_INFO_8) -__MINGW_TYPEDEF_AW(PDRIVER_INFO_8) -__MINGW_TYPEDEF_AW(LPDRIVER_INFO_8) __MINGW_TYPEDEF_AW(FORM_INFO_2) __MINGW_TYPEDEF_AW(PFORM_INFO_2)
4 years, 5 months
1
0
0
0
[reactos] 06/06: [BOOTVID] More improvements for PC-98 (#2936)
by Dmitry Borisov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=06cbc2acd28d376af4ea3…
commit 06cbc2acd28d376af4ea377f339e69b4005f1ea0 Author: Dmitry Borisov <di.sean(a)protonmail.com> AuthorDate: Tue Jul 28 00:25:18 2020 +0600 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Wed Jul 29 19:10:39 2020 +0300 [BOOTVID] More improvements for PC-98 (#2936) - Fix failure handling - Reduce memory mapping that's not needed --- drivers/base/bootvid/i386/pc98/bootvid.c | 37 ++++++++++++++++++++++---------- sdk/include/reactos/drivers/pc98/video.h | 2 ++ 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/drivers/base/bootvid/i386/pc98/bootvid.c b/drivers/base/bootvid/i386/pc98/bootvid.c index c938910e957..18af07764a6 100644 --- a/drivers/base/bootvid/i386/pc98/bootvid.c +++ b/drivers/base/bootvid/i386/pc98/bootvid.c @@ -11,8 +11,8 @@ /* GLOBALS ********************************************************************/ -static ULONG_PTR VideoMemoryI; -ULONG_PTR FrameBuffer; +static ULONG_PTR PegcControl = 0; +ULONG_PTR FrameBuffer = 0; #define PEGC_MAX_COLORS 256 @@ -25,23 +25,38 @@ GraphGetStatus( UCHAR Result; WRITE_PORT_UCHAR((PUCHAR)GRAPH_IO_o_STATUS_SELECT, Status); - KeStallExecutionProcessor(1); Result = READ_PORT_UCHAR((PUCHAR)GRAPH_IO_i_STATUS); return (Result & GRAPH_STATUS_SET) && (Result != 0xFF); } +static BOOLEAN +TestMmio(VOID) +{ + USHORT OldValue, NewValue; + + OldValue = READ_REGISTER_USHORT((PUSHORT)(PegcControl + PEGC_MMIO_MODE)); + + /* Bits [15:1] are not writable */ + WRITE_REGISTER_USHORT((PUSHORT)(PegcControl + PEGC_MMIO_MODE), 0x80); + NewValue = READ_REGISTER_USHORT((PUSHORT)(PegcControl + PEGC_MMIO_MODE)); + + WRITE_REGISTER_USHORT((PUSHORT)(PegcControl + PEGC_MMIO_MODE), OldValue); + + return !(NewValue & 0x80); +} + static BOOLEAN HasPegcController(VOID) { BOOLEAN Success; if (GraphGetStatus(GRAPH_STATUS_PEGC)) - return TRUE; + return TestMmio(); WRITE_PORT_UCHAR((PUCHAR)GDC2_IO_o_MODE_FLIPFLOP2, GDC2_EGC_FF_UNPROTECT); WRITE_PORT_UCHAR((PUCHAR)GDC2_IO_o_MODE_FLIPFLOP2, GDC2_MODE_PEGC_ENABLE); - Success = GraphGetStatus(GRAPH_STATUS_PEGC); + Success = GraphGetStatus(GRAPH_STATUS_PEGC) ? TestMmio() : FALSE; WRITE_PORT_UCHAR((PUCHAR)GDC2_IO_o_MODE_FLIPFLOP2, GDC2_MODE_PEGC_DISABLE); WRITE_PORT_UCHAR((PUCHAR)GDC2_IO_o_MODE_FLIPFLOP2, GDC2_EGC_FF_PROTECT); @@ -212,8 +227,8 @@ InitializeDisplay(VOID) WRITE_PORT_UCHAR((PUCHAR)GDC2_IO_o_MODE_FLIPFLOP2, GDC2_MODE_PEGC_ENABLE); WRITE_PORT_UCHAR((PUCHAR)GDC2_IO_o_MODE_FLIPFLOP2, GDC2_MODE_LINES_800); WRITE_PORT_UCHAR((PUCHAR)GDC2_IO_o_MODE_FLIPFLOP2, GDC2_EGC_FF_PROTECT); - WRITE_REGISTER_USHORT((PUSHORT)(VideoMemoryI + PEGC_MMIO_MODE), PEGC_MODE_PACKED); - WRITE_REGISTER_USHORT((PUSHORT)(VideoMemoryI + PEGC_MMIO_FRAMEBUFFER), PEGC_FB_MAP); + WRITE_REGISTER_USHORT((PUSHORT)(PegcControl + PEGC_MMIO_MODE), PEGC_MODE_PACKED); + WRITE_REGISTER_USHORT((PUSHORT)(PegcControl + PEGC_MMIO_FRAMEBUFFER), PEGC_FB_MAP); /* Select the video source */ RelayState = READ_PORT_UCHAR((PUCHAR)GRAPH_IO_i_RELAY) & ~(GRAPH_RELAY_0 | GRAPH_RELAY_1); @@ -348,8 +363,8 @@ VidInitialize( PHYSICAL_ADDRESS BaseAddress; BaseAddress.QuadPart = VRAM_NORMAL_PLANE_I; - VideoMemoryI = (ULONG_PTR)MmMapIoSpace(BaseAddress, VRAM_PLANE_SIZE, MmNonCached); - if (!VideoMemoryI) + PegcControl = (ULONG_PTR)MmMapIoSpace(BaseAddress, PEGC_CONTROL_SIZE, MmNonCached); + if (!PegcControl) goto Failure; if (!HasPegcController()) @@ -366,8 +381,8 @@ VidInitialize( return TRUE; Failure: - if (!VideoMemoryI) MmUnmapIoSpace((PVOID)VideoMemoryI, VRAM_PLANE_SIZE); - if (!FrameBuffer) MmUnmapIoSpace((PVOID)FrameBuffer, PEGC_FRAMEBUFFER_SIZE); + if (PegcControl) + MmUnmapIoSpace((PVOID)PegcControl, PEGC_CONTROL_SIZE); return FALSE; } diff --git a/sdk/include/reactos/drivers/pc98/video.h b/sdk/include/reactos/drivers/pc98/video.h index 35a5f704b75..6c20b26cfcd 100644 --- a/sdk/include/reactos/drivers/pc98/video.h +++ b/sdk/include/reactos/drivers/pc98/video.h @@ -22,6 +22,8 @@ #define PEGC_FRAMEBUFFER_PACKED 0xF00000 #define PEGC_FRAMEBUFFER_SIZE 0x080000 +#define PEGC_CONTROL_SIZE 0x000200 + /* High-resolution machine */ #define VRAM_HI_RESO_PLANE_B 0xC0000 #define VRAM_HI_RESO_PLANE_G 0xC8000
4 years, 5 months
1
0
0
0
[reactos] 05/06: [BOOTVID] Fix screen buffer copying code for PC-98 (#2936)
by Dmitry Borisov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e318801c1c052035777aa…
commit e318801c1c052035777aaef49b4071d37a0a7b89 Author: Dmitry Borisov <di.sean(a)protonmail.com> AuthorDate: Tue Jul 28 00:19:34 2020 +0600 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Wed Jul 29 19:10:39 2020 +0300 [BOOTVID] Fix screen buffer copying code for PC-98 (#2936) --- drivers/base/bootvid/i386/pc98/bootvid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/base/bootvid/i386/pc98/bootvid.c b/drivers/base/bootvid/i386/pc98/bootvid.c index 0563da8a5e0..c938910e957 100644 --- a/drivers/base/bootvid/i386/pc98/bootvid.c +++ b/drivers/base/bootvid/i386/pc98/bootvid.c @@ -421,7 +421,7 @@ VidScreenToBufferBlt( ULONG X, Y; PUCHAR OutputBuffer; USHORT Px; - PUSHORT PixelsPosition = (PUSHORT)(FrameBuffer + FB_OFFSET(Left, Top)); + PUSHORT PixelsPosition; /* Clear the destination buffer */ RtlZeroMemory(Buffer, Delta * Height); @@ -429,6 +429,7 @@ VidScreenToBufferBlt( for (Y = 0; Y < Height; Y++) { OutputBuffer = Buffer + Y * Delta; + PixelsPosition = (PUSHORT)(FrameBuffer + FB_OFFSET(Left, Top + Y)); for (X = 0; X < Width; X += sizeof(USHORT)) {
4 years, 5 months
1
0
0
0
[reactos] 04/06: [BOOTVID] Improve text scrolling performance for PC-98 (#2936)
by Dmitry Borisov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c87be643f844a276f69d7…
commit c87be643f844a276f69d759dd2652b7eff02086d Author: Dmitry Borisov <di.sean(a)protonmail.com> AuthorDate: Mon Jul 27 23:57:45 2020 +0600 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Wed Jul 29 19:10:39 2020 +0300 [BOOTVID] Improve text scrolling performance for PC-98 (#2936) --- drivers/base/bootvid/i386/pc98/bootvid.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/base/bootvid/i386/pc98/bootvid.c b/drivers/base/bootvid/i386/pc98/bootvid.c index 459c8e07ca4..0563da8a5e0 100644 --- a/drivers/base/bootvid/i386/pc98/bootvid.c +++ b/drivers/base/bootvid/i386/pc98/bootvid.c @@ -283,24 +283,24 @@ PreserveRow( _In_ ULONG TopDelta, _In_ BOOLEAN Restore) { - PUCHAR OldPosition, NewPosition; - ULONG PixelCount = TopDelta * SCREEN_WIDTH; + PULONG OldPosition, NewPosition; + ULONG PixelCount = TopDelta * (SCREEN_WIDTH / sizeof(ULONG)); if (Restore) { /* Restore the row by copying back the contents saved off-screen */ - OldPosition = (PUCHAR)(FrameBuffer + FB_OFFSET(0, SCREEN_HEIGHT)); - NewPosition = (PUCHAR)(FrameBuffer + FB_OFFSET(0, CurrentTop)); + OldPosition = (PULONG)(FrameBuffer + FB_OFFSET(0, SCREEN_HEIGHT)); + NewPosition = (PULONG)(FrameBuffer + FB_OFFSET(0, CurrentTop)); } else { /* Preserve the row by saving its contents off-screen */ - OldPosition = (PUCHAR)(FrameBuffer + FB_OFFSET(0, CurrentTop)); - NewPosition = (PUCHAR)(FrameBuffer + FB_OFFSET(0, SCREEN_HEIGHT)); + OldPosition = (PULONG)(FrameBuffer + FB_OFFSET(0, CurrentTop)); + NewPosition = (PULONG)(FrameBuffer + FB_OFFSET(0, SCREEN_HEIGHT)); } while (PixelCount--) - WRITE_REGISTER_UCHAR(NewPosition++, READ_REGISTER_UCHAR(OldPosition++)); + WRITE_REGISTER_ULONG(NewPosition++, READ_REGISTER_ULONG(OldPosition++)); } VOID
4 years, 5 months
1
0
0
0
[reactos] 03/06: [BOOTVID] Fix BitBlt behavior (#2936)
by Dmitry Borisov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5d40981efa6160eac3472…
commit 5d40981efa6160eac3472d815c6bec6464736c27 Author: Dmitry Borisov <di.sean(a)protonmail.com> AuthorDate: Sun Jun 21 19:21:46 2020 +0600 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Wed Jul 29 19:10:38 2020 +0300 [BOOTVID] Fix BitBlt behavior (#2936) --- drivers/base/bootvid/common.c | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/drivers/base/bootvid/common.c b/drivers/base/bootvid/common.c index 87257167ec0..9f4dda4de23 100644 --- a/drivers/base/bootvid/common.c +++ b/drivers/base/bootvid/common.c @@ -55,9 +55,9 @@ BitBlt( _In_ ULONG BitsPerPixel, _In_ ULONG Delta) { - ULONG sx, dx, dy; - UCHAR color; - ULONG offset = 0; + ULONG X, Y, Pixel; + UCHAR Colors; + PUCHAR InputBuffer; const ULONG Bottom = Top + Height; const ULONG Right = Left + Width; @@ -82,24 +82,28 @@ BitBlt( PrepareForSetPixel(); /* 4bpp blitting */ - for (dy = Top; dy < Bottom; ++dy) + for (Y = Top; Y < Bottom; ++Y) { - sx = 0; - do - { - /* Extract color */ - color = Buffer[offset + sx]; + InputBuffer = Buffer; - /* Calc destination x */ - dx = Left + (sx << 1); + for (X = Left, Pixel = 0; + X < Right; + ++X, ++Pixel) + { + if (Pixel % 2 == 0) + { + /* Extract colors at every two pixels */ + Colors = *InputBuffer++; - /* Set two pixels */ - SetPixel(dx, dy, color >> 4); - SetPixel(dx + 1, dy, color & 0x0F); + SetPixel(X, Y, Colors >> 4); + } + else + { + SetPixel(X, Y, Colors & 0x0F); + } + } - sx++; - } while (dx < Right); - offset += Delta; + Buffer += Delta; } }
4 years, 5 months
1
0
0
0
← Newer
1
2
3
4
5
6
Older →
Jump to page:
1
2
3
4
5
6
Results per page:
10
25
50
100
200