[DDK]
authorAmine Khaldi <amine.khaldi@reactos.org>
Thu, 15 Apr 2010 21:56:39 +0000 (21:56 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Thu, 15 Apr 2010 21:56:39 +0000 (21:56 +0000)
- d4drvif.h : Introduce pragma once, apply a consistent formatting, group related definitions and add several missing ones.
- d4iface.h : Introduce pragma once, apply a consistent formatting and group related definitions.
- dderror.h : Introduce pragma once and apply a consistent formatting.
- dxapi.h : Apply consistent formatting.
- fltsafe.h : Guard FLOATSAFE inside the proper NTDDI_VERSION and apply a consistent formatting.
- kbdmou.h : Introduce pragma once, apply a consistent formatting and add a missing wmidata.h inclusion.
- ntddmou.h : Move to PSDK, introduce pragma once, apply a consistent formatting and add several missing definitions.
[PSDK]
- ntddkbd.h : Introduce pragma once, apply a consistent formatting and add several missing definitions.

svn path=/branches/header-work/; revision=46889

include/ddk/d4drvif.h
include/ddk/d4iface.h
include/ddk/dderror.h
include/ddk/dxapi.h
include/ddk/fltsafe.h
include/ddk/kbdmou.h
include/psdk/ntddkbd.h
include/psdk/ntddmou.h [moved from include/ddk/ntddmou.h with 78% similarity]

index ee6a185..f3a01b9 100644 (file)
  *
  */
 
-#ifndef __D4DRVIF_H
-#define __D4DRVIF_H
-
-#include "d4iface.h"
+#pragma once
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#define FILE_DEVICE_DOT4                  0x3a
-#define IOCTL_DOT4_USER_BASE              2049
+#define MAX_SERVICE_LENGTH                40
+
+#ifndef CTL_CODE
+
+#define CTL_CODE( DeviceType, Function, Method, Access ) (                 \
+    ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
+)
+
+#define METHOD_BUFFERED                0
+#define METHOD_IN_DIRECT               1
+#define METHOD_OUT_DIRECT              2
+#define METHOD_NEITHER                 3
+
+#define FILE_ANY_ACCESS                0
+#define FILE_READ_ACCESS               0x0001
+#define FILE_WRITE_ACCESS              0x0002
+
+#endif /* CTL_CODE */
+
+#define FILE_DEVICE_DOT4               0x3a
+#define IOCTL_DOT4_USER_BASE           2049
+#define IOCTL_DOT4_LAST                IOCTL_DOT4_USER_BASE + 9
 
 #define IOCTL_DOT4_ADD_ACTIVITY_BROADCAST \
   CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
@@ -63,37 +80,33 @@ extern "C" {
   CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 3, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
 
 
-#define MAX_SERVICE_LENGTH                40
-
 typedef struct _DOT4_DC_CREATE_DATA {
-  unsigned char  bPsid;
-  CHAR  pServiceName[MAX_SERVICE_LENGTH + 1];
-  unsigned char  bType;
-  ULONG  ulBufferSize;
-  USHORT  usMaxHtoPPacketSize;
-  USHORT  usMaxPtoHPacketSize;
+  unsigned char bPsid;
+  CHAR pServiceName[MAX_SERVICE_LENGTH + 1];
+  unsigned char bType;
+  ULONG ulBufferSize;
+  USHORT usMaxHtoPPacketSize;
+  USHORT usMaxPtoHPacketSize;
   unsigned char bHsid;
 } DOT4_DC_CREATE_DATA, *PDOT4_DC_CREATE_DATA;
 
 typedef struct _DOT4_DC_DESTROY_DATA {
-    unsigned char  bHsid;
+  unsigned char bHsid;
 } DOT4_DC_DESTROY_DATA, *PDOT4_DC_DESTROY_DATA;
 
 typedef struct _DOT4_DC_OPEN_DATA {
-  unsigned char  bHsid;
-  unsigned char  fAddActivity;
-  CHANNEL_HANDLE  hChannelHandle;
+  unsigned char bHsid;
+  unsigned char fAddActivity;
+  CHANNEL_HANDLE hChannelHandle;
 } DOT4_DC_OPEN_DATA, *PDOT4_DC_OPEN_DATA;
 
 typedef struct _DOT4_DRIVER_CMD {
-  CHANNEL_HANDLE  hChannelHandle;
-  ULONG  ulSize;
-  ULONG  ulOffset;
-  ULONG  ulTimeout;
+  CHANNEL_HANDLE hChannelHandle;
+  ULONG ulSize;
+  ULONG ulOffset;
+  ULONG ulTimeout;
 } DOT4_DRIVER_CMD, *PDOT4_DRIVER_CMD;
 
 #ifdef __cplusplus
 }
 #endif
-
-#endif /* __D4DRVIF_H */
index c9b54f8..6affd5a 100644 (file)
@@ -1,20 +1,9 @@
-#ifndef _DOT4_IFACE_H
-#define _DOT4_IFACE_H
+#pragma once
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-typedef unsigned long CHANNEL_HANDLE;
-typedef CHANNEL_HANDLE *PCHANNEL_HANDLE;
-
-typedef struct _DOT4_ACTIVITY
-{
-  ULONG ulMessage;
-  ULONG ulByteCount;
-  CHANNEL_HANDLE hChannel;
-} DOT4_ACTIVITY, *PDOT4_ACTIVITY;
-
 #define DOT4_MAX_CHANNELS                 128
 #define NO_TIMEOUT                          0
 #define STREAM_TYPE_CHANNEL                 1
@@ -40,8 +29,14 @@ typedef struct _DOT4_ACTIVITY
 #define CONFIG_UPLOAD                   14
 #define CONFIG_DOWNLOAD                 15
 
+typedef unsigned long CHANNEL_HANDLE, *PCHANNEL_HANDLE;
+
+typedef struct _DOT4_ACTIVITY {
+  ULONG ulMessage;
+  ULONG ulByteCount;
+  CHANNEL_HANDLE hChannel;
+} DOT4_ACTIVITY, *PDOT4_ACTIVITY;
+
 #ifdef __cplusplus
 }
 #endif
-#endif
-
index 188d2d7..9ee76cf 100644 (file)
@@ -1,20 +1,18 @@
+#pragma once
 
-#ifndef _DDERROR_
-#define _DDERROR_
 #define _WINERROR_
-#define NO_ERROR 0
-#define ERROR_INVALID_FUNCTION 1
-#define ERROR_NOT_ENOUGH_MEMORY 8
-#define ERROR_DEV_NOT_EXIST 55
-#define ERROR_INVALID_PARAMETER 87
-#define ERROR_INSUFFICIENT_BUFFER 122
-#define ERROR_INVALID_NAME 123
-#define ERROR_BUSY 170
-#define ERROR_MORE_DATA 234
-#define WAIT_TIMEOUT 258
-#define ERROR_IO_PENDING 997
-#define ERROR_DEVICE_REINITIALIZATION_NEEDED 1164
-#define ERROR_CONTINUE 1246
-#define ERROR_NO_MORE_DEVICES 1248
-#endif
 
+#define NO_ERROR                                 0
+#define ERROR_INVALID_FUNCTION                   1
+#define ERROR_NOT_ENOUGH_MEMORY                  8
+#define ERROR_DEV_NOT_EXIST                      55
+#define ERROR_INVALID_PARAMETER                  87
+#define ERROR_INSUFFICIENT_BUFFER                122
+#define ERROR_INVALID_NAME                       123
+#define ERROR_BUSY                               170
+#define ERROR_MORE_DATA                          234
+#define WAIT_TIMEOUT                             258
+#define ERROR_IO_PENDING                         997
+#define ERROR_DEVICE_REINITIALIZATION_NEEDED     1164
+#define ERROR_CONTINUE                           1246
+#define ERROR_NO_MORE_DEVICES                    1248
index 4933b4b..58c29ac 100644 (file)
@@ -1,4 +1,10 @@
+ULONG
+DxApiGetVersion();
 
-ULONG DxApiGetVersion();
-ULONG DxApi( IN ULONG dwFunctionNum,IN PVOID lpvInBuffer, IN ULONG cbInBuffer,
-             IN PVOID lpvOutBuffer, IN ULONG cbOutBuffer);
+ULONG
+DxApi(
+  IN ULONG dwFunctionNum,
+  IN PVOID lpvInBuffer,
+  IN ULONG cbInBuffer,
+  IN PVOID lpvOutBuffer,
+  IN ULONG cbOutBuffer);
index 19dfc00..4fc1784 100644 (file)
@@ -1,19 +1,14 @@
-
-struct FLOATSAFE
-{
-   KFLOATING_SAVE FloatSave;
-   NTSTATUS ntStatus;
-
-   FLOATSAFE::FLOATSAFE(void)
-   {
-     ntStatus = KeSaveFloatingPointState(&FloatSave);
-   }
-
-   FLOATSAFE::~FLOATSAFE(void)
-   {
-     if (NT_SUCCESS(ntStatus))
-     {
-        KeRestoreFloatingPointState(&FloatSave);
-     }
-   }
+#if (NTDDI_VERSION >= NTDDI_WINXP)
+struct FLOATSAFE {
+  KFLOATING_SAVE FloatSave;
+  NTSTATUS ntStatus;
+  FLOATSAFE::FLOATSAFE(void) {
+    ntStatus = KeSaveFloatingPointState(&FloatSave);
+  }
+  FLOATSAFE::~FLOATSAFE(void) {
+    if (NT_SUCCESS(ntStatus)) {
+      KeRestoreFloatingPointState(&FloatSave);
+    }
+  }
 };
+#endif
index 3010a28..2edcb7f 100644 (file)
@@ -20,8 +20,7 @@
  *
  */
 
-#ifndef __KBDMOU_H
-#define __KBDMOU_H
+#pragma once
 
 #include <ntddkbd.h>
 #include <ntddmou.h>
   CTL_CODE(FILE_DEVICE_MOUSE, 0x0400, METHOD_NEITHER, FILE_ANY_ACCESS)
 
 typedef struct _CONNECT_DATA {
-       PDEVICE_OBJECT  ClassDeviceObject;
-       PVOID  ClassService;
+  PDEVICE_OBJECT ClassDeviceObject;
+  PVOID ClassService;
 } CONNECT_DATA, *PCONNECT_DATA;
 
 typedef VOID
 (STDAPICALLTYPE *PSERVICE_CALLBACK_ROUTINE)(
-       IN PVOID NormalContext,
-       IN PVOID SystemArgument1,
-       IN PVOID SystemArgument2,
-       IN OUT PVOID SystemArgument3);
+  IN PVOID NormalContext,
+  IN PVOID SystemArgument1,
+  IN PVOID SystemArgument2,
+  IN OUT PVOID SystemArgument3);
 
-#endif /* __KBDMOU_H */
+#include <wmidata.h>
index 2f06bcf..f94f83d 100644 (file)
@@ -20,8 +20,7 @@
  *
  */
 
-#ifndef __NTDDKBD_H
-#define __NTDDKBD_H
+#pragma once
 
 #ifdef __cplusplus
 extern "C" {
@@ -48,20 +47,33 @@ extern "C" {
 #define IOCTL_KEYBOARD_SET_INDICATORS \
   CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0002, METHOD_BUFFERED, FILE_ANY_ACCESS)
 
+#define IOCTL_KEYBOARD_INSERT_DATA \
+  CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0040, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+#define IOCTL_KEYBOARD_QUERY_IME_STATUS \
+  CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0400, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+#define IOCTL_KEYBOARD_SET_IME_STATUS \
+  CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0401, METHOD_BUFFERED, FILE_ANY_ACCESS)
 
 DEFINE_GUID(GUID_DEVINTERFACE_KEYBOARD, \
   0x884b96c3, 0x56ef, 0x11d1, 0xbc, 0x8c, 0x00, 0xa0, 0xc9, 0x14, 0x05, 0xdd);
 
+#define GUID_CLASS_KEYBOARD GUID_DEVINTERFACE_KEYBOARD /* Obsolete */
+
 #define KEYBOARD_ERROR_VALUE_BASE         10000
 
 /* KEYBOARD_INPUT_DATA.MakeCode constants */
-#define KEYBOARD_OVERRUN_MAKE_CODE        0xFF
+#define KEYBOARD_OVERRUN_MAKE_CODE     0xFF
 
 /* KEYBOARD_INPUT_DATA.Flags constants */
-#define KEY_MAKE                          0
-#define KEY_BREAK                         1
-#define KEY_E0                            2
-#define KEY_E1                            4
+#define KEY_MAKE                       0
+#define KEY_BREAK                      1
+#define KEY_E0                         2
+#define KEY_E1                         4
+#define KEY_TERMSRV_SET_LED            8
+#define KEY_TERMSRV_SHADOW             0x10
+#define KEY_TERMSRV_VKPACKET           0x20
 
 #define KEYBOARD_LED_INJECTED     0x8000
 #define KEYBOARD_SHADOW           0x4000
@@ -71,66 +83,64 @@ DEFINE_GUID(GUID_DEVINTERFACE_KEYBOARD, \
 #define KEYBOARD_SCROLL_LOCK_ON   1
 
 typedef struct _KEYBOARD_INPUT_DATA {
-  USHORT  UnitId;
-  USHORT  MakeCode;
-  USHORT  Flags;
-  USHORT  Reserved;
-  ULONG  ExtraInformation;
+  USHORT UnitId;
+  USHORT MakeCode;
+  USHORT Flags;
+  USHORT Reserved;
+  ULONG ExtraInformation;
 } KEYBOARD_INPUT_DATA, *PKEYBOARD_INPUT_DATA;
 
 
 typedef struct _KEYBOARD_TYPEMATIC_PARAMETERS {
-       USHORT  UnitId;
-       USHORT  Rate;
-       USHORT  Delay;
+  USHORT UnitId;
+  USHORT Rate;
+  USHORT Delay;
 } KEYBOARD_TYPEMATIC_PARAMETERS, *PKEYBOARD_TYPEMATIC_PARAMETERS;
 
 typedef struct _KEYBOARD_ID {
-       UCHAR  Type;
-       UCHAR  Subtype;
+  UCHAR Type;
+  UCHAR Subtype;
 } KEYBOARD_ID, *PKEYBOARD_ID;
 
 #define ENHANCED_KEYBOARD(Id) ((Id).Type == 2 || (Id).Type == 4 || FAREAST_KEYBOARD(Id))
-#define FAREAST_KEYBOARD(Id)  ((Id).Type == 7 || (Id).Type == 8)
+#define FAREAST_KEYBOARD(Id) ((Id).Type == 7 || (Id).Type == 8)
 
 typedef struct _KEYBOARD_INDICATOR_PARAMETERS {
-  USHORT  UnitId;
-  USHORT  LedFlags;
+  USHORT UnitId;
+  USHORT LedFlags;
 } KEYBOARD_INDICATOR_PARAMETERS, *PKEYBOARD_INDICATOR_PARAMETERS;
 
 typedef struct _INDICATOR_LIST {
-  USHORT  MakeCode;
-  USHORT  IndicatorFlags;
+  USHORT MakeCode;
+  USHORT IndicatorFlags;
 } INDICATOR_LIST, *PINDICATOR_LIST;
 
 typedef struct _KEYBOARD_INDICATOR_TRANSLATION {
-  USHORT  NumberOfIndicatorKeys;
-  INDICATOR_LIST  IndicatorList[1];
+  USHORT NumberOfIndicatorKeys;
+  INDICATOR_LIST IndicatorList[1];
 } KEYBOARD_INDICATOR_TRANSLATION, *PKEYBOARD_INDICATOR_TRANSLATION;
 
 typedef struct _KEYBOARD_ATTRIBUTES {
-       KEYBOARD_ID  KeyboardIdentifier;
-       USHORT  KeyboardMode;
-       USHORT  NumberOfFunctionKeys;
-       USHORT  NumberOfIndicators;
-       USHORT  NumberOfKeysTotal;
-       ULONG  InputDataQueueLength;
-       KEYBOARD_TYPEMATIC_PARAMETERS  KeyRepeatMinimum;
-       KEYBOARD_TYPEMATIC_PARAMETERS  KeyRepeatMaximum;
+  KEYBOARD_ID KeyboardIdentifier;
+  USHORT KeyboardMode;
+  USHORT NumberOfFunctionKeys;
+  USHORT NumberOfIndicators;
+  USHORT NumberOfKeysTotal;
+  ULONG InputDataQueueLength;
+  KEYBOARD_TYPEMATIC_PARAMETERS KeyRepeatMinimum;
+  KEYBOARD_TYPEMATIC_PARAMETERS KeyRepeatMaximum;
 } KEYBOARD_ATTRIBUTES, *PKEYBOARD_ATTRIBUTES;
 
 typedef struct _KEYBOARD_UNIT_ID_PARAMETER {
-  USHORT  UnitId;
+  USHORT UnitId;
 } KEYBOARD_UNIT_ID_PARAMETER, *PKEYBOARD_UNIT_ID_PARAMETER;
 
 typedef struct _KEYBOARD_IME_STATUS {
-       USHORT  UnitId;
-       ULONG  ImeOpen;
-       ULONG  ImeConvMode;
+  USHORT UnitId;
+  ULONG ImeOpen;
+  ULONG ImeConvMode;
 } KEYBOARD_IME_STATUS, *PKEYBOARD_IME_STATUS;
 
 #ifdef __cplusplus
 }
 #endif
-
-#endif /* __NTDDKBD_H */
similarity index 78%
rename from include/ddk/ntddmou.h
rename to include/psdk/ntddmou.h
index a4b2460..5228514 100644 (file)
@@ -20,8 +20,7 @@
  *
  */
 
-#ifndef __NTDDMOU_H
-#define __NTDDMOU_H
+#pragma once
 
 #ifdef __cplusplus
 extern "C" {
@@ -33,9 +32,14 @@ extern "C" {
 #define IOCTL_MOUSE_QUERY_ATTRIBUTES \
   CTL_CODE(FILE_DEVICE_MOUSE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
 
+#define IOCTL_MOUSE_INSERT_DATA \
+  CTL_CODE(FILE_DEVICE_MOUSE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
 DEFINE_GUID(GUID_DEVINTERFACE_MOUSE, \
   0x378de44c, 0x56ef, 0x11d1, 0xbc, 0x8c, 0x00, 0xa0, 0xc9, 0x14, 0x05, 0xdd);
 
+#define GUID_CLASS_MOUSE GUID_DEVINTERFACE_MOUSE /* Obsolete */
+
 #define MOUSE_ERROR_VALUE_BASE            20000
 
 /* MOUSE_INPUT_DATA.ButtonFlags constants */
@@ -50,6 +54,7 @@ DEFINE_GUID(GUID_DEVINTERFACE_MOUSE, \
 #define MOUSE_BUTTON_5_DOWN               0x0100
 #define MOUSE_BUTTON_5_UP                 0x0200
 #define MOUSE_WHEEL                       0x0400
+#define MOUSE_HWHEEL                      0x0800
 
 #define MOUSE_BUTTON_1_DOWN               MOUSE_LEFT_BUTTON_DOWN
 #define MOUSE_BUTTON_1_UP                 MOUSE_LEFT_BUTTON_UP
@@ -63,25 +68,29 @@ DEFINE_GUID(GUID_DEVINTERFACE_MOUSE, \
 #define MOUSE_MOVE_ABSOLUTE               1
 #define MOUSE_VIRTUAL_DESKTOP             0x02
 #define MOUSE_ATTRIBUTES_CHANGED          0x04
+#if(_WIN32_WINNT >= 0x0600)
+#define MOUSE_MOVE_NOCOALESCE             0x08
+#endif
+#define MOUSE_TERMSRV_SRC_SHADOW          0x100
 
 typedef struct _MOUSE_INPUT_DATA {
-       USHORT  UnitId;
-       USHORT  Flags;
-       _ANONYMOUS_UNION union {
-               ULONG Buttons;
-               _ANONYMOUS_STRUCT struct  {
-                       USHORT  ButtonFlags;
-                       USHORT  ButtonData;
-               } DUMMYSTRUCTNAME;
-       } DUMMYUNIONNAME;
-       ULONG  RawButtons;
-       LONG  LastX;
-       LONG  LastY;
-       ULONG  ExtraInformation;
+  USHORT UnitId;
+  USHORT Flags;
+  _ANONYMOUS_UNION union {
+    ULONG Buttons;
+    _ANONYMOUS_STRUCT struct {
+      USHORT ButtonFlags;
+      USHORT ButtonData;
+    } DUMMYSTRUCTNAME;
+  } DUMMYUNIONNAME;
+  ULONG RawButtons;
+  LONG LastX;
+  LONG LastY;
+  ULONG ExtraInformation;
 } MOUSE_INPUT_DATA, *PMOUSE_INPUT_DATA;
 
 typedef struct _MOUSE_UNIT_ID_PARAMETER {
-  USHORT  UnitId;
+  USHORT UnitId;
 } MOUSE_UNIT_ID_PARAMETER, *PMOUSE_UNIT_ID_PARAMETER;
 
 /* MOUSE_ATTRIBUTES.MouseIdentifier constants */
@@ -94,16 +103,15 @@ typedef struct _MOUSE_UNIT_ID_PARAMETER {
 #define WHEELMOUSE_SERIAL_HARDWARE        0x0040
 #define MOUSE_HID_HARDWARE                0x0080
 #define WHEELMOUSE_HID_HARDWARE           0x0100
+#define HORIZONTAL_WHEEL_PRESENT          0x8000
 
 typedef struct _MOUSE_ATTRIBUTES {
-  USHORT  MouseIdentifier;
-  USHORT  NumberOfButtons;
-  USHORT  SampleRate;
-  ULONG  InputDataQueueLength;
+  USHORT MouseIdentifier;
+  USHORT NumberOfButtons;
+  USHORT SampleRate;
+  ULONG InputDataQueueLength;
 } MOUSE_ATTRIBUTES, *PMOUSE_ATTRIBUTES;
 
 #ifdef __cplusplus
 }
 #endif
-
-#endif /* __NTDDMOU_H */