https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2978d4b61b206eee4dc6c…
commit 2978d4b61b206eee4dc6c2e46dca92e4bcce3e94
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Sat Apr 27 11:19:46 2019 +0200
Commit: Hervé Poussineau <hpoussin(a)reactos.org>
CommitDate: Thu May 2 20:06:47 2019 +0200
[HIDPARSE/HIDPARSER] Move HidP_* functions from hidparse.sys to hidparser library
Interface between both is not anymore the HidParser_* functions, but
the HidP_* functions and the AllocFunction/FreeFunction/DebugFunctions/
ZeroFunction/CopyFunction.
---
drivers/hid/hidparse/CMakeLists.txt | 2 +-
drivers/hid/hidparse/hidparse.c | 588 +--------------------
drivers/hid/hidparse/hidparse.h | 1 -
sdk/lib/drivers/hidparser/CMakeLists.txt | 11 +-
.../hidparse.c => sdk/lib/drivers/hidparser/hidp.c | 102 +---
sdk/lib/drivers/hidparser/hidp.h | 6 +
sdk/lib/drivers/hidparser/hidparser.h | 2 +-
7 files changed, 23 insertions(+), 689 deletions(-)
diff --git a/drivers/hid/hidparse/CMakeLists.txt b/drivers/hid/hidparse/CMakeLists.txt
index 57cabdbb3c..af02183db0 100644
--- a/drivers/hid/hidparse/CMakeLists.txt
+++ b/drivers/hid/hidparse/CMakeLists.txt
@@ -10,5 +10,5 @@ include_directories(
add_library(hidparse MODULE hidparse.c hidparse.rc
${CMAKE_CURRENT_BINARY_DIR}/hidparse.def)
set_module_type(hidparse kernelmodedriver)
add_importlibs(hidparse ntoskrnl)
-target_link_libraries(hidparse hidparser)
+target_link_libraries(hidparse hidparser_km)
add_cd_file(TARGET hidparse DESTINATION reactos/system32/drivers NO_CAB FOR all)
diff --git a/drivers/hid/hidparse/hidparse.c b/drivers/hid/hidparse/hidparse.c
index bc8e856605..cdfbb1ed83 100644
--- a/drivers/hid/hidparse/hidparse.c
+++ b/drivers/hid/hidparse/hidparse.c
@@ -9,6 +9,7 @@
*/
#include "hidparse.h"
+#include "hidp.h"
#define NDEBUG
#include <debug.h>
@@ -86,593 +87,6 @@ DebugFunction(
#endif
}
-VOID
-NTAPI
-HidP_FreeCollectionDescription(
- IN PHIDP_DEVICE_DESC DeviceDescription)
-{
- HID_PARSER Parser;
-
- //
- // init parser
- //
- HidParser_InitParser(AllocFunction, FreeFunction, ZeroFunction, CopyFunction,
DebugFunction, &Parser);
-
- //
- // free collection
- //
- HidParser_FreeCollectionDescription(&Parser, DeviceDescription);
-}
-
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_GetCaps(
- IN PHIDP_PREPARSED_DATA PreparsedData,
- OUT PHIDP_CAPS Capabilities)
-{
- HID_PARSER Parser;
-
- //
- // init parser
- //
- HidParser_InitParser(AllocFunction, FreeFunction, ZeroFunction, CopyFunction,
DebugFunction, &Parser);
-
- //
- // get caps
- //
- return HidParser_GetCaps(&Parser, PreparsedData, Capabilities);
-}
-
-NTSTATUS
-TranslateStatusForUpperLayer(
- IN HIDPARSER_STATUS Status)
-{
- //
- // now we are handling only this values, for others just return
- // status as it is.
- //
- switch (Status)
- {
- case HIDPARSER_STATUS_INSUFFICIENT_RESOURCES:
- return STATUS_INSUFFICIENT_RESOURCES;
- case HIDPARSER_STATUS_INVALID_REPORT_TYPE:
- return HIDP_STATUS_INVALID_REPORT_TYPE;
- case HIDPARSER_STATUS_BUFFER_TOO_SMALL:
- return STATUS_BUFFER_TOO_SMALL;
- case HIDPARSER_STATUS_COLLECTION_NOT_FOUND:
- return STATUS_NO_DATA_DETECTED;
- default:
- return Status;
- }
-}
-
-NTSTATUS
-NTAPI
-HidP_GetCollectionDescription(
- IN PHIDP_REPORT_DESCRIPTOR ReportDesc,
- IN ULONG DescLength,
- IN POOL_TYPE PoolType,
- OUT PHIDP_DEVICE_DESC DeviceDescription)
-{
- HID_PARSER Parser;
- NTSTATUS Status;
-
- //
- // init parser
- //
- HidParser_InitParser(AllocFunction, FreeFunction, ZeroFunction, CopyFunction,
DebugFunction, &Parser);
-
- //
- // get description;
- //
- Status = HidParser_GetCollectionDescription(&Parser, ReportDesc, DescLength,
PoolType, DeviceDescription);
- return TranslateStatusForUpperLayer(Status);
-}
-
-HIDAPI
-ULONG
-NTAPI
-HidP_MaxUsageListLength(
- IN HIDP_REPORT_TYPE ReportType,
- IN USAGE UsagePage OPTIONAL,
- IN PHIDP_PREPARSED_DATA PreparsedData)
-{
- HID_PARSER Parser;
-
- //
- // sanity check
- //
- ASSERT(ReportType == HidP_Input || ReportType == HidP_Output || ReportType ==
HidP_Feature);
-
- //
- // init parser
- //
- HidParser_InitParser(AllocFunction, FreeFunction, ZeroFunction, CopyFunction,
DebugFunction, &Parser);
-
-
- //
- // get usage length
- //
- return HidParser_MaxUsageListLength(&Parser, PreparsedData, ReportType,
UsagePage);
-}
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_GetSpecificValueCaps(
- IN HIDP_REPORT_TYPE ReportType,
- IN USAGE UsagePage,
- IN USHORT LinkCollection,
- IN USAGE Usage,
- OUT PHIDP_VALUE_CAPS ValueCaps,
- IN OUT PUSHORT ValueCapsLength,
- IN PHIDP_PREPARSED_DATA PreparsedData)
-{
- HID_PARSER Parser;
-
- //
- // sanity check
- //
- ASSERT(ReportType == HidP_Input || ReportType == HidP_Output || ReportType ==
HidP_Feature);
-
- //
- // init parser
- //
- HidParser_InitParser(AllocFunction, FreeFunction, ZeroFunction, CopyFunction,
DebugFunction, &Parser);
-
- //
- // get value caps
- //
- return HidParser_GetSpecificValueCaps(&Parser, PreparsedData, ReportType,
UsagePage, LinkCollection, Usage, ValueCaps, ValueCapsLength);
-}
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_GetUsages(
- IN HIDP_REPORT_TYPE ReportType,
- IN USAGE UsagePage,
- IN USHORT LinkCollection OPTIONAL,
- OUT PUSAGE UsageList,
- IN OUT PULONG UsageLength,
- IN PHIDP_PREPARSED_DATA PreparsedData,
- IN PCHAR Report,
- IN ULONG ReportLength)
-{
- HID_PARSER Parser;
-
- //
- // sanity check
- //
- ASSERT(ReportType == HidP_Input || ReportType == HidP_Output || ReportType ==
HidP_Feature);
-
- //
- // init parser
- //
- HidParser_InitParser(AllocFunction, FreeFunction, ZeroFunction, CopyFunction,
DebugFunction, &Parser);
-
- //
- // get usages
- //
- return HidParser_GetUsages(&Parser, PreparsedData, ReportType, UsagePage,
LinkCollection, UsageList, UsageLength, Report, ReportLength);
-}
-
-
-#undef HidP_GetButtonCaps
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_UsageListDifference(
- IN PUSAGE PreviousUsageList,
- IN PUSAGE CurrentUsageList,
- OUT PUSAGE BreakUsageList,
- OUT PUSAGE MakeUsageList,
- IN ULONG UsageListLength)
-{
- return HidParser_UsageListDifference(PreviousUsageList, CurrentUsageList,
BreakUsageList, MakeUsageList, UsageListLength);
-}
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_GetUsagesEx(
- IN HIDP_REPORT_TYPE ReportType,
- IN USHORT LinkCollection,
- OUT PUSAGE_AND_PAGE ButtonList,
- IN OUT ULONG *UsageLength,
- IN PHIDP_PREPARSED_DATA PreparsedData,
- IN PCHAR Report,
- IN ULONG ReportLength)
-{
- return HidP_GetUsages(ReportType, HID_USAGE_PAGE_UNDEFINED, LinkCollection,
&ButtonList->Usage, UsageLength, PreparsedData, Report, ReportLength);
-}
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_UsageAndPageListDifference(
- IN PUSAGE_AND_PAGE PreviousUsageList,
- IN PUSAGE_AND_PAGE CurrentUsageList,
- OUT PUSAGE_AND_PAGE BreakUsageList,
- OUT PUSAGE_AND_PAGE MakeUsageList,
- IN ULONG UsageListLength)
-{
- return HidParser_UsageAndPageListDifference(PreviousUsageList, CurrentUsageList,
BreakUsageList, MakeUsageList, UsageListLength);
-}
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_GetScaledUsageValue(
- IN HIDP_REPORT_TYPE ReportType,
- IN USAGE UsagePage,
- IN USHORT LinkCollection OPTIONAL,
- IN USAGE Usage,
- OUT PLONG UsageValue,
- IN PHIDP_PREPARSED_DATA PreparsedData,
- IN PCHAR Report,
- IN ULONG ReportLength)
-{
- HID_PARSER Parser;
-
- //
- // sanity check
- //
- ASSERT(ReportType == HidP_Input || ReportType == HidP_Output || ReportType ==
HidP_Feature);
-
- //
- // init parser
- //
- HidParser_InitParser(AllocFunction, FreeFunction, ZeroFunction, CopyFunction,
DebugFunction, &Parser);
-
- //
- // get scaled usage value
- //
- return HidParser_GetScaledUsageValue(&Parser, PreparsedData, ReportType,
UsagePage, LinkCollection, Usage, UsageValue, Report, ReportLength);
-}
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_GetUsageValue(
- IN HIDP_REPORT_TYPE ReportType,
- IN USAGE UsagePage,
- IN USHORT LinkCollection,
- IN USAGE Usage,
- OUT PULONG UsageValue,
- IN PHIDP_PREPARSED_DATA PreparsedData,
- IN PCHAR Report,
- IN ULONG ReportLength)
-{
- HID_PARSER Parser;
-
- //
- // sanity check
- //
- ASSERT(ReportType == HidP_Input || ReportType == HidP_Output || ReportType ==
HidP_Feature);
-
- //
- // init parser
- //
- HidParser_InitParser(AllocFunction, FreeFunction, ZeroFunction, CopyFunction,
DebugFunction, &Parser);
-
- //
- // get scaled usage value
- //
- return HidParser_GetUsageValue(&Parser, PreparsedData, ReportType, UsagePage,
LinkCollection, Usage, UsageValue, Report, ReportLength);
-}
-
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_TranslateUsageAndPagesToI8042ScanCodes(
- IN PUSAGE_AND_PAGE ChangedUsageList,
- IN ULONG UsageListLength,
- IN HIDP_KEYBOARD_DIRECTION KeyAction,
- IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState,
- IN PHIDP_INSERT_SCANCODES InsertCodesProcedure,
- IN PVOID InsertCodesContext)
-{
- HID_PARSER Parser;
-
- //
- // init parser
- //
- HidParser_InitParser(AllocFunction, FreeFunction, ZeroFunction, CopyFunction,
DebugFunction, &Parser);
-
- //
- // translate usage pages
- //
- return HidParser_TranslateUsageAndPagesToI8042ScanCodes(&Parser,
ChangedUsageList, UsageListLength, KeyAction, ModifierState, InsertCodesProcedure,
InsertCodesContext);
-}
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_GetButtonCaps(
- HIDP_REPORT_TYPE ReportType,
- PHIDP_BUTTON_CAPS ButtonCaps,
- PUSHORT ButtonCapsLength,
- PHIDP_PREPARSED_DATA PreparsedData)
-{
- return HidP_GetSpecificButtonCaps(ReportType, HID_USAGE_PAGE_UNDEFINED, 0, 0,
ButtonCaps, ButtonCapsLength, PreparsedData);
-}
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_GetSpecificButtonCaps(
- IN HIDP_REPORT_TYPE ReportType,
- IN USAGE UsagePage,
- IN USHORT LinkCollection,
- IN USAGE Usage,
- OUT PHIDP_BUTTON_CAPS ButtonCaps,
- IN OUT PUSHORT ButtonCapsLength,
- IN PHIDP_PREPARSED_DATA PreparsedData)
-{
- UNIMPLEMENTED;
- ASSERT(FALSE);
- return STATUS_NOT_IMPLEMENTED;
-}
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_GetData(
- IN HIDP_REPORT_TYPE ReportType,
- OUT PHIDP_DATA DataList,
- IN OUT PULONG DataLength,
- IN PHIDP_PREPARSED_DATA PreparsedData,
- IN PCHAR Report,
- IN ULONG ReportLength)
-{
- UNIMPLEMENTED;
- ASSERT(FALSE);
- return STATUS_NOT_IMPLEMENTED;
-}
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_GetExtendedAttributes(
- IN HIDP_REPORT_TYPE ReportType,
- IN USHORT DataIndex,
- IN PHIDP_PREPARSED_DATA PreparsedData,
- OUT PHIDP_EXTENDED_ATTRIBUTES Attributes,
- IN OUT PULONG LengthAttributes)
-{
- UNIMPLEMENTED;
- ASSERT(FALSE);
- return STATUS_NOT_IMPLEMENTED;
-}
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_GetLinkCollectionNodes(
- OUT PHIDP_LINK_COLLECTION_NODE LinkCollectionNodes,
- IN OUT PULONG LinkCollectionNodesLength,
- IN PHIDP_PREPARSED_DATA PreparsedData)
-{
- UNIMPLEMENTED;
- ASSERT(FALSE);
- return STATUS_NOT_IMPLEMENTED;
-}
-
-NTSTATUS
-NTAPI
-HidP_SysPowerEvent(
- IN PCHAR HidPacket,
- IN USHORT HidPacketLength,
- IN PHIDP_PREPARSED_DATA Ppd,
- OUT PULONG OutputBuffer)
-{
- UNIMPLEMENTED;
- ASSERT(FALSE);
- return STATUS_NOT_IMPLEMENTED;
-}
-
-NTSTATUS
-NTAPI
-HidP_SysPowerCaps(
- IN PHIDP_PREPARSED_DATA Ppd,
- OUT PULONG OutputBuffer)
-{
- UNIMPLEMENTED;
- ASSERT(FALSE);
- return STATUS_NOT_IMPLEMENTED;
-}
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_GetUsageValueArray(
- IN HIDP_REPORT_TYPE ReportType,
- IN USAGE UsagePage,
- IN USHORT LinkCollection OPTIONAL,
- IN USAGE Usage,
- OUT PCHAR UsageValue,
- IN USHORT UsageValueByteLength,
- IN PHIDP_PREPARSED_DATA PreparsedData,
- IN PCHAR Report,
- IN ULONG ReportLength)
-{
- UNIMPLEMENTED;
- ASSERT(FALSE);
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_UnsetUsages(
- IN HIDP_REPORT_TYPE ReportType,
- IN USAGE UsagePage,
- IN USHORT LinkCollection,
- IN PUSAGE UsageList,
- IN OUT PULONG UsageLength,
- IN PHIDP_PREPARSED_DATA PreparsedData,
- IN OUT PCHAR Report,
- IN ULONG ReportLength)
-{
- UNIMPLEMENTED;
- ASSERT(FALSE);
- return STATUS_NOT_IMPLEMENTED;
-}
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_TranslateUsagesToI8042ScanCodes(
- IN PUSAGE ChangedUsageList,
- IN ULONG UsageListLength,
- IN HIDP_KEYBOARD_DIRECTION KeyAction,
- IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState,
- IN PHIDP_INSERT_SCANCODES InsertCodesProcedure,
- IN PVOID InsertCodesContext)
-{
- UNIMPLEMENTED;
- ASSERT(FALSE);
- return STATUS_NOT_IMPLEMENTED;
-}
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_SetUsages(
- IN HIDP_REPORT_TYPE ReportType,
- IN USAGE UsagePage,
- IN USHORT LinkCollection,
- IN PUSAGE UsageList,
- IN OUT PULONG UsageLength,
- IN PHIDP_PREPARSED_DATA PreparsedData,
- IN OUT PCHAR Report,
- IN ULONG ReportLength)
-{
- UNIMPLEMENTED;
- ASSERT(FALSE);
- return STATUS_NOT_IMPLEMENTED;
-}
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_SetUsageValueArray(
- IN HIDP_REPORT_TYPE ReportType,
- IN USAGE UsagePage,
- IN USHORT LinkCollection OPTIONAL,
- IN USAGE Usage,
- IN PCHAR UsageValue,
- IN USHORT UsageValueByteLength,
- IN PHIDP_PREPARSED_DATA PreparsedData,
- OUT PCHAR Report,
- IN ULONG ReportLength)
-{
- UNIMPLEMENTED;
- ASSERT(FALSE);
- return STATUS_NOT_IMPLEMENTED;
-}
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_SetUsageValue(
- IN HIDP_REPORT_TYPE ReportType,
- IN USAGE UsagePage,
- IN USHORT LinkCollection,
- IN USAGE Usage,
- IN ULONG UsageValue,
- IN PHIDP_PREPARSED_DATA PreparsedData,
- IN OUT PCHAR Report,
- IN ULONG ReportLength)
-{
- UNIMPLEMENTED;
- ASSERT(FALSE);
- return STATUS_NOT_IMPLEMENTED;
-}
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_SetScaledUsageValue(
- IN HIDP_REPORT_TYPE ReportType,
- IN USAGE UsagePage,
- IN USHORT LinkCollection OPTIONAL,
- IN USAGE Usage,
- IN LONG UsageValue,
- IN PHIDP_PREPARSED_DATA PreparsedData,
- IN OUT PCHAR Report,
- IN ULONG ReportLength)
-{
- UNIMPLEMENTED;
- ASSERT(FALSE);
- return STATUS_NOT_IMPLEMENTED;
-}
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_SetData(
- IN HIDP_REPORT_TYPE ReportType,
- IN PHIDP_DATA DataList,
- IN OUT PULONG DataLength,
- IN PHIDP_PREPARSED_DATA PreparsedData,
- IN OUT PCHAR Report,
- IN ULONG ReportLength)
-{
- UNIMPLEMENTED;
- ASSERT(FALSE);
- return STATUS_NOT_IMPLEMENTED;
-}
-
-HIDAPI
-ULONG
-NTAPI
-HidP_MaxDataListLength(
- IN HIDP_REPORT_TYPE ReportType,
- IN PHIDP_PREPARSED_DATA PreparsedData)
-{
- UNIMPLEMENTED;
- ASSERT(FALSE);
- return STATUS_NOT_IMPLEMENTED;
-}
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_InitializeReportForID(
- IN HIDP_REPORT_TYPE ReportType,
- IN UCHAR ReportID,
- IN PHIDP_PREPARSED_DATA PreparsedData,
- IN OUT PCHAR Report,
- IN ULONG ReportLength)
-{
- UNIMPLEMENTED;
- ASSERT(FALSE);
- return STATUS_NOT_IMPLEMENTED;
-}
-
-#undef HidP_GetValueCaps
-
-HIDAPI
-NTSTATUS
-NTAPI
-HidP_GetValueCaps(
- HIDP_REPORT_TYPE ReportType,
- PHIDP_VALUE_CAPS ValueCaps,
- PUSHORT ValueCapsLength,
- PHIDP_PREPARSED_DATA PreparsedData)
-{
- UNIMPLEMENTED;
- ASSERT(FALSE);
- return STATUS_NOT_IMPLEMENTED;
-}
-
NTSTATUS
NTAPI
DriverEntry(
diff --git a/drivers/hid/hidparse/hidparse.h b/drivers/hid/hidparse/hidparse.h
index c3602a3300..3ee1ba54e1 100644
--- a/drivers/hid/hidparse/hidparse.h
+++ b/drivers/hid/hidparse/hidparse.h
@@ -5,7 +5,6 @@
#include <ntddk.h>
#include <hidpddi.h>
#include <hidpi.h>
-#include "hidparser.h"
#include <stdio.h>
#define HIDPARSE_TAG 'PdiH'
diff --git a/sdk/lib/drivers/hidparser/CMakeLists.txt
b/sdk/lib/drivers/hidparser/CMakeLists.txt
index 1becfe528d..ba03f996e5 100644
--- a/sdk/lib/drivers/hidparser/CMakeLists.txt
+++ b/sdk/lib/drivers/hidparser/CMakeLists.txt
@@ -6,8 +6,11 @@ list(APPEND SOURCE
hidparser.c
parser.c
api.c
- parser.h)
+ parser.h
+ hidp.c
+ hidp.h)
-add_library(hidparser ${SOURCE})
-add_dependencies(hidparser bugcodes xdk)
-add_pch(hidparser parser.h SOURCE)
+add_library(hidparser_km ${SOURCE})
+add_importlibs(hidparser_km ntoskrnl)
+add_dependencies(hidparser_km bugcodes xdk)
+add_pch(hidparser_km parser.h SOURCE)
diff --git a/drivers/hid/hidparse/hidparse.c b/sdk/lib/drivers/hidparser/hidp.c
similarity index 89%
copy from drivers/hid/hidparse/hidparse.c
copy to sdk/lib/drivers/hidparser/hidp.c
index bc8e856605..b179b1f140 100644
--- a/drivers/hid/hidparse/hidparse.c
+++ b/sdk/lib/drivers/hidparser/hidp.c
@@ -1,90 +1,12 @@
-/*
- * PROJECT: ReactOS Universal Serial Bus Bulk Enhanced Host Controller Interface
- * LICENSE: GPL - See COPYING in the top level directory
- * FILE: drivers/usb/hidparse/hidparse.c
- * PURPOSE: HID Parser
- * PROGRAMMERS:
- * Michael Martin (michael.martin(a)reactos.org)
- * Johannes Anderwald (johannes.anderwald(a)reactos.org)
- */
-
-#include "hidparse.h"
-
-#define NDEBUG
-#include <debug.h>
-
-PVOID
-NTAPI
-AllocFunction(
- IN ULONG ItemSize)
-{
- PVOID Item = ExAllocatePoolWithTag(NonPagedPool, ItemSize, HIDPARSE_TAG);
- if (Item)
- {
- //
- // zero item
- //
- RtlZeroMemory(Item, ItemSize);
- }
-
- //
- // done
- //
- return Item;
-}
-
-VOID
-NTAPI
-FreeFunction(
- IN PVOID Item)
-{
- //
- // free item
- //
- ExFreePoolWithTag(Item, HIDPARSE_TAG);
-}
-
-VOID
-NTAPI
-ZeroFunction(
- IN PVOID Item,
- IN ULONG ItemSize)
-{
- //
- // zero item
- //
- RtlZeroMemory(Item, ItemSize);
-}
+#define _HIDPI_
+#define _HIDPI_NO_FUNCTION_MACROS_
+#include <ntddk.h>
+#include <hidpddi.h>
-VOID
-NTAPI
-CopyFunction(
- IN PVOID Target,
- IN PVOID Source,
- IN ULONG Length)
-{
- //
- // copy item
- //
- RtlCopyMemory(Target, Source, Length);
-}
+#include "hidparser.h"
+#include "hidp.h"
-VOID
-__cdecl
-DebugFunction(
- IN LPCSTR FormatStr, ...)
-{
-#if HID_DBG
- va_list args;
- char printbuffer[1024];
-
- va_start(args, FormatStr);
- vsprintf(printbuffer, FormatStr, args);
- va_end(args);
-
- DbgPrint(printbuffer);
-#endif
-}
+#define UNIMPLEMENTED DebugFunction("%s is UNIMPLEMENTED\n", __FUNCTION__)
VOID
NTAPI
@@ -672,13 +594,3 @@ HidP_GetValueCaps(
ASSERT(FALSE);
return STATUS_NOT_IMPLEMENTED;
}
-
-NTSTATUS
-NTAPI
-DriverEntry(
- IN PDRIVER_OBJECT DriverObject,
- IN PUNICODE_STRING RegPath)
-{
- DPRINT("********* HID PARSE *********\n");
- return STATUS_SUCCESS;
-}
diff --git a/sdk/lib/drivers/hidparser/hidp.h b/sdk/lib/drivers/hidparser/hidp.h
new file mode 100644
index 0000000000..629bc86bf3
--- /dev/null
+++ b/sdk/lib/drivers/hidparser/hidp.h
@@ -0,0 +1,6 @@
+PVOID NTAPI AllocFunction(ULONG Size);
+VOID NTAPI FreeFunction(PVOID Item);
+VOID NTAPI ZeroFunction(PVOID Item, ULONG Size);
+VOID NTAPI CopyFunction(PVOID Target, PVOID Source, ULONG Size);
+VOID __cdecl DebugFunction(LPCSTR Src, ...);
+
diff --git a/sdk/lib/drivers/hidparser/hidparser.h
b/sdk/lib/drivers/hidparser/hidparser.h
index 581193a319..befcd32bda 100644
--- a/sdk/lib/drivers/hidparser/hidparser.h
+++ b/sdk/lib/drivers/hidparser/hidparser.h
@@ -57,7 +57,7 @@ typedef struct
//
// free function
//
- PFREE_FUNCTION Free;
+ PHIDPARSER_FREE_FUNCTION Free;
//
// zero function