ReactOS 0.4.15-dev-7953-g1f49173
misc.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Keyboard class driver
4 * FILE: drivers/input/kbdclass/misc.c
5 * PURPOSE: Miscellaneous operations
6 *
7 * PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
8 */
9
10#include "kbdclass.h"
11
12#include <debug.h>
13
14
18 IN PIRP Irp)
19{
20 PDEVICE_OBJECT LowerDevice;
21
22 ASSERT(!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO);
23 LowerDevice = ((PPORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
24
26 return IoCallDriver(LowerDevice, Irp);
27}
28
34{
39 {
41 }
42
43
44 if ((SourceString->Length == 0)
47 {
51 }
52 else
53 {
54 USHORT DestMaxLength = SourceString->Length;
55
57 DestMaxLength += sizeof(UNICODE_NULL);
58
61 return STATUS_NO_MEMORY;
62
65 DestinationString->MaximumLength = DestMaxLength;
66
69 }
70
71 return STATUS_SUCCESS;
72}
LONG NTSTATUS
Definition: precomp.h:26
_In_ PIRP Irp
Definition: csq.h:116
#define NULL
Definition: types.h:112
NTSTATUS DuplicateUnicodeString(IN ULONG Flags, IN PCUNICODE_STRING SourceString, OUT PUNICODE_STRING DestinationString)
Definition: misc.c:31
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
#define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING
Definition: green.h:16
#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE
Definition: green.h:15
struct _PORT_DEVICE_EXTENSION * PPORT_DEVICE_EXTENSION
DRIVER_DISPATCH ForwardIrpAndForget
Definition: i8042prt.h:341
#define CLASS_TAG
Definition: kbdclass.h:11
#define ASSERT(a)
Definition: mode.c:44
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1910
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1909
#define UNICODE_NULL
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define IoCallDriver
Definition: irp.c:1225
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_SUCCESS
Definition: shellext.h:65
unsigned short Length
Definition: sprintf.c:451
void * Buffer
Definition: sprintf.c:453
unsigned short MaximumLength
Definition: sprintf.c:452
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
__wchar_t WCHAR
Definition: xmlstorage.h:180