📄 wimadll.bas
字号:
' Visual Basic 6.0 (and probably 5.0) header
Attribute VB_Name = "Wimadll"
Public Const MAXLFN = 256
Public Const SORT_NONE = 72
Public Const SORT_NAME = 73
Public Const SORT_EXT = 74
Public Const SORT_SIZE = 75
Public Const SORT_DATE = 76
Public Const CDM_ROOT = 50
Public Const CDM_UPPER = 51
Public Const CDM_ENTRY = 52
'Values for Floppy Density
Public Const FLOPPY_160K = 0
Public Const FLOPPY_180K = 1
Public Const FLOPPY_320K = 2
Public Const FLOPPY_360K = 3
Public Const FLOPPY_720K = 4
Public Const FLOPPY_1200K = 5
Public Const FLOPPY_1440K = 6
Public Const FLOPPY_2880K = 7
Public Const FLOPPY_DMF2048K = 8
Public Const FLOPPY_DMF1024K = 9
Public Const FLOPPY_1680K = 10
' value for CaRead or CaCompare or CaWrite or CaFormat
Public Const FL_NOTHING = 0
Public Const FL_USED = 1
Public Const FL_ALL = 2
Public Const FL_BEGINFLOPPY = 3
Type DIRINFO
nom(1 To 8) As Byte
ext(1 To 3) As Byte
szCompactName(1 To 13) As Byte
bAttr As Byte
dir_CreateMSec As Byte
dir_CreateDate As Integer
DosTime As Integer
DosDate As Integer
fIsSubDir As Long
fSel As Long 'Boolean
fLfnEntry As Long
dwSize As Long
uiPosInDir As Long
dwLocalisation As Long
dwTrueSize As Long
longname(1 To MAXLFN) As Byte
dir_CreateTime As Integer
dir_LastAccessDate As Integer
End Type
Type ASPIINQUIRYTAB
dwSizeStruct As Long
dwHost As Long
dwTargetID As Long
dwTargetType As Long
szDeviceName(1 To 32) As Byte
End Type
' // for ExtractFile and InjectFile, in event DWEV_PROGRESSPERCENT lpParam contain a
' // PROGRESSFILE_SUPINFO structure
Type PROGRESSFILE_SUPINFO
dwSizeStruct As Long
dwCurrentPos As Long
dwReserved1 As Long
dwTotalSize As Long
dwReserved2 As Long
lpszName As String
lpszFullName As String
End Type
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Callback stuff
'// dwEvent contain a DWEV_xxx value, see below
'// lpUsrParam contain user param gived to function
'
Public Const DWEV_ERRORSUPINFO = &H7FFF0001
'#define DWEV_ERRORSUPINFO ((DWORD)0x7fff0001)
'// IO Error with supplemental info (in ReadFloppy and WriteFloppy)
'// dwEventParam = WinImage error number (see below), Bios like error number
'// dwWin32Err : Win32 error number, like GetLastError()
'// lpParam * pointer to an ERROR_SUPINFO structure
'// return value : IDRETRY (4), IDABORT (3), IDIGNORE (5) or IDCANCEL (2)
'// dwEventParam = 0x01 "Internal error 1\n"
'// dwEventParam = 0x02 "Address mark not found"
'// dwEventParam = 0x03 "Diskette is write-protected"
'// dwEventParam = 0x04 "Sector not found"
'// dwEventParam = 0x08 "DMA overflow"
'// dwEventParam = 0x09 "Internal error 9"
'// dwEventParam = 0x10 "Error in reading"
'// dwEventParam = 0x20 "Error in floppy adapter"
'// dwEventParam = 0x40 "Track not found"
'// dwEventParam = 0x80 "There is no floppy in the drive"
'// dwEventParam = 0x100 "Floppies do not match"
'
'
Public Const DWEV_ERRORWIN32 = &H7FFF0002
'#define DWEV_ERRORWIN32 ((DWORD)0x7fff0002)
'// Win32 IO Error in ReadFloppy and WriteFloppy and ReadLargeIma and WriteLargeIma
'// dwEventParam = WinImage error number (see DWEV_ERRORSUPINFO), Bios like error number or 0
'// dwWin32Err : Win32 error number, like GetLastError()
'// return value : IDRETRY to retry (when possible)
'// elsewhere (IDCANCEL or 0) to stop
'
'
Public Const DWEV_ERRORCANTACCESS = &H7FFF0003
'#define DWEV_ERRORCANTACCESS ((DWORD)0x7fff0003)
'// in ReadFloppy* and WriteFloppy*
'// "Drive cannot be accessed - Check to see if another application is using it"
'// return value not used
'
Public Const DWEV_ERRORDRIVEEMPTY = &H7FFF0004
'#define DWEV_ERRORDRIVEEMPTY ((DWORD)0x7fff0004)
'// in ReadFloppy* and WriteFloppy*
'// "There is no floppy in the drive"
'// return value not used
'
Public Const DWEV_ERROR_NOT_MATCH = &H7FFF0005
'#define DWEV_ERROR_NOT_MATCH ((DWORD)0x7fff0005)
'// in ReadFloppy*
'// "Floppies do not match"
'// return value not used
'
Public Const DWEV_UNSTDFMT = &H7FFF0006
'#define DWEV_UNSTDFMT ((DWORD)0x7fff0006)
'// in ReadFloppy* and WriteFloppy*
'// "The current image format differs from the standard format for this disk drive"
'// return value : IDOK (1) to continue, IDCANCEL to abort
'
Public Const DWEV_UNSUPFMT = &H7FFF0007
'#define DWEV_UNSUPFMT ((DWORD)0x7fff0007)
'// in WriteFloppy* and WriteLargeIma
'// "The current image format is not supported by the disk drive"
'// return value not used
'
Public Const DWEV_DIFFTYPEDISK = &H7FFF0008
'#define DWEV_DIFFTYPEDISK ((DWORD)0x7fff0008)
'// in WriteFloppy*
'// "Disk and image formats do not match\nDo you want to reformat it?"
'// return IDYES (6) or IDNO (7)
'
Public Const DWEV_DISKHASDATA = &H7FFF0009
'#define DWEV_DISKHASDATA ((DWORD)0x7fff0009)
'// in WriteFloppy*
'// "Disk is not empty, all data on your disk will be lost!\nDo you want to continue?"
'// return IDYES (6) or IDNO (7)
'
Public Const DWEV_PROGRESSPERCENT = &H7FFF000A
'#define DWEV_PROGRESSPERCENT ((DWORD)0x7fff000a)
'// Give % progress info
'// dwEventParam between 0 and 100
'// for ExtractFile and InjectFile, lpParam contain a PROGRESSFILE_SUPINFO structure
'// return value : IDCANCEL (2) to stop, 0 to continue
'
Public Const DWEV_ERRORASPI = &H7FFF000B
'#define DWEV_ERRORASPI ((DWORD)0x7fff000b)
'// Aspi error in WimLargeReadAspiCDImage*
'// dwEventParam contain first sector number of range error
'// return value : IDABORT, IDRETRY or IDIGNORE
'
Public Const DWEV_ERRORWRITEIMAGEFILE = &H7FFF000C
'#define DWEV_ERRORWRITEIMAGEFILE ((DWORD)0x7fff000c)
'// error in writing image file in WimLargeReadAspiCDImage*
'// dwWin32Err : Win32 error number, like GetLastError()
'
'
Public Const DWEV_ERRORIOCTL = &H7FFF000D
'#define DWEV_ERRORIOCTL ((DWORD)0x7fff000d)
'// IOCTL error when reading Disk partition under Win9x
'// dwEventParam is Int25/26 error value
'// return value : IDCANCEL or IDRETRY
'
Public Const DWEV_ROOTREADDONE = &H7FFF000E
'// when reading FAT image, say when the root is read
'// return value is not used
Public Const ON_FORMAT = 0
Public Const ON_READ = 1
Public Const ON_WRITE = 2
Public Const ON_COMPARE = 3
'typedef struct
'{
' DWORD dwSizeStruct;
' LOCATEERROR LocErr;
' DWORD dwHead;
' DWORD dwTrack;
' DWORD dwPosLow;
' DWORD dwPosHigh;
' DWORD dwStyleAnswer;
' DWORD dwErrNumber;
' LPCTSTR lpszErrorText;
'} ERROR_SUPINFO;
Type ERROR_SUPINFO
dwSizeStruct As Long
LocErr As Long
dwHead As Long
dwTrack As Long
dwPosLow As Long
dwPosHigh As Long
dwStyleAnswer As Long
dwErrNumber As Long
lpszErrorTest As String
End Type
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' CreateMemFatHima : Create an Image Object.
' you need call ReadImaFile, ReadFloppy or MakeEmptyImage
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -