Friday, May 25, 2007

XPe tip #42: Media file metadata access

This interesting post in the newsgroup led me to discovering another nasty bug of latest XP Embedded bits (SP2, FP2007).

Basically the issue was that the poster was having troubles accessing the metadata of media files on an NTFS partition. More specifically, their script code that called to getDetailsOf method of the Shell.Application object was failing to return proper results but returned the success error code.

The issue showed up when the developer moved to FP2007. First thought was the problem was there due to a missing component that could disappear (vs old builds) because of the major re-factoring Microsoft did in that Feature Pack.

However, the source of the problem was in the new component that was added to the database update - "Windows Media Player 10.0". The previous player components - "Windows Media Player 8.0" and "Windows Media Player 9.0" (this one is ghost component) - included the shmedia.dll library but the Player 10 didn't. That library is actually responsible for parsing file content, that shell API are loading up, and extracting and parsing the metadata that file may contain. That metadata is heavily used by newest media file grouping feature of Explorer shell with Windows Media Player instead on XP system.

Conclusion: make sure to include shmedia.dll library and register it (it is a COM object so you want to use the regsvr32 tool at run time or simply add a FBA DLL/COM Registration resource command in TD.
Note that the shmedia.dll library is surely in the XPe repository because of the previous versions of the player component.

9 comments:

Anonymous said...

Hi KM, i have troubles with making tghe FBA DLL COM registration. I try with this link http://msdn2.microsoft.com/en-us/library/ms912922.aspx but i really don't understand where i can make this happen. Can you give some instructions like a 5 years old child?
Thanks

KM said...

I must admit I can't quite understand what problems you may be facing with the FBA DLL registration.
Are you able to register your dll manually at run time with regsvr32 utility? If so, you will just need to set the Dll name and path on the FBA DLL Registration resource page.
Can you describe what's happening with the command you set up?

Anonymous said...

No, i don't know how to do anything of this. I have seen some many pages but like this one http://www.ss64.com/nt/regsvr32.html
But i don't know exactly when and where o must to do this register

KM said...

Just do the regsvr32 registration on your library at run time post-FBA. Launch CMD and execute command like this "regsvr32 'the path to your Dll'".

Anonymous said...

Man you rock!!! Thanks

There's a way where i can ask some questions or contact for a quick course or tutorial?

I try in some forums but the answer it's a little bit low.

Thanks again KM

KM said...

Well, you can alwasy use this blog to post your questions. Otherwise, I am a requent poster to MS public Windows XP Embedded newsgroup.

I can read messages posted in English and Russian if it helps you anyhow :-)

Anonymous said...

Russian, would be nice learn that.

So, I'm trying to put the steps clearly to make a image (usb boot or cd, network)

1. Make image with TD
2. Run FBA
3. Install or register dll's, applications
4. Make a SDI (post FBA)
5. Cloning (usb, net, cd)

I'm a right or i am missing something?

Regards

KM said...

Sorry but I couldn't quite understand your steps. What exactly you are trying to create? Why SDI?

If you are trying to create a bootbable CD, please follow the documented procedure: http://msdn2.microsoft.com/en-us/library/ms932879.aspx.

Anonymous said...

The link says Content not found.

I'm trying to create an image that i can send to my client in a cd or usb and by itself makes wxpe with my applicattion. But i have to do some issues like put virtual memory on 1 GB, regvr the shmedia.dll and another small things. So i believe that i can make my runtime image, then do all the preferences that i want and finally make the final image. I was thinking in a SDI file to make it.

Thanks