jaberwacky Posted October 8, 2010 Posted October 8, 2010 (edited) I searched the forums first but I found limited information concerning _WinAPI_CreateFileEx(). What's the difference between that and this one: _WinAPI_CreateFile()? There must be some difference between the two. If I feed them both the same arguments _WinAPI_CreateFile() will not work while _WinAPI_CreateFileEx() does work. Local Const $FileName = $DevicePath ; Ex: G:\\ Local Const $DesiredAccess = $GENERIC_READ Local Const $ShareMode = BitOR($FILE_SHARE_READ, $FILE_SHARE_WRITE) Local Const $SecurityAttributes = 0 Local Const $CreationDisposition = $OPEN_EXISTING Local Const $FlagsAndAttributes = BitOR($FILE_FLAG_BACKUP_SEMANTICS, $FILE_ATTRIBUTE_NORMAL) Local Const $TemplateFile = 0 Local Const $DevHandle1 = _WinAPI_CreateFileEx($FileName, $CreationDisposition, $DesiredAccess, $ShareMode, $FlagsAndAttributes, $SecurityAttributes, $TemplateFile) Local Const $DevHandle2 = _WinAPI_CreateFile($FileName, $CreationDisposition, $DesiredAccess, $ShareMode, $FlagsAndAttributes, $SecurityAttributes) (WinAPIEx.au3) DllCall('kernel32.dll', 'ptr', 'CreateFileW', 'wstr', $sFile, 'dword', $iAccess, 'dword', $iShare, 'ptr', DllStructGetPtr($tSecurity), 'dword', $iCreation, 'dword', $iFlagsAndAttributes, 'ptr', $hTemplate) (WinAPI.au3) DllCall("kernel32.dll", "handle", "CreateFileW", "wstr", $sFileName, "dword", $iDA, "dword", $iSM, "ptr", $pSecurity, "dword", $iCD, "dword", $iFA, "ptr", 0) I can see that there different types but they are essentially the same. WinAPI_CreateFile() works in other cases. Ok, I'm probably going to add to this post a few thousand times, so if you're interested in this then keep checking back. Edited October 8, 2010 by jaberwocky6669 Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
Yashied Posted October 8, 2010 Posted October 8, 2010 For example, how do you set FILE_FLAG_WRITE_THROUGH or other FILLE_FLAG_* flags by using _WinAPI_CreateFile()? Unlike _WinAPI_CreateFile(), _WinAPI_CreateFileEx() works directly with WinAPI constants. Therein lies the difference. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
jaberwacky Posted October 8, 2010 Author Posted October 8, 2010 (edited) The mouse runs underneath the cats nose. Thanks for pointing that out for me, Yashied. I have been confused about that for quite a while. Edited October 8, 2010 by jaberwocky6669 Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now