1

I am creating a Custom Device for Universal Apps in Windows 10. Our previous app (runs for XP, 7, and 8 without Universal) has been using Driver control codes as a DWORD, but the Windows.Devices.Custom Namespace uses a function IOControlCode() uses ushort.

The function we used to use is:

DeviceIoControl(HANDLE, DWORD, void*, DWORD,
            void*, DWORD, DWORD, NULL);

See the new documentation here

Is there any alternative or way around this?

Roman Marusyk
  • 23,328
  • 24
  • 73
  • 116
Seth Kitchen
  • 1,526
  • 19
  • 53
  • 1
    Are you sure its ushort? Looks like uint to me: https://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.custom.iocontrolcode.controlcode.aspx Do you have a link to the API that uses ulong? – Ron Beyer Aug 10 '15 at 20:31
  • 1
    I think it uses `uint` not `ushort` but that would be still only 32bits not 64 like for `ulong` – Frank J Aug 10 '15 at 20:32

1 Answers1

0

The IOControlCode() parameters are function and device type. These make up an IOControlCode, and are correctly assign UShorts.

The DeviceIOControl function I posted was not the one I should have been looking at. The equivalent function is actually

define IOCTL_CTL_CODE(code) CTL_CODE(FILE_DEVICE_UNKNOWN, code|0x0100, METHOD_BUFFERED, FILE_ANY_ACCESS)

Where File_Device_Unknown is given in the DDK as 0x00000022 and code|0x0100 is the function.

Community
  • 1
  • 1
Seth Kitchen
  • 1,526
  • 19
  • 53