Windows Driver Kit structur - How do I get something from it

Windows specific forum
harff182
Enthusiast
Enthusiast
Posts: 105
Joined: Thu Dec 08, 2005 4:58 pm
Location: Duesseldorf, Germany

Post by harff182 »

Sparkie wrote: (Or maybe I'm making a mountain out of a molehill :P )
I hope I didn't show you the wrong track.

I'm programming a database for moviefiles, like MediaMonkey for MP3 and will most probably give the source to the community because of the large amount of help I've already gotten.
When I discovered MediaInfo.dll to get some infos directly from the moviefiles, I decided to try the same with the media they are on. I'm not that good when it comes to do researches, but I found 4 ways to get these infos on optical media:

1. WMI / Win32_PhysicalMedia, from http://msdn2.microsoft.com/en-us/library/aa394346.aspx
Problem: Neither with PB nor VBS or the M$-tools(Scriptomatic, WMI Code Creator) I was able to retrieve the promised infos.

2. IMAPI2, from http://msdn2.microsoft.com/en-us/library/aa364821.aspx]
I played a little bit with the VBS, but my knowledge is too small to use it frop within PB using the 2 libs from PureArea.net.
I also discovered, that the recognition only seems to work correctly with EMPTY Media.

3. Book Type Field, from http://en.wikipedia.org/wiki/Book_type
I found no infos, how to read the lead-in from a CD/DVD from within PB.
Or I just don't understand similar code.

4. Windows Driver Kit, from http://msdn2.microsoft.com/en-us/library/ms809046.aspx
Here we are at the end of a small story, that possibly nobody is interested in :)

Back to your code:
It works, but some results are unexpected:

Code: Select all

Mediumtyp       |DVD-ROM|DVD-RAM|DVD-R|DVD-R DL|DVD-RW|DVD+RW|DVD+R|DVD+RW DL|DVD+R DL|
----------------+-------+-------+-----+--------+------+------+-----+---------+--------+
Wikipedia bin   |0000   |0001   |0010 |0010    |0011  |1001  |1010 |1101     |1110    |
Wikipedia dec   |0      |1      |2    |2       |3     |9     |10   |13       |15      |
DVD_Layer_Descr |0      |1      |2    |--      |3     |9     |--   |--       |--      |
----------------+-------+-------+-----+--------+------+------+-----+---------+--------+
Sparkie.pb ;)	|0000   |1011   |0010 | ------ |------|1001  |0000 |---------|--------|
----------------+-------+-------+-----+--------+------+------+-----+---------+--------+
DVDInfoBookType |DVD-ROM|DVD-RAM|DVD-R| ------ |------|DVD+RW|DVD+R|---------|--------|
DVDInfoMediaType|DVD-ROM|DVD-RAM|DVD-R| ------ |------|DVD+RW|DVD+R|---------|--------|
----------------+-------+-------+-----+--------+------+------+-----+---------+--------+
cdrecord        |DVD-ROM|DVD-RAM|DVD-R| ------ |------|DVD+RW|DVD+R|---------|--------|
----------------+-------+-------+-----+--------+------+------+-----+---------+--------+

DVDInfo: DVD+Rx4 get the BookType DVD-ROM, while DVD+Rx8 geht DVD+R. Weird.
I don't use or have all of the possible Media but I'll try to buy and burn a single one for the missing ones the next days.

back to coding... scholly
Sorry 4 my poor English, it's the only one I learned 40 years ago...
since 17.12.08: XPHome(SP3) + PB 4.30
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Well it looks like the code works at least a little bit :wink:

I do not do much with DVD's, so testing on my side will be difficult at best. I'll get back to Googling tonight and see if I can make any improvements to the code. :)
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

I don't know about this one. After hours (days) of tinkering with this code, I just can't get the correct results. I'm guessing that the structure bitfields are not being handled properly. I've tried right to left...left to right...nuth'n works here for me. :?
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
harff182
Enthusiast
Enthusiast
Posts: 105
Joined: Thu Dec 08, 2005 4:58 pm
Location: Duesseldorf, Germany

Post by harff182 »

So I think we may close the thread for now.
Yesterday evening I testet 6 different Disks of every DVD-Type I have used and always got the same results.
Even if you/I expected other values because of the docs, I think I can use your code successfully (to replace the use of cdrecord) as long as no better solution comes around.
Since my database is primarily for me and 2 friends, I don't await problems - even if they get other/different results because of other media/burner/software, I can rework the code.
And when I release the code to public, I'll point to this thread, so interested people may understand the trouble.

Sparkie, thanks for your helpfull efforts...
scholly
Sorry 4 my poor English, it's the only one I learned 40 years ago...
since 17.12.08: XPHome(SP3) + PB 4.30
Post Reply