News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Need libs IOCTL_CDROM

Started by ragdog, February 26, 2010, 06:27:16 PM

Previous topic - Next topic

ragdog

Hi

I search the libs for masm32 about IOCTL_CDROM_xxxxx
I found by msdn only this NTDDCDRM.h have any the include file for masm32?

Thanks in forward

donkey

Hi ragdog,

Afraid I don't have it for MASM but I have attached the file from the upcoming headers update for GoAsm, it might be a bit easier to translate to MASM syntax than the C++ one from Microsoft, there are a few dependencies which you can get from the header project on my website if you need them.

When you translate, the header project uses quite a few type definitions, the translation is as follows:

LONG = DWORD
SHORT = WORD
CHAR = BYTE
WCHAR = WORD
DD = DWORD

Some structures are assumed to be defined (in windef.h by the header project) for example LARGE_INTEGER which you can replace with QWORD.

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

ragdog


ragdog

#3
Hi

Have any the finish IOCTL Includes ?

NTDDCDRM.H
NTDDCDVD.H
NTDDSCSI.H
NTDDSTOR.H
Winioctl.h

I send this header from last Windows Driver Kit (WDK) 7.1.0

Can any send me this files as inlucdes for masm please?

Greets,

ragdog

Can i use h2inc for tranlate this header files?

ragdog

I have translate it with h2incx japheth

If i compile it gives naby errors can now anywhere help please?
and i have updated my zip file in the last post
this contain the header and include files


thanks,

Siekmanski

Hi Ragdog

A macro to handle the CTL_CODE:

CTL_CODE MACRO DevType:REQ,Function:REQ,Method:REQ,Access:REQ
    EXITM %(((DevType) shl 16) or ((Access) shl 14) or ((Function) shl 2) or (Method))
ENDM

METHOD_BUFFERED    equ 0
METHOD_IN_DIRECT   equ 1
METHOD_OUT_DIRECT  equ 2
METHOD_NEITHER     equ 3

FILE_ANY_ACCESS    equ 0
FILE_READ_ACCESS   equ 1
FILE_WRITE_ACCESS  equ 2

FILE_DEVICE_CD_ROM equ 2                      ; get all device types at: http://msdn.microsoft.com/en-us/library/ms794701.aspx

IOCTL_CDROM_BASE   equ FILE_DEVICE_CD_ROM

; 2 examples of the CDROM Audio Device Control Functions:
IOCTL_CDROM_READ_TOC         TEXTEQU CTL_CODE( IOCTL_CDROM_BASE, 0000h, METHOD_BUFFERED, FILE_READ_ACCESS )
IOCTL_CDROM_EXCLUSIVE_ACCESS TEXTEQU CTL_CODE( IOCTL_CDROM_BASE, 0017h, METHOD_BUFFERED, FILE_READ_ACCESS or FILE_WRITE_ACCESS)


The rest is up to you, have fun with it.

ragdog

Thanks for try you help

I has this solved my probelm is translate this


typedef enum _STORAGE_MEDIA_TYPE {
  DDS_4mm              = 0x20,
  MiniQic,
  Travan,
  QIC,
  MP_8mm,
  AME_8mm,
  AIT1_8mm,
  DLT,
  NCTP,
  IBM_3480,
  IBM_3490E,
  IBM_Magstar_3590,
  IBM_Magstar_MP,
  STK_DATA_D3,
  SONY_DTF,
  DV_6mm,
  DMI,
  SONY_D2,
  CLEANER_CARTRIDGE,
  CD_ROM,
  CD_R,
  CD_RW,
  DVD_ROM,
  DVD_R,
  DVD_RW,
  MO_3_RW,
  MO_5_WO,
  MO_5_RW,
  MO_5_LIMDOW,
  PC_5_WO,
  PC_5_RW,
  PD_5_RW,
  ABL_5_WO,
  PINNACLE_APEX_5_RW,
  SONY_12_WO,
  PHILIPS_12_WO,
  HITACHI_12_WO,
  CYGNET_12_WO,
  KODAK_14_WO,
  MO_NFR_525,
  NIKON_12_RW,
  IOMEGA_ZIP,
  IOMEGA_JAZ,
  SYQUEST_EZ135,
  SYQUEST_EZFLYER,
  SYQUEST_SYJET,
  AVATAR_F2,
  MP2_8mm,
  DST_S,
  DST_M,
  DST_L,
  VXATape_1,
  VXATape_2,
  STK_9840,
  LTO_Ultrium,
  LTO_Accelis,
  DVD_RAM,
  AIT_8mm,
  ADR_1,
  ADR_2,
  STK_9940,
  SAIT,
  VXATape
} STORAGE_MEDIA_TYPE, *PSTORAGE_MEDIA_TYPE;



This struct use STORAGE_MEDIA_TYPE list

i have use thInc tool and give me this result


DDS_4mm = 20h
MiniQic = 21h
Travan = 22h
QIC = 23h
MP_8mm = 24h
AME_8mm = 25h
AIT1_8mm = 26h
DLT = 27h
NCTP = 28h
IBM_3480 = 29h
IBM_3490E = 2Ah
IBM_Magstar_3590 = 2Bh
IBM_Magstar_MP = 2Ch
STK_DATA_D3 = 2Dh
SONY_DTF = 2Eh
DV_6mm = 2Fh
DMI = 30h
SONY_D2 = 31h
CLEANER_CARTRIDGE = 32h
CD_ROM = 33h
CD_R = 34h
CD_RW = 35h
DVD_ROM = 36h
DVD_R = 37h
DVD_RW = 38h
MO_3_RW = 39h
MO_5_WO = 3Ah
MO_5_RW = 3Bh
MO_5_LIMDOW = 3Ch
PC_5_WO = 3Dh
PC_5_RW = 3Eh
PD_5_RW = 3Fh
ABL_5_WO = 40h
PINNACLE_APEX_5_RW = 41h
SONY_12_WO = 42h
PHILIPS_12_WO = 43h
HITACHI_12_WO = 44h
CYGNET_12_WO = 45h
KODAK_14_WO = 46h
MO_NFR_525 = 47h
NIKON_12_RW = 48h
IOMEGA_ZIP = 49h
IOMEGA_JAZ = 4Ah
SYQUEST_EZ135 = 4Bh
SYQUEST_EZFLYER = 4Ch
SYQUEST_SYJET = 4Dh
AVATAR_F2 = 4Eh
MP2_8mm = 4Fh
DST_S = 50h
DST_M = 51h
DST_L = 52h
VXATape_1 = 53h
VXATape_2 = 54h
STK_EAGLE = 55h
LTO_Ultrium = 56h
LTO_Accelis = 57h
DVD_RAM = 58h
AIT_8mm = 59h
ADR_1 = 5Ah
ADR_2 = 5Bh
STK_9940 = 5Ch
SAIT = 5Dh
VXATape = 5Eh
MEDIA_ERASEABLE = 1h
MEDIA_WRITE_ONCE = 2h
MEDIA_READ_ONLY = 4h
MEDIA_READ_WRITE = 8h
MEDIA_WRITE_PROTECTED = 100h
MEDIA_CURRENTLY_MOUNTED = 80000000h
BusTypeUnknown = 0h
BusTypeScsi = 1h
BusTypeAtapi = 2h
BusTypeAta = 3h
BusType1394 = 4h
BusTypeSsa = 5h
BusTypeFibre = 6h
BusTypeUsb = 7h
BusTypeRAID = 8h
BusTypeiScsi = 9h
BusTypeSas = 0Ah
BusTypeSata = 0Bh
BusTypeSd = 0Ch
BusTypeMmc = 0Dh
BusTypeVirtual = 0Eh
BusTypeFileBackedVirtual = 0Fh
BusTypeMax = 10h
BusTypeMaxReserved = 7Fh



hOw i can us this with this struct?

DEVICE_MEDIA_INFO   STRUCT
Cylinders   QWORD ?
MediaType   STORAGE_MEDIA_TYPE   ;<<<<<<<<<<<<<<<<<<<<<
TracksPerCylinder   DWORD   ?
SectorsPerTrack   DWORD   ?
BytesPerSector   DWORD   ?
NumberMediaSides   DWORD   ?
MediaCharacteristics   DWORD   ?
DEVICE_MEDIA_INFO ENDS