Aus Purebasic hinaus auf sys dateien zugreifen bzw. treiber
Verfasst: 25.09.2004 17:42
Ist es möglich mit Purebasic auf einen Treiber bzw. sys datei zuzugreifen ?
Wenn ja wie ?
Das deutsche PureBasic-Forum
https://www.purebasic.fr/german/
Code: Alles auswählen
; German forum: http://robsite.de/php/pureboard/viewtopic.php?t=2789&highlight=
; Author: Andreas
; Date: 10. November 2003
;Eject & Load CDTray
;###################
;NT, XP & W2K
;###################
#IOCTL_STORAGE_EJECT_MEDIA = $2D4808
#IOCTL_STORAGE_LOAD_MEDIA = $2D480C
Procedure EjectCD(LW.s)
Protected hLwStatus.l
hLwStatus = CreateFile_("\\.\"+LW,#GENERIC_READ|#GENERIC_WRITE, 0, 0, #OPEN_EXISTING, 0, 0)
If hLwStatus
DeviceIoControl_(hLwStatus,#IOCTL_STORAGE_EJECT_MEDIA,0,0,0,0,@Ret,0)
CloseHandle_(hLwStatus)
EndIf
EndProcedure
Procedure LoadCD(LW.s)
Protected hLwStatus.l
hLwStatus = CreateFile_("\\.\"+LW,#GENERIC_READ|#GENERIC_WRITE, 0, 0, #OPEN_EXISTING, 0, 0)
If hLwStatus
DeviceIoControl_(hLwStatus,#IOCTL_STORAGE_LOAD_MEDIA,0,0,0,0,@Ret,0)
CloseHandle_(hLwStatus)
EndIf
EndProcedure
EjectCD("G:")
LoadCD("G:")
; ExecutableFormat=Windows
; EOF