Tuesday 23 January 2007

Solving The Vista Radeon Code 43 problem

If, like me, you have been a member of "The Code 43 Club", and various versions of Vista betas, and now RTM simply refuse to load the video drivers, you know how frustrating it can be. I have a 128MB Radeon 9800 Pro, not a kick-ass video card or anything nowadays, but certainly more than capable of pulling off anything Aero wanted to do. It can run FarCry at 1280x1024 with high detail, AA off admittedly, but no problems there. So there simply has to be a way to get it working. It's on the supported list for goodness sake!

There have been countless attempts to work around the issue, and believe me, I've tried them. You can install XP drivers (ATI or Omega) in XP Compatibility mode, and that goes some way towards addressing it - Vista will then load your drivers, and you'll get some hardware acceleration. But you won't get glass, since the DWM needs DirectX 10 drivers, and XP doesn't have any. As far as I understand, it never will either.

I tried the ATI Vista Beta drivers, the RTM drivers, fiddling with inf files and device IDs therein, trawling through the setupapi, setupact and setuperr logs in %systemroot%, flashing the BIOS on my card, who knows what, and still no glass. Still Code 43 in device manager.

Then there was a suggestion it was the motherboard, I had a MSI 746F Ultra at the time (yeah,yeah, check out granddad with his Socket A), which sports a SiS 746 chipset. Never had any problems with it, but it had to be worth a go looking around for GART drivers or whatever they're called. Nothing.

So I went and bought the cheapest new mainboard I could find that supported AGP, and bingo, it worked straight away! £40 for the board, £30 for a 512MB stick of DDR, has to be the cheapest new PC I've ever bought ;).

Since I built the pc for around the £300 mark 18 months ago I don't think £70 is a bad investment to make it "Vista Ready"

And that's why I don't touch macs.

Wednesday 17 January 2007

Copying folder contents with BCOPY through WebDAV


I'm working on an Exchange project at the moment, and have chosen to use WebDAV for the operations required. One of the subsidiary requirements is to copy contacts from one folder on a mailbox to another, then synchronise those contacts with a public folder on the Exchange server too. I discovered the WebDAV BCOPY method, which allows you to copy a whole load of items from one folder to another. Perfect! It works like this.

I make a WebDAV SEARCH request to the exchange server like so


<?xml version="1.0" ?>
<D:searchrequest xmlns:D="DAV:">
  <D:sql>
    select "DAV:href","DAV:contentclass"
    FROM SCOPE ('SHALLOW TRAVERSAL OF "/exchange/<mailbox>/Contacts"')
    WHERE "DAV:ishidden" = false
  </D:sql>
</D:searchrequest>


it returns a result set like this:


<?xml version="1.0" encoding="utf-16"?>
<a:multistatus xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/" xmlns:c="xml:" xmlns:a="DAV:">
  <a:response>
    <a:href>http://<exchsrvr>/exchange/<mailbox>/Contacts/BobLog.EML</a:href>
        <a:propstat>
          <a:status>HTTP/1.1 200 OK</a:status>
          <a:prop>
            <a:href>http://<exchsrvr>/exchange/<mailbox>/Contacts/BobLog.EML</a:href>
            <a:contentclass>urn:content-classes:person</a:contentclass>
          </a:prop>
        </a:propstat>
      </a:response>
      <a:response>
        <a:href>...


and so on.

then you iterate through your <a:response>s, extract the hrefs and build this request


<?xml version="1.0" ?>
<D:copy xmlns:D="DAV:">
  <D:target>
    <D:href>http://<exchsrvr>/exchange/<mailbox>/Contacts/BobLog.EML</D:href>
    <D:href>http://<exchsrvr>/exchange/<mailbox>/Contacts/JudahBauer.EML</D:href>
    ... etc
  </D:target>
</D:copy>


add an Http header called Destination, with the value of the destination folder, then fire it off as a BCOPY command. Bingo, all your specified contacts have been copied, with changes from the source overwriting the destination object.

It's a bit long winded though. Not to mention the hassle of removing old entries. Anyway, it worked. So I kept experimenting, and tried adding a subfolder to the items collection to see what would happen if I tried to copy it. And whaddyaknow, it only bloomin created the destination folder, and all the contacts in it!

!!BRAIN WAVE!!

That means the entire operation can be condensed into this:


<?xml version="1.0" ?>
<D:copy xmlns:D="DAV:">
  <D:target>
    <D:href>http://<exchsrvr>/exchange/<mailbox>/Contacts</D:href>
    <D:dest>http://<exchsrvr>/exchange/<mailbox>/ContactsCopy</D:dest>
  </D:target>
</D:copy>


fired off at the mailbox root. And it cascades item deletes and everything!

Laaaaahvley!

Tuesday 16 January 2007

Get with the program


Blogs.. I've never wanted one, it all seems too.... narcissistic. But it keeps coming back to haunt me that if you're not doing it, well you weren't there... Had one a while back, server crashed.. all seemed like a divine message - The world really doesn't want to hear my thoughts. But you know how it is, sometimes you just gotta tell people something.

So I gotta "Get with the program" again.

Just so you know - in case it wasn't clear, I'm yet another Microsoft coder. But I do bigger picture stuff too. You can come back here for whatever tidbits I've found out today. Hell you can even subscribe if you want, but you'd be a glutton for punishment if you do. I rant a lot, I talk crap a lot, and I'm frequently wrong (even if I won't admit it). But then again that's your choice. Don't say I didn't warn you.

So, with all that out of the way, let me get around to sharing something I just found out. Which is why I set this thing up in the first place.