Thursday, June 29, 2006

Underscore in URL and not saved cookies

Have a web site using cookies? Browse the site and wonder why the cookies are not saved?
http://support.microsoft.com/kb/275033/en-us is the answer.

Shortly: avoid using invalid characters like "_" (underscore) in hostname

http://my_host is bad, http://myhost is better.

Do not forget it! Enjoy!

Monday, June 26, 2006

Troubleshooting RMS Service setup and usage

Ever tried to setup Windows Rights Management Service "from scratch" ? Keep in mind to take care about following things - to avoid wasting time:

1. Install MSMQ on the box prior to setup RMS.
MSMQ is used for logging purposes - later setup of MSMQ has no effect. So be sure to have a WS2003 CD ready - some files might be copied to harddisk while setup MSMQ

2. Install SQL Server.
SQL Server stores RMS relevant data. RMS will setup SQL Express if no SQL detected on the machine.

3. Ensure Active Directory is available.
After setup you'll need to register RMS in active directory (except you plan to work with Passport based identification). Ensure RMS account has enough privileges to make required changes in AD.

4. Apply database update to prevent SqlException on rights assignement.
Consult http://support.microsoft.com/kb/913372 - KB article describing changes in database. Ensure you have enough privileges to apply them - these are changes in master database.

5. Ensure email addresses are set to users in AD.
Only users having email address set in AD are served by RMS service. Be aware of that.

6. Ensure privileges to search/browse AD.
RMS service account must have privilege to search in AD.

7. Ensure the GC for AD is visible.
Just start Active Directory Sites MMC and browse properties of NTDS: the GC checkbox must be checked.

Follow the advices - and you'll keep the adrenaline level lower trying to assign digital rights to your Office documents. Enjoy!

Tuesday, June 13, 2006

Unmarshal Double with VB.NET

One might be suprised howto unmarshal double values got to VB.NET over P/Invoke.
Well, Double is 64bit value, but there's no explicit ReadDouble(...) method in Marshal. So the first try may look like:

Dim myDbl as Double = Convert.ToDouble(Marshal.ReadInt64(myPtr,myOffset))

It won't work!

Mind the bits have exponential as well as mantissa parts. These aren't available in Int64 and are guessed by .NET as missing. So all the bits contained in Int64 read are used for conversion and bring not the expected result.

Sample: you get over P/Invoke a Double value 20060610.0 (for what purposes ever). Read with ReadInt64 you get 4716150189222526976 as Int64, that easily converted to 4.716150189222527E+18 as Double.

Workaround: do not forget to use BitConverter!

Dim myDbl as Double = BitConverter.Int64BitsToDouble( _
Marshal.ReadInt64(myPtr,myOffset))


Enjoy!

Wednesday, June 07, 2006

Start

Seen on the Mark's site www.sysinternals.com : Powered by Blogger.
Why not to start an own blog? Enjoy!