RegisterTypeLibrary to register type libraries the way regsvr32 registers COM servers

While regsvr32 tool is used to register COM servers, such as .DLL, .OCX, .AX files, sometimes you need an equivalent for type library files, such as .TLB, for example to automate software registration on a host. There has been no stock utility for this that I am aware of, so I have been using my own one (RegisterTypeLibrary):

C:\Program Files\Alax.Info\Media Tools>RegisterTypeLibrary.exe Acquisition.dll
Type Library Information:
  File Path: Acquisition.dll
  File Full Path: C:\Program Files\Alax.Info\Media Tools\Acquisition.dll
  Name: AlaxInfoMediaToolsAcquisition
  Documentation String: Alax.Info Media Tools Acquisition 1.0 Type Library
  GUID: {4C03D3C8-13AD-451F-9363-FAD08EF94A91}
  LCID: 0
  Platform: 1
  Version: 1.0
  Flags: 0x8

Registering...
Registered.

/U unregisters, /Q displays information about type library (may be useful as it also works for .DLL files where type library is embedded into binary).

A Visual C++ .NET 2008 source code is available from SVN, release binary included.

ProcessSnapshot to take a snapshot of process modules, threads, stacks and performance

While troubleshooting released application on remote production site, it is very useful to grasp a state of the process for further analysis. There are several scenarios in which the following information about process state is helpful:

  • modules (DLLs) loaded into process and their versions
  • threads and their call stacks
  • process and thread performance

An utility ProcessSnapshot takes advantage of Debugging Tools API (dbghelp.dll – note the dialog also displays DLL version in the right bottom corner) and writes this helpful information to text file and it can also take a sequence of the snapshots to compare thread performance and/or stacks and check the difference.

The generated file is in the directory of the utility application and looks like:

Snapshot
  System Time: 10/14/2008 8:46:33 PM
  Local Time: 10/14/2008 11:46:33 PM

Performance
  Creation System Time: 10/14/2008 8:46:28 PM
  Kernel Time: 0.094 s
  User Time: 0.031 s

Modules

  Module: ProcessSnapshot.exe @00400000
    Base Address: 0x00400000
    Base Size: 0x0005b000 (372736)
    Name: ProcessSnapshot.exe
    Path: D:\Projects\Utilities\ProcessSnapshot\Release\ProcessSnapshot.exe
    Product Version: 1.0.0.1
    File Version: 1.0.0.125

  Module: ntdll.dll @7c900000
    Base Address: 0x7c900000
    Base Size: 0x000af000 (716800)
    Name: ntdll.dll
    Path: C:\WINDOWS\system32\ntdll.dll
    Product Version: 5.1.2600.5512
    File Version: 5.1.2600.5512
[...]

Threads

  Thread: 3824
    Base Priority: 8
    Creation System Time: 10/14/2008 8:46:57 PM
    Kernel Time: 0.063 s
    User Time: 0.031 s
    Call Stack
      ntdll!7c90e4f4 KiFastSystemCallRet (+ 0) @7c900000
      USER32!7e4249c4 GetCursorFrameInfo (+ 460) @7e410000
      USER32!7e424a06 DialogBoxIndirectParamAorW (+ 54) @7e410000
      USER32!7e4247ea DialogBoxParamW (+ 63) @7e410000
      ProcessSnapshot!00403f45 ATL::CDialogImpl<CMainDialog,ATL::CWindow>::DoModal (+ 67) [c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlwin.h, 3478] (+ 28) @00400000
      ProcessSnapshot!00403b6f CProcessSnapshotModule::RunMessageLoop (+ 74) [d:\projects\utilities\processsnapshot\processsnapshot.cpp, 67] (+ 0) @00400000
      ProcessSnapshot!004049b9 ATL::CAtlExeModuleT<CProcessSnapshotModule>::Run (+ 17) [c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlbase.h, 3552] (+ 0) @00400000
      ProcessSnapshot!004041c3 ATL::CAtlExeModuleT<CProcessSnapshotModule>::WinMain (+ 48) [c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlbase.h, 3364] (+ 5) @00400000
      ProcessSnapshot!00434477 wWinMain (+ 5) [*d:\projects\utilities\processsnapshot\release\processsnapshot.inj:5, 14] (+ 0) @00400000
      ProcessSnapshot!00415058 __tmainCRTStartup (+ 274) [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c, 263] (+ 27) @00400000
      !00360033

Continue reading →

Skype Beta

I recently advised to take a look at new beta version of Skype software, which I have to use nevertheless I would prefer Jabber for instant messaging if I would be free to choose. I was told that finally multiple chats are hosted in a single window and it is extremely convenient. While this looks hardly an advantage particularly to me, I still wanted to take a look at new fresh better Skype out there.

I am still very much disappointed by the trend of rewriting GUI. For god sake, who the hell needs that every single vendor mimic Vista’s GUI elements on his own? Why the hell would I want Vista buttons on Windows XP? They are still there as if there is no way to put an extra button to switch between compact and full view.

It may look that it is not worth whining around as this is a minor thing just to make it this way and not the other. Here is the Skype team achievement in imitating Vista interface on XP:

Window’s non-client area sometimes is calculating incorrectly and layout is updated so that menu has an extra empty line. The company massively invests in custom GUI that comes out crappy going out of uniform OS look and in additionally it is still buggy after passing QA. Yes, it is still a beta but it still gives a great idea about how things are cooked: a lot of work behind the scene and bugs are still here as a result.

Improved usability is questionable to say the least. A quick glance revealed issues:

  • area for typing in chat text is surprisingly small, even on expanded large enough window
  • roster has persistent useless (for me) items which were optional previously
  • roster has another GUI glitch most likely caused by new look
  • groups reworked as a dropdown list and if previously I could – this was very useful – multiselect groups to be visible by clicking them with a Control key being hold, this is not an option anymore, thanks for that

Update: luckily there is “Classic Windows” option!

Microsoft Visual Studio has encountered an internal error.

A picture for relaxation:

It is probably a fresh bug there as it seems to be happening far more frequently with version 2008 (with ot without SP1) as compared to 2005. Luckily it has no effect to code being written, the problem clearly relates to debugger. At some point there is a crash, though which the IDE perfectly survives but longer can start a new debugging session until IDE is entirely restarted.

Multichannel audio recording

There has been recently an interesting post “Problem playing back multi-channel wave file under vista” on DirectShow Development forum about certain hardware that is capable of recording 64 channels of audio in 24-bit per sample PCM quality, with a sample recorded .WAV file posted.

I was curious what kind of hardware implements such recording. Google suggests it could be PCM H64 multichannel system from Sadie, UK.

This is definitely an interesting piece of hardware which can fill normally video’s bandwidth with audio only data. BTW, some useful related C++/DirectShow code is here on new Assembla’s web itnerface into subversion repository.

FFDShow strikes back

FFDShow is already known for it issues (including for example mentioned one). Today’s featured one is related to its Video Decoder. A great deal of FFDShow related issues amy be worked around with a single shot by listing the image name as an FFDShow exclusion under registry:

HKEY_CURRENT_USER\Software\GNU\ffdshow; blacklist

but I felt relaxed and the problem re-occurred from Windows service where HKEY_CURRENT_USER was not available/applicable.

FFDShow Video Decoder registration looks like:

It is immediately clear that the filter registered with extremely (and definitely unreasonably, breaking guidelines) high merit in conjunction with generic video media type will be taken as a possible decoder in every single graph rendered. At the very least, this is a perofrmance issue, similar to frequently reported like this recent one: How to reduce time during pin connection on vista ultimate using RenderStream function…?.

However the real problem was that the filter was accepting connection on my source pin and pretending it could be a valid decoder instead my own one (definitely registered with a proper merit of 0×00800000 (MERIT_PREFERRED). Did it actually decode? No, just sent blackness on the output… It seems that it is getting a good manner to distance from this crapware by implementing IAMGraphBuilderCallback interface on the graph builder site and reject consideration of FFDShow A/V Decoders as candidates.

Time Zone Information & Monitor Information

I am sharing a couple of utilities to be able to quick check system settings. TimeZoneInformation prints in a human friendly style TIME_ZONE_INFORMATION structure as reported by Windows through GetTimeZoneInformation API.

TIME_ZONE_INFORMATION:
.Bias: -120
.StandardName: FLE Standard Time
.StandardDate: { .wYear 0, .wMonth 10, .wDay 5, .wDayOfWeek 0, .wHour 4, .wMinute 0, .wSecond 0, .wMilliseconds 0 }
.StandardBias: 0
.DaylightName: FLE Daylight Time
.DaylightDate: { .wYear 0, .wMonth 3, .wDay 5, .wDayOfWeek 0, .wHour 3, .wMinute 0, .wSecond 0, .wMilliseconds 0 }
.DaylightBias: -60
[...]

A Visual C++ .NET 2008 source code is available from SVN, release binary included.

And the second utility is MonitorInformation to print multi-monitor related information again as reported by Windows, GetSystemMetrics and EnumDisplayMonitors APIs.

System Metrics:
  SM_XVIRTUALSCREEN: 0
  SM_YVIRTUALSCREEN: 0
  SM_CXVIRTUALSCREEN: 1680
  SM_CYVIRTUALSCREEN: 1050
  SM_CMONITORS: 1
  SM_SAMEDISPLAYFORMAT: 1

Monitor 0 at (0, 0) - (1680, 1050):
  Coordinates (rcMonitor): (0, 0) - (1680, 1050)
  Work Area (rcWork): (0, 0) - (1680, 1026)
  Flags (dwFlags): 0x1
  Device Name (szDevice): \\.\DISPLAY1

A Visual C++ .NET 2008 source code is available from SVN, release binary included.