📄 wimadll.vb
字号:
' Visual Basic 7.x (.net on Visual Studio 2002/2003 and later ) header
Option Strict Off
Option Explicit On
Imports System.Runtime.InteropServices
Module Wimadll
#Region "Structures"
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi, Pack:=1)> _
Public Structure DIRINFO
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=8)> Public nom As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=3)> Public ext As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=13)> Public szCompactName As String
Public bAttr As Byte
Public dir_CreateMSec As Byte
Public dir_CreateDate As Short
Public DosTime As Short
Public DosDate As Short
Public fIsSubDir As Integer
Public fSel As Integer 'Boolean
Public fLfnEntry As Integer
Public dwSize As Integer
Public uiPosInDir As Integer
Public dwLocalisation As Integer
Public dwTrueSize As Integer
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=MAXLFN)> Public longname As String
Public dir_CreateTime As Short
Public dir_LastAccessDate As Short
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto, Pack:=1)> _
Structure PARTITION
Public bActivate As Byte
Public bHeadBegin As Byte
Public wCylSectBegin As Short
Public bType As Byte
Public bHeadEnd As Byte
Public wCylSectEnd As Short
Public dwDist As Integer
Public dwSize As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto, Pack:=1)> _
Public Structure PARTDESC
Public part As PARTITION
Public dwPos As Integer
Public dwPosPartition As Integer
Public fIsFat32 As Integer
Public fIsFat As Integer
Public fIsNtfs As Integer
Public fIsLinux As Integer
Public bDisk As Byte
Public bFill0 As Byte
Public bFill1 As Byte
Public bFill2 As Byte
End Structure
Public Const MAXSIZEBYTEARRAY As Integer = (32768)
<StructLayout(LayoutKind.Sequential, Pack:=1)> _
Public Structure byteArrayBuf
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=MAXSIZEBYTEARRAY)> Public bItem As Byte()
End Structure
<StructLayout(LayoutKind.Sequential, Pack:=1)> _
Public Structure ASPIINQUIRYTAB
Public dwSizeStruct As Integer
Public dwHost As Integer
Public dwTargetID As Integer
Public dwTargetType As Integer
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=32)> Public szDeviceName As String
End Structure
' // for ExtractFile and InjectFile, in event DWEV_PROGRESSPERCENT lpParam contain a
' // PROGRESSFILE_SUPINFO structure
<StructLayout(LayoutKind.Sequential, Pack:=1)> _
Public Structure PROGRESSFILE_SUPINFO
Public dwSizeStruct As Integer
Public dwCurrentPos As Integer
Public dwReserved1 As Integer
Public dwTotalSize As Integer
Public dwReserved2 As Integer
Public lpszName As String
Public lpszFullName As String
End Structure
Public Const MAXPARTITION As Integer = 32
<StructLayout(LayoutKind.Sequential, Pack:=1)> _
Public Structure PARTDESCArray
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=MAXPARTITION)> Public diItem As PARTDESC()
End Structure
#End Region
#Region "Constants"
Public Const MAXLFN As Short = 256
Public Const SORT_NONE As Short = 72
Public Const SORT_NAME As Short = 73
Public Const SORT_EXT As Short = 74
Public Const SORT_SIZE As Short = 75
Public Const SORT_DATE As Short = 76
Public Const CDM_ROOT As Short = 50
Public Const CDM_UPPER As Short = 51
Public Const CDM_ENTRY As Short = 52
'Values for Floppy Density
Public Const FLOPPY_160K As Short = 0
Public Const FLOPPY_180K As Short = 1
Public Const FLOPPY_320K As Short = 2
Public Const FLOPPY_360K As Short = 3
Public Const FLOPPY_720K As Short = 4
Public Const FLOPPY_1200K As Short = 5
Public Const FLOPPY_1440K As Short = 6
Public Const FLOPPY_2880K As Short = 7
Public Const FLOPPY_DMF2048K As Short = 8
Public Const FLOPPY_DMF1024K As Short = 9
Public Const FLOPPY_1680K As Short = 10
' value for CaRead or CaCompare or CaWrite or CaFormat
Public Const FL_NOTHING As Short = 0
Public Const FL_USED As Short = 1
Public Const FL_ALL As Short = 2
Public Const FL_BEGINFLOPPY As Short = 3
#End Region
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Callback stuff
Public Delegate Function WimCB(ByVal dwEvent As Integer, _
ByVal dwEventParam As Integer, _
ByVal dwWin32Err As Integer, _
ByVal lpParam As IntPtr, _
ByVal lpUserParam As IntPtr) As Integer
'// dwEvent contain a DWEV_xxx value, see below
'// lpUsrParam contain user param gived to function
'
Public Const DWEV_ERRORSUPINFO As Integer = &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 As Integer = &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 As Integer = &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 As Integer = &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 As Integer = &H7FFF0005
'#define DWEV_ERROR_NOT_MATCH ((DWORD)0x7fff0005)
'// in ReadFloppy*
'// "Floppies do not match"
'// return value not used
'
Public Const DWEV_UNSTDFMT As Integer = &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 As Integer = &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 As Integer = &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 As Integer = &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 As Integer = &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 As Integer = &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 As Integer = &H7FFF000C
'#define DWEV_ERRORWRITEIMAGEFILE ((DWORD)0x7fff000c)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -