PDA

Click to See Complete Forum and Search --> : bios information & msvbvm60.dll


magdit
Jul 30th, 2001, 04:06 PM
With the following code i can read the bios date only i cant read the bios complete information .
and cant write
pls. check and advise me






Option Explicit

' this code works under VB 6, will work under VB 5 with mods
' the GetMem functions work under NT 4 & Windows 2000, but you cannot access BIOS
' memory on NT 4 or NT 5 machines. So don't try....
' requires a textbox named Text1 on your form.

Private Declare Sub GetMem1 Lib "msvbvm60.dll" (ByVal lAddress As Long, var As Byte)

' GetMem2, GetMem4 and GetMem8 functions read 2, 4, & 8 bytes of memory
' GetMem2 & GetMem4 are usable by VB

Private Declare Sub GetMem2 Lib "msvbvm60.dll" (ByVal lAddress As Long, var As Integer)
Private Declare Sub GetMem4 Lib "msvbvm60.dll" (ByVal lAddress As Long, var As Long)

' NOTE:

' For VB 5.0 change the "msvbvm60.dll" to msvbvm50.dll

' I'm not using these api's; they write memory and are included for completeness.
' Two words: WATCH OUT
' if you elect to use these, you are on your own...

Private Declare Sub PutMem1 Lib "msvbvm60.dll" (ByVal lAddress As Long, var As Byte)
Private Declare Sub PutMem2 Lib "msvbvm60.dll" (ByVal lAddress As Long, var As Integer)
Private Declare Sub PutMem4 Lib "msvbvm60.dll" (ByVal lAddress As Long, var As Long)


Private Sub Form_Load()
Text1.Text = BIOSDateString
End Sub

Private Function BIOSDateString() As String
Dim b As Byte
Dim AddrMem As Long
Dim strTmp As String
Dim i As Integer

AddrMem = &HFFFF5
strTmp = ""
For i = 0 To 7
Call GetMem1(AddrMem + i, b)
strTmp = strTmp & Chr$(b)
Next
BIOSDateString = strTmp
End Function