Monday, December 20, 2004

theSpoke - Learned more about Windows and the Win32 API this week than ever...

theSpoke - Learned more about Windows and the Win32 API this week than ever...

"... porting one of my projects from Linux to Windows in order to test and compare (and also market on both platforms once we finish commercialization!) but in order to do so I had to learn a lot about the Win32 API...and I'm talking some intense stuff, like Access Control Entries (ACE), Desktop API, Windows Services, default system policies and how to programmatically change them, differences in API behavior between Win XP and Server 2003, Discretionary Access Control Lists (DACL), impersonating another user in order add some ACE's to the DACL, accessing logon SID, using .NET Interop in order to import a Win32 dll and API functions into my C# project, all the different variants of .NET Remoting, and a bunch of other arcane things.
...

Basically for one of the parts of my app, I wanted to remotely launch processes that would display on the user's desktop. Sounds easy, right? Not really. I originally was using MPICH for windows, which is traditionally used for things such as parallel processing on clusters or super computers, however the windows version is less than satisfactory, somewhat buggy, and it wouldn't display my gui elements remotely. It would launch the process, yes, and could do non-GUI/console stuff fine, but I eventually figured out that the security mechanisms of Windows didn't allow it to do what I wanted, for good reasons. But I'm going to be working in a trusted environment, and I need to do that. So it took some research.

Plus I wanted to use the .NET platform, which has further security restrictions and other hurdles. In the end it will pay off though.

The final solution was 80% C#, 15% C++, 10% chewing gum in the middle, and about 25% caffine. That adds up to 130%, which about matches up with the 55 hours I put in to accomplish it.
..."


There's some interesting information in this post. I've done a Proof of Concept for something a little like this. The info here goes beyond my PoC and covers a number of problems/solutions with a good bit of detail.

(via MSDN Student Flash - Ever wanted to port an app from Linux to Windows (.NET)?)

No comments: