Wednesday, July 25, 2007

Windows SharePoint Services 3.0 : Unexpected error

Today our Windows SharePoint Services 3.0 (WSS3) issued a typical Microsoft error message: "Unexpected error". That's all: it displayed no other message is and no information in the event log of the server. BIIIGGG trouble since it's used by 300+ people.

So the first thing was to unplug the LAN cable to make sure I'm the only user on the server. Next, patch the web.config file to make sure we see all error details and the stack trace. This can be done by:

Changing the line
<safemode maxcontrols="50" callstack="false"> to
<safemode maxcontrols="50" callstack="true">
And
<customerrors mode="On"> to
<customerrors mode="Off">
(found at http://www.devx.com/dotnet/Article/17518/1954?pf=true)


A CTRL+Refresh inside Internet Explorer finally displayed that WSS was issuing an AccessViolationException in SPRequest..ctor() - that is the default static constructor of that class.

The hotfix from Micosoft for AccessViolationException in KB923028 did not help, but during testing that I found out that WSS raises first an BadImageFormatException before the AccessViolationException. This means that the main cause of the problem is the BadImageFormatException
and the AccessViolationException is only because the COM wrapper of .NET seems to have a bug.


Because of COM+ errors inside event log, it turned out that SPRequest is actually a COM class (GUID {BDEADEE2-C265-11D0-BCED-00A0C90AB50F}) and that it is located inside OWSSVR.DLL. I simply copied this file from our test server that has the same version of WSS running to this server and IT WORKED.

Well, I forgot to plug the cable in again so the server was still offline for 15 more minutes but anyway…

Saturday, July 7, 2007

HP Bluetooth with Microsoft Bluetooth Stack

I usually prefer to use the Microsoft Bluetooth stack (included with Windows XP SP2) instead of the WIDCOMM stack because it requires less recourse, is faster and also easier to use. The only thing missing is support for any Audio profile.

However, if you have a lot of HP notebooks or tablets, you normally can't use the Microsoft stack since it doesn't know the build-in "HP integrated module with Bluetooth wireless technology". But there is a way to do it anyway…

First, remove the WIDCOMM stack using Control Panel -> Add/Remove Programs. Next, restart you computer and open up "Device Manager" (execute Devmgmt.msc). The above noted device will appear as "Unknown device".

Next, open C:\WINDOWS\inf and open the file "BTH.inf" with Notepad. It will start with something like this:

; Microsoft Windows Bluetooth Driver INF
; Copyright (c) 2002 Microsoft Corporation

Scroll down until you find the following lines:

[HP.NT.5.1]
"HP USB BT Transceiver [1.2]"= BthUsb, USB\Vid_03F0&Pid_0C24


Duplicate the last line and append it so it then looks like this:

[HP.NT.5.1]

"HP USB BT Transceiver [1.2]"= BthUsb, USB\Vid_03F0&Pid_0C24

"HP USB BT Transceiver [Patched]"= BthUsb, USB\Vid_03F0&Pid_011D

Note that we only have changed the last characters to the PID (Product ID) of the Bluetooth device. If you have a new laptop the PID might have changed. You can get this PID by double-clicking the device and using the details tab.

Save the BTH.INF, go back to Device Manager and select "Scan for Hardware changes". The device should now start to install. It might happen that the device is after reported as having a problem. If this happens, simple right-click it, select "Disable" and after that "Enable" again.

That should do the trick and you can use the Microsoft stack with the "HP integrated module with Bluetooth wireless technology".

Enjoy!