Wednesday, February 14, 2007

Mercury

There is no messenger service in Vista, and I cannot get notifications from the SVN server by "net send". So I use the HTTP Server API in Vista to build a lightweight message delivery service called "Mercury" for receiving notifications (by cURL, for example) and popping up message boxes. It's quite simple, only about 150 lines C++ code. Here are some notes.

1. ATL is of great help for building Windows services.

2. The model of HTTP Server API 2.0 is more flexible, which requires binding handles to URL groups. Notably, HttpAddUrlToUrlGroup returns the error "access is denied" when running as a basic user.

4. I/O cancellation in Vista simplifies the development of asynchronous programs. I've successfully used CancelIoEx to cancel blocking HttpReceiveHttpRequest in another thread; However, CancelSynchronousIo does not work. I'm still trying to figure out why.

4. Services in Vista are running in a separate session so that MessageBox has no effect for user sessions; use WTSSendMessage instead for notifications.

5. The security model in Vista is interesting and sometimes a little boring; set the appropriate privilege level when registering services or attaching processes in Visual Studio.

No comments: