hidparse.sys: Introduce new driver library.

Sharing the HidP_* functions with dlls/hid/hidp.c.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-08-16 10:07:51 +02:00 committed by Alexandre Julliard
parent 7a47a1f5d2
commit 1ca788e036
7 changed files with 163 additions and 0 deletions

2
configure vendored
View File

@ -1381,6 +1381,7 @@ enable_hal
enable_hhctrl_ocx
enable_hid
enable_hidclass_sys
enable_hidparse_sys
enable_hlink
enable_hnetcfg
enable_http_sys
@ -20632,6 +20633,7 @@ wine_fn_config_makefile dlls/hhctrl.ocx enable_hhctrl_ocx
wine_fn_config_makefile dlls/hid enable_hid
wine_fn_config_makefile dlls/hid/tests enable_tests
wine_fn_config_makefile dlls/hidclass.sys enable_hidclass_sys
wine_fn_config_makefile dlls/hidparse.sys enable_hidparse_sys
wine_fn_config_makefile dlls/hlink enable_hlink
wine_fn_config_makefile dlls/hlink/tests enable_tests
wine_fn_config_makefile dlls/hnetcfg enable_hnetcfg

View File

@ -3292,6 +3292,7 @@ WINE_CONFIG_MAKEFILE(dlls/hhctrl.ocx)
WINE_CONFIG_MAKEFILE(dlls/hid)
WINE_CONFIG_MAKEFILE(dlls/hid/tests)
WINE_CONFIG_MAKEFILE(dlls/hidclass.sys)
WINE_CONFIG_MAKEFILE(dlls/hidparse.sys)
WINE_CONFIG_MAKEFILE(dlls/hlink)
WINE_CONFIG_MAKEFILE(dlls/hlink/tests)
WINE_CONFIG_MAKEFILE(dlls/hnetcfg)

View File

@ -0,0 +1,8 @@
MODULE = hidparse.sys
IMPORTLIB = hidparse
EXTRADLLFLAGS = -mno-cygwin
PARENTSRC = ../hid
C_SRCS = \
hidp.c \
main.c

View File

@ -0,0 +1,32 @@
@ stub DllInitialize
@ stub DllUnload
@ stdcall HidP_FreeCollectionDescription(ptr)
@ stdcall HidP_GetButtonCaps(long ptr ptr ptr)
@ stdcall HidP_GetCaps(ptr ptr)
@ stdcall HidP_GetCollectionDescription(ptr long long ptr)
@ stdcall HidP_GetData(long ptr ptr ptr ptr long)
@ stub HidP_GetExtendedAttributes
@ stdcall HidP_GetLinkCollectionNodes(ptr ptr ptr)
@ stdcall HidP_GetScaledUsageValue(long long long long ptr ptr ptr long)
@ stdcall HidP_GetSpecificButtonCaps(long long long long ptr ptr ptr)
@ stdcall HidP_GetSpecificValueCaps(long long long long ptr ptr ptr)
@ stdcall HidP_GetUsages(long long long ptr ptr ptr ptr long)
@ stdcall HidP_GetUsagesEx(long long ptr ptr ptr ptr long)
@ stdcall HidP_GetUsageValue(long long long long ptr ptr ptr long)
@ stdcall HidP_GetUsageValueArray(long long long long ptr long ptr ptr long)
@ stdcall HidP_GetValueCaps(long ptr ptr ptr)
@ stdcall HidP_InitializeReportForID(long long ptr ptr long)
@ stdcall HidP_MaxDataListLength(long ptr)
@ stdcall HidP_MaxUsageListLength(long long ptr)
@ stub HidP_SetData
@ stub HidP_SetScaledUsageValue
@ stdcall HidP_SetUsages(long long long ptr ptr ptr ptr long)
@ stdcall HidP_SetUsageValue(long long long long long ptr ptr long)
@ stdcall HidP_SetUsageValueArray(long long long long ptr long ptr ptr long)
@ stub HidP_SysPowerCaps
@ stub HidP_SysPowerEvent
@ stub HidP_TranslateUsageAndPagesToI8042ScanCodes
@ stdcall HidP_TranslateUsagesToI8042ScanCodes(ptr long long ptr ptr ptr)
@ stub HidP_UnsetUsages
@ stub HidP_UsageAndPageListDifference
@ stub HidP_UsageListDifference

49
dlls/hidparse.sys/main.c Normal file
View File

@ -0,0 +1,49 @@
/*
* HID parsing library
*
* Copyright 2021 Rémi Bernon for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "winternl.h"
#include "winioctl.h"
#include <ddk/wdm.h>
#include <ddk/hidpddi.h>
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(hidp);
NTSTATUS WINAPI HidP_GetCollectionDescription( PHIDP_REPORT_DESCRIPTOR report_desc, ULONG report_desc_len,
POOL_TYPE pool_type, HIDP_DEVICE_DESC *device_desc )
{
FIXME( "report_desc %p, report_desc_len %u, pool_type %u, device_desc %p stub!\n",
report_desc, report_desc_len, pool_type, device_desc );
return STATUS_NOT_IMPLEMENTED;
}
void WINAPI HidP_FreeCollectionDescription( HIDP_DEVICE_DESC *device_desc )
{
FIXME( "device_desc %p stub!\n", device_desc );
}

69
include/ddk/hidpddi.h Normal file
View File

@ -0,0 +1,69 @@
/*
* Copyright (C) the Wine project
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_HIDPDDI_H
#define __WINE_HIDPDDI_H
#include <hidusage.h>
#include <ddk/hidpi.h>
typedef struct _HIDP_COLLECTION_DESC
{
USAGE UsagePage;
USAGE Usage;
UCHAR CollectionNumber;
UCHAR Reserved[15];
USHORT InputLength;
USHORT OutputLength;
USHORT FeatureLength;
USHORT PreparsedDataLength;
PHIDP_PREPARSED_DATA PreparsedData;
} HIDP_COLLECTION_DESC, *PHIDP_COLLECTION_DESC;
typedef struct _HIDP_REPORT_IDS
{
UCHAR ReportID;
UCHAR CollectionNumber;
USHORT InputLength;
USHORT OutputLength;
USHORT FeatureLength;
} HIDP_REPORT_IDS, *PHIDP_REPORT_IDS;
typedef struct _HIDP_GETCOLDESC_DBG
{
ULONG BreakOffset;
ULONG ErrorCode;
ULONG Args[6];
} HIDP_GETCOLDESC_DBG, *PHIDP_GETCOLDESC_DBG;
typedef struct _HIDP_DEVICE_DESC
{
HIDP_COLLECTION_DESC *CollectionDesc;
ULONG CollectionDescLength;
HIDP_REPORT_IDS *ReportIDs;
ULONG ReportIDsLength;
HIDP_GETCOLDESC_DBG Dbg;
} HIDP_DEVICE_DESC, *PHIDP_DEVICE_DESC;
NTSTATUS WINAPI HidP_GetCollectionDescription(PHIDP_REPORT_DESCRIPTOR report_desc, ULONG report_desc_len,
POOL_TYPE pool_type, HIDP_DEVICE_DESC *device_desc);
void WINAPI HidP_FreeCollectionDescription(HIDP_DEVICE_DESC *device_desc);
#endif /* __WINE_HIDPDDI_H */

View File

@ -19,6 +19,8 @@
#ifndef __HIDPI_H__
#define __HIDPI_H__
typedef UCHAR *PHIDP_REPORT_DESCRIPTOR;
typedef enum _HIDP_REPORT_TYPE
{
HidP_Input,