⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usbstor.h

📁 THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF AN
💻 H
字号:
/*++

Copyright (c) 1999 Microsoft Corporation

Module Name:

    usbstor.h

Abstract:

    IOS port driver for USB LS-120 drive
    main header file for driver

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) 1999 Microsoft Corporation.  All Rights Reserved.


Revision History:

    03/19/99: MRB  Original

--*/

//
// Include header file shared with USBLS120.SYS
//
#include "..\inc\iopacket.h"



//
// Type definitions
//

//Type definitions for exported functions in USBLS120.SYS driver
typedef DWORD (_stdcall *USBSTOR_GETNEXTPDO)(PVOID);
typedef PVOID (_stdcall *USBSTOR_STARTREQUEST)(PIOPACKET);
typedef PVOID (_stdcall *USBSTOR_REGISTERHANDLER)(DWORD, PVOID);

//Type definition for IOS callback handler
typedef VOID  (*PIOPCB) (pIOP);



//
// External declarations for global variables
//

// IOS Linkage Block
extern ILB USBSTOR_Ilb;

// Function pointers for exported entrypoints in USBLS120.SYS
extern USBSTOR_GETNEXTPDO pfnGetNextPdo;
extern USBSTOR_STARTREQUEST pfnStartRequest;
extern USBSTOR_REGISTERHANDLER pfnRegisterCompletionHandler;



//
// Function prototyes
//

// USBIO.C
VOID   USBSTOR_Request(pIOP piop);
USHORT USBSTOR_Device_Inquiry(PAEP_inquiry_device Aep);
VOID   _stdcall USBSTOR_CompleteRequest(PIOPACKET IoPacket);
VOID   USBSTOR_ErrorHandler(pIOP Iop);
VOID   USBSTOR_CompleteIOP(pIOP Iop);
VOID   USBSTOR_StartIo(pIOP Iop);

// USBAER.C
VOID   USBSTOR_AER (PAEP paep);
USHORT USBSTOR_AEP_Init(PAEP_bi_init Aep);
USHORT USBSTOR_Config_DCB(PAEP_dcb_config Aep);

// USBCTL.ASM
VOID _cdecl IosRegister (PDRP DrvPkt);



//
// Symbolic constants
//

// USB mass storage definitions
#define    USBStorName        "USB Mass Storage"
#define    USBStorRev         1
#define    USBStorFeature     DRP_FC_IO_FOR_INQ_AEP 
#define    USBSTOR_Major_Ver  0x03
#define    USBSTOR_Minor_Ver  0x0A

// USBDDB flags
#define USBDDB_FLAG_BUSY 0x01
#define USBDDB_FLAG_ERROR 0x02



//
// Structure definitions
//

// DDB structure definition
#include <ddb.h>
typedef struct _USBDDB
{
        DDB      Ddb;
        DWORD    Signature;
        DWORD    Fdo;
        DWORD    Flags;
        DWORD    Dcb1;
        DWORD    Dcb2;
        BYTE     Cdb[12];
        IOPACKET IoPacket;
} USBDDB, *PUSBDDB;



//
// Macro definitions
//

// Macros to hide ILB function call ugliness
#define ILBService(_x_) USBSTOR_Ilb.ILB_service_rtn((PISP)_x_)
#define ILBCriteria(_x_) ((ILB_internal_request_func)(USBSTOR_Ilb.ILB_int_io_criteria_rtn))((PISP)_x_)
#define ILBEnqueueIop(Iop, Dcb) ((ILB_enqueue_iop_func)(USBSTOR_Ilb.ILB_enqueue_iop))(piop, Dcb)
#define ILBDequeueIop(Dcb) ((ILB_dequeue_iop_func)(USBSTOR_Ilb.ILB_dequeue_iop))(Dcb)
#define ILBRequest(Iop, Dcb)  \
    _asm mov edi, Iop         \
    _asm mov ebx, Dcb         \
    _asm mov edx, 0           \
    _asm call USBSTOR_Ilb.ILB_internal_request 
#define SaveEbx() _asm push ebx
#define RestoreEbx() _asm pop ebx
#define IOPCallBack(IopCB, Iop) ((PIOPCB)(IopCB->IOP_CB_address))(Iop)  



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -