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

Thanks for Kernel Mode Driver Tut for MASM32 I just read http://wasm.ru/series.php?sid=9

Cool

ragdog

Sorry for the Off-Topic

What is this for a tool to create this animate gif for your screen capture?


bomz

http://www.masm32.com/board/index.php?topic=5451.msg141059#msg141059
QuoteAll process you may see on screens. The main idea how make high qulity screen GIF\VIDEO:
1 The condition's how get max quality you may find only manualy/visualy compare results
2 The most important moment the intermedia  video codec (I use Microsoft Video 1, for result video Windows Media Codec 9, 1 pass, 100%, 5 sec key frame, complex)*
3 UvcrScreenCamera (crack) have it's own gif converter but it don't get max qulity/size
4 As you may see in internet there is very many video helps, but the main mistake - it's makes with max screen video mode (1280X1024 for ex) and when resized to 600X800. make it in 600X800 video mode.
5 find your own condition/programs
6 think about scenario of your video before make it
7 if you want cut\add (subtitles) video recompress it in uncompressed video
below in topic you may find hide screens with how make HQ video, add subtitles, add sound.......

http://translate.google.ru/

http://www.gamani.com/
http://www.uvsoftium.ru/UVScreenCamera.php
http://www.erightsoft.com/SUPER.html
http://www.virtualdub.org/
http://www.virtualdub.org/virtualdub_filters.html
http://bomz-co.narod.ru/GIF.zip
http://s016.radikal.ru/i337/1010/18/4b7eaccaf1ca.gif
http://bomz-co.narod.ru/WebSeeding.MKV
http://bomz-co.narod.ru/WS.MKV
http://bomz-co.narod.ru/WebSeeding.rar
http://s013.radikal.ru/i325/1010/d4/3f89b8a8a686.gif
http://s009.radikal.ru/i307/1010/bb/b23f06062a18.gif
http://s014.radikal.ru/i328/1010/b3/f255f5575b03.gif
http://s012.radikal.ru/i321/1010/96/bccf26b63c61.gif
http://s016.radikal.ru/i334/1010/c6/e9fa5da0a055.gif
http://s015.radikal.ru/i333/1010/80/aeddbc693657.gif
http://s016.radikal.ru/i334/1010/b5/6c7a7808170e.gif

*XVid 2-pass also gets good results for result video

http://s60.radikal.ru/i167/1105/e7/746ca23b1c9e.gif

http://www.bunkus.org/videotools/mkvtoolnix/ - it can't put WMV video to mkv container


*The most video codecs work good with even size 320*240 not 321*240. some of them with only standart resolution for ex 320*240 640*480 etc

dedndave

handy little tool, Bomz   :U
(I/O control decoder)

bomz

thanks for ragdog and his very interesting site

I find all includes and libs for driver kid https://www.blurredlogic.net/ebooks/Kernel_Driver_tut/KmdKit/include/w2k/

Now I trying get volume guid through devices info

dedndave

ahhhh

5636096 = 560000h

:P

bomz


Quote.386

.model flat, stdcall
option casemap :none

include \MASM32\INCLUDE\windows.inc
include \MASM32\INCLUDE\user32.inc
include \MASM32\INCLUDE\kernel32.inc
includelib \MASM32\LIB\user32.lib
includelib \MASM32\LIB\kernel32.lib
include \MASM32\INCLUDE\setupapi.inc
includelib \masm32\LIB\setupapi.lib

_GUIDX STRUCT
    Data1               DWORD ?
    Data2               WORD ?
    Data3               WORD ?
    Data4 byte 8 dup(?)           
_GUIDX ends

_SP_DEVINFO_DATA struct
  cbSize      DWORD ?
  ClassGuid      _GUID <>
  DevInst      DWORD ?
  Reserved      DWORD ?
_SP_DEVINFO_DATA ends

;{0xA5DCBF10, 0x6530, 0x11D2, 0x90, 0x1F, 0x00, 0xC0, 0x4F, 0xB9, 0x51, 0xED}; //ddk GUID_DEVINTERFACE_USB_DEVICE
;GUID_DEVINTERFACE_DISK , 53f56307h , 0b6bfh , 11d0h , 94h , 0f2h , 00h , 0a0h , 0c9h , 1eh , 0fbh , 8bh)
.data
form         db "ERROR: %u", 0
perenos         db 13,10,0
;USBGUID         _GUIDX <0A5DCBF10h, 06530h, 011D2h, <090h, 01Fh, 000h, 0C0h, 04Fh, 0B9h, 051h, 0EDh>>
DISKGUID      _GUIDX <053f56307h, 0b6bfh, 011d0h, <94h , 0f2h, 000h, 0a0h, 0c9h, 01eh, 0fbh, 08bh>>
DIGCF_PRESENT      equ 00000002h
DIGCF_ALLCLASSES   equ 00000004h
DIGCF_PROFILE      equ 00000008h
DIGCF_DEVICEINTERFACE   equ 00000010h
SPDRP_HARDWAREID   equ 00000001h

.data?
buffer         db 512 dup(?)
string         db 1024 dup(?)
Devinfo         _SP_DEVINFO_DATA <>
cw         dd ?

.code
start:
;invoke SetupDiGetClassDevs,addr USBGUID,0,0,DIGCF_PRESENT OR DIGCF_DEVICEINTERFACE
invoke SetupDiGetClassDevs,addr DISKGUID,0,0,DIGCF_PRESENT OR DIGCF_DEVICEINTERFACE
.if eax !=INVALID_HANDLE_VALUE
   mov ebx, eax
   xor esi, esi
   mov Devinfo.cbSize, sizeof _SP_DEVINFO_DATA
@@:
   invoke SetupDiEnumDeviceInfo, ebx, esi, addr Devinfo
   .if eax==TRUE
      invoke SetupDiGetDeviceRegistryProperty, ebx, addr Devinfo, SPDRP_HARDWAREID, NULL, addr buffer, sizeof buffer, addr cw
      ;invoke MessageBox,0,ADDR buffer,0,MB_ICONASTERISK
      invoke lstrcat, addr string, addr buffer
      invoke lstrcat, addr string, addr perenos
      add esi, 1
      jmp @B
   .endif
   invoke MessageBox,0,ADDR string,0,MB_ICONASTERISK
.else
   invoke GetLastError
   invoke wsprintf,ADDR buffer,ADDR form,eax
   invoke MessageBox,0,ADDR buffer,0,MB_ICONASTERISK
.endif
invoke ExitProcess,0
end start

dedndave

 :U



ok - the optical drive is not showing
hp sata blu-ray

bomz


dedndave

EnumUSBDevice shows my wireless keyboard/mouse and the USB controller



EnumVolumeDevice



EnumDiskDevice





my drives are labeled so that partitions of the same disk start with the same letters
K7NL_WD - partitions on the western digital
K7NL_MX - partitions on the maxtor
K7NL_HH - partitions on the hitachi
i have another hitachi (K7NL_HI), but it's not connected at the moment   :P


dedndave

nope
XP media center edition 2005, SP3

bomz





_SP_DEVICE_INTERFACE_DETAIL_DATA STRUCT
  cbSize DWORD ?
  DevicePath db 1 dup(?) ;[ANYSIZE_ARRAY]
_SP_DEVICE_INTERFACE_DETAIL_DATA ends

mov InterfaceDetailed.cbSize, sizeof _SP_DEVICE_INTERFACE_DETAIL_DATA


Quotetypedef struct _SP_DEVICE_INTERFACE_DETAIL_DATA {
  DWORD cbSize;
  TCHAR DevicePath[ANYSIZE_ARRAY];
} SP_DEVICE_INTERFACE_DETAIL_DATA, *PSP_DEVICE_INTERFACE_DETAIL_DATA;
DevicePath

    A NULL-terminated string that contains the device interface path. This path can be passed to Win32 functions such as CreateFile.

http://msdn.microsoft.com/en-us/library/windows/hardware/ff552343%28v=vs.85%29.aspx

The size of this structure must be 5 or nothing don't work

P1

cbSize = The size, in bytes, of the SP_DEVICE_INTERFACE_DETAIL_DATA structure. For more information, see the following Remarks section.
DevicePath = A NULL-terminated string that contains the device interface path. This path can be passed to Win32 functions such as CreateFile.

5 is the minimum length.  So the structure can be any size over 5.

Regards,  P1  :8)