News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

DeviceIoControl

Started by bomz, April 05, 2012, 05:39:39 AM

Previous topic - Next topic

bomz

This is my code. Try to change 1 dup (?) to 2. I 4 hour can't understand why don't work. Than I randomly google this code change to 1 and ...
https://www.blurredlogic.net/ebooks/Kernel_Driver_tut/KmdKit/examples/setup/EnumDisk/EnumDisk.bat
Quote_SP_DEVICE_INTERFACE_DETAIL_DATA STRUCT
  cbSize      DWORD ?
  DevicePath      db 1 dup(?)   ;[ANYSIZE_ARRAY]
_SP_DEVICE_INTERFACE_DETAIL_DATA ends
And on this forum I find wrong example of guid structure
Quote_GUIDX STRUCT
  Data1         DWORD ?
  Data2         WORD ?
  Data3         WORD ?
  Data4         byte 8 dup(?)           
_GUIDX ends

I get symboliclink may open it with createfile, but any step to how assign drive letter
NtQueryVolumeInformationFile FltGetVolumeGuidName(?!!) IOCTL_MOUNTMGR_QUERY_POINTS ---????

bomz

#46
sory it wasn't Symbolic Link, real Symbolic Link here. Device symbolic links.

bomz

HELP!
invoke lstrlenW, addr [MountDevName.Name1]
shl eax, 1 ;sizeof WCHAR
mov MountmgrMountPoint.DeviceNameLength, ax ;WORD
;lea ecx, MountDevName.Name1
mov MountmgrMountPoint.DeviceNameOffset, sizeof MountmgrMountPoint
add eax, sizeof MountmgrMountPoint

invoke DeviceIoControl, esi, IOCTL_MOUNTMGR_QUERY_POINTS, \
addr MountmgrMountPoint, eax,\;sizeof MountmgrMountPoint
addr MountmgrMountPoints,sizeof MountmgrMountPoints, 0, 0


Can't understand how fill structure. error 1 - ERROR_INVALID_FUNCTION

http://msdn.microsoft.com/en-us/library/windows/hardware/ff562286%28v=vs.85%29.aspx
http://source.winehq.org/source/dlls/kernel32/volume.c
http://stackoverflow.com/questions/3012828/using-ioctl-mountmgr-query-points


QuoteSymbolicLinkNameOffset

    Contains an offset, in bytes, into the output buffer where the symbolic link is located.
can't understand this
Try to get from Device Symbolic link - Volume Symbolic Link

bomz

IOCTL_MOUNTMGR_NEXT_DRIVE_LETTER
http://msdn.microsoft.com/en-us/library/windows/hardware/ff560473(v=vs.85).aspx
google don't find any example

Make NtQueryObject