Ioctl.c in source code of pdusb


Source code of USB1.1 controller pdusbd12 ddk,its very useful...Original Link
    Sponsored links

			
/*++

Copyright (c) 1995  Microsoft Corporation

Module Name:

   ioctl.c

Abstract:

    USB device driver for Philips D12 USB test board

Environment:

    kernel mode only

Notes:

  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  PURPOSE.

  Copyright (c) 1996 Microsoft Corporation.  All Rights Reserved.


Revision History:

    5-4-96 : created

--*/

#define DRIVER

#include "wdm.h"
#include "stdarg.h"
#include "stdio.h"

#include "usbdi.h"
#include "usbdlib.h"
#include "D12.h"

#include "ioctl.h"
#include "usbdlib.h"


PUSB_CONFIGURATION_DESCRIPTOR
D12_GetConfigDescriptor(
    IN PDEVICE_OBJECT DeviceObject
    )
/*++

Routine Description:

Arguments:

    DeviceObject - pointer to the device object for this instance of the 82930
                    devcice.


Return Value:

    NT status code

--*/
{
    PDEVICE_EXTENSION deviceExtension;
    NTSTATUS ntStatus;
    PURB urb;
    ULONG siz;
    PUSB_CONFIGURATION_DESCRIPTOR configurationDescriptor = NULL;

    D12_KdPrint (("D12TEST.SYS: enter D12_GetConfigDescriptor\n"));

    deviceExtension = DeviceObject->DeviceExtension;

    urb = ExAllocatePool(NonPagedPool,
                         sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST));

    if (urb) {

        // BUGBUG 82930 chokes if on the next command if you don't get
        // the entire descriptor on the first try

        siz = sizeof(USB_CONFIGURATION_DESCRIPTOR)+256;

get_config_descriptor_retry2:

        configurationDescriptor = ExAllocatePool(NonPagedPool,
                                                 siz);

        if (configurationDescriptor) {

            UsbBuildGetDescriptorRequest(urb,
                                         (USHORT) sizeof (struct _URB_CONTROL_DESCRIPTOR_REQUEST),
                                         U			

			...
			...
			... to be continued.

  This is a preview. To get the complete source file, 
  please click here to download the whole source code package.

			
			


Project Files

    Sponsored links
NameSizeDate
 <PDUSBD12>0.00 B0 0%
 <obj>0.00 B23-05-04 09:47
 _objects.mac836.00 B18-08-03 22:57
 <objfre>0.00 B23-05-04 09:47
 <i386>0.00 B23-05-04 09:47
 BUGCODES.H27.30 kB04-09-98 01:53
 buildfre.log1.51 kB01-09-03 00:09
 D12.APS3.19 kB21-08-03 21:44
 D12.c54.72 kB14-07-98 13:21
 D12.h5.15 kB14-07-98 13:16
 D12.rc2.63 kB03-02-98 12:03
 D12irp.c2.05 kB16-07-98 10:38
 D12IRP.H343.00 B05-02-98 14:41
 EXCPT.H3.48 kB04-09-98 01:53
 GUID829.H899.00 B09-07-98 13:43
 Ioctl.c20.20 kB27-05-02 11:48
 Ioctl.h3.02 kB15-07-98 17:45
 MAKEFILE670.00 B12-06-97 17:28
 NTDEF.H40.78 kB04-09-98 01:53
 NTIOLOGC.H11.77 kB04-09-98 01:53
 NTSTATUS.H178.87 kB04-09-98 01:53
 Ocrw.c24.76 kB16-07-98 10:39
 RESOURCE.H453.00 B03-02-98 12:03
 Sources361.00 B27-05-02 11:47
 USBDI.H25.73 kB04-09-98 01:53
 USBDLIB.H14.51 kB14-09-98 18:44
 WDM.H270.45 kB13-10-98 17:33
...

Related Items

    Sponsored links