Inside and Out...

An attempt to understand technology better...

  Home  |   Contact  |   Syndication    |   Login
  160 Posts | 0 Stories | 12 Comments | 181 Trackbacks

News


WinToolZone - Spelunking Microsoft Technologies
I work as a developer on the Common Language Runtime (CLR) team, specifically in the areas of exception handling and CLR hosting.
Disclaimer

The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion. All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Twitter





Tag Cloud


Archives

Post Categories

Image Galleries

Links

Thursday, January 05, 2006 #

[Original Post Date: 4th January 2005]
 
I stumbled on this post by Matt, which is an excellent article that describes how to author a single service that can be consumed by client of .NET Remoting, WCF and ASMX.
 
Must Read.

[Original Post Date: 2nd January 2005]
 
With WCF, state management in services get more capabilities than just Singleton and PerCall approaches. Two new modes have been introduced that take state management to the next level. PerSession and Shareable modes allow for private sessions and shared sessions across specific clients respectively.
 
I have authored the article, Sharing State across Clients in Windows Communication Foundation, which attempts to help understand these modes of state management with complete source code to illustrate their behavior and potential usage. You can read the article and download the related source code from here.
 
Note: Source code has been written against and tried with WinFX November 2005 CTP.

[Original Post Date: 26th December 2005]

I have updated the WinFX Beta 1 based WCF Tour India demos for WinFX November 2005 CTP. You can download them from here.


[Original Post Date: 26th December 2005]

Download it from here.


[Original Post Date: 18th December 2005]
 
Service orientation is a concept and a way of thinking on how to design distributed systems. Technologies like Windows Communication Foundation implement these concepts and make them real. In order to understand the power of such technologies, its imperative we understand SO.
 
I have attempted to help understand this abstract concept in an article titled Service Orientation and Home Delivery of Pizza that you can read here.

[Original Post Date: 6th December 2005]

 

AutoReply for PocketPC 5.0 is a Windows Mobile 5.0 based application that will automatically send a SMS to the caller when you are unable to answer their phone call for some reason.

 

This saves you from manually sending a SMS when you get a missed call. Instead, simply set a pre-defined message and activate the application. Any calls that you miss (or not answer) from that point on will be automatically sent a SMS with the message that you set.

 

This application is an exemplification of the new State Notification and Broker system that has been introduced in Windows Mobile 5.0.

To download, visit http://www.wintoolzone.com/showpage.aspx?url=dotnet.aspx


[Original Post Date: 23rd November 2005]
 
I just concluded the Windows Communication Foundation (WCF) India Tour after two weeks in 4 cities. Download:
  • Presentations from here
  • Demos (based upon Indigo Beta 1 and VS 2005 Beta 2) from here

[Original Post Date: 21st November 2005]
 
The WinFX November CTP has been released and it works with VS 2005 RTM release. Download the various components:
 

The ReadMe for November CTP is here.


[Original Post Date: 9th November 2005]
 
Windows Communication Foundation, formerly codenamed Indigo, is the future of Microsoft distributed computing platform. And to take it to the next level in India, we are having Windows Communication Foundation (WCF) Tour across the month of November. The dates are as below:
 
City
Date
Bangalore
10th November
Pune
15th November
Chennai
17th November
Hyderabad
22nd November
 
In this tour, we will enable the attendee to understand WCF, its relation with service orientation and Microsoft's distributed communication platform commitment and its roadmap. It will help understand the technology better, its interoperability aspects and also understand the best practices to be undertaken today for a smoother migration from existing technologies (ASMX, Remoting, ES, MSMQ) to WCF.

For more details and registration, visit
http://www.microsoft.com/india/msdn/events/.

[Original Post Date: 17th October 2005]
 
Below are the presentations for the sessions delivered at TechED Sri Lanka:

[Original Post Date: 14th October 2005]
 
Technology Roadshows, which have been on for almost a month across India, have been very successful. I have been speaking in the Developer Track on Building Performant Applications using .NET Framework 2.0 and Debugging Techniques for .NET Framework 2.0 and VS 2005.
 
You can download the presentations and demos from http://www.microsoft.com/india/msdn/events/presentations.aspx#sept05

[Original Post Date: 9th October 2005]

TechED Sri Lanka is on from 12th October to 14th October. And I am off to present there - primarily on Windows Mobile and Developer Tracks. Check the agenda here.


[Original Post Date: 9th October 2005]
 
I just finished implementing WIVisualizer, a WindowsIdentity debugger visualizer for Visual Studio 2005. It displays important details like:

    1. Username
    2. Authentication type
    3. Impersonation Level
    4. Account type - System or Guest
    5. Anonymous or Authenticated identity
    6. Windows groups the identity is member of
 
Here's a screen-shot for the same:
 
 
It has been built using the Visual Studio 2005 Release Candidate and can be downloaded from here. To install, simply copy the DLL file to <Visual Studio 2005 Installation Folder>\Common7\Packages\Debugger\Visualizers folder.

[Original Post Date: 26th September 2005]
 
Few weeks back, I had written ShareContacts - an application for Windows Mobile 5.0 based PocketPC that could be used to share contacts, using the vCard format, with other devices.
 
Since it was done using .NET Compact Framework 2.0, and also used some APIs specific to Windows Mobile 5.0, I decided to work upon it and get the (almost) same functionality to Windows Mobile 2003 platform.
 
The result is vCardCE10 - class library that allows you to set few properties and generate a vCard that can be sent as a SMS to share contacts with other devices. All done as per RFC 2426. vCardCE10 is built using .NET Compact Framework 1.0 and is targeted for PocketPC 2003 and SmartPhone 2003 platforms.  It comes with complete documentation and can be downloaded from http://www.wintoolzone.com/showpage.aspx?url=dotnet.aspx
 
Usage is as simple as the snippet shown below:
 
vCardCE objVCard = new vCardCE();
objVCard.Title = "Mr.";
objVCard.FirstName = "Gaurav";
objVCard.LastName = "Khanna";
objVCard.WorkPhone = "+911234567890";
string strVCard = objVCard.GenerateVCard(); // send this via SMS to share contact details

[Original Post Date: 25th September 2005]

 

I am currently on the Technology Roadshow across 6 six cities in India, where I am talking about Building performant applications and Debugging Techniques for .NET Framework 2.0.

 

One of the things the developers here are amazed at are the DataTips that have been introduced with VS 2005, and also with Visualizers. Infact, when I demonstrate the DataSet Visualizer that ships with VS 2005, you can hear the WOW! of the audience :)

 

In the same session, we then go about building a visualizer for the Image class. For those interested, you can download the VS 2005 Beta 2 source code for the same from http://www.wintoolzone.com/showpage.aspx?url=dotnet.aspx. To activate the visualizer, build the DLL assembly and copy it to <ProgramFiles Folder comes here>\<VisualStudio Installation Folder comes here>\Common7\Packages\Debugger\Visualizers folder.


[Original Post Date: 18th September 2005]
 
Starting from 20th of September, Technology Roadshow starts in India. We are going to 6 different cities and doing two complete days of technical sessions across a breadth of technologies: for developers, IT professionals, Windows Mobile and Tablet PC developers and Architects. Below are the dates for the same:
 
City
Day 1
Day 2
Mumbai
20th Sep
21st Sep
Pune
22nd Sep
23rd Sep
Chennai
27th Sep
28th Sep
Hyderabad
30th Sep
1st Oct
New Delhi
4th Oct
5th Oct
Bangalore
18th Oct
19th Oct
 
I would be delivering session on Day 1 and Day 2. On Day 1, I am talking about How to build performant applications using .NET Framework, followed by the session on Debugging Techniques for .NET Framework 2.0.
 
On Day 2, we have sessions on SQL Mobile 2005 andIntroduction to development using Tablet PC.
 
For more details on developer sessions, visit http://www.microsoft.com/india/msdn/events/ and for MED/Tablet session, visit http://www.microsoft.com/india/msdn/events/med.aspx.
 
To register, visit http://www.microsoft.com/india/events/audience.aspx?filter=20001

[Original Post Date: 5th September 2005]
 
Share Source CLI, better known as Rotor, is one of the best ways to understand how .NET Framework works. And with the source code availability as part of Rotor distribution, its an excellent academic/hobby interest - you can extend it by adding more functionality, or modify the existing one and see how it behaves.
Yesterday, I went about doing the same. One of the functionality which I found missing in Rotor is that of enumerating system process list. .NET Framework's System.Diagnostics.Process class has methods, like GetProcesses, that allow you to do the same.
 
So, I went about implementing GetProcesses method overloadsin System.Diagnostics.Process class that allow me to enumerate process list on the local machine only. This required modification in the Platform Adaptation Layer (PAL) of Rotor. Since, I just have it running on Win32 for the moment, I modified the Win32 PAL to implement the support via ToolHelp API. Now, on a Windows system, its possible to enumerate the system process list using Rotor, as exemplified by the snippet below:

using System;
using System.Diagnostics;
publicclass EnumProcess
{
publicstaticvoid Main()
{
Process[] arrProcess = Process.GetProcesses();
if (arrProcess == null)
{
Console.WriteLine("Unable to get process list!");
return;
}
Console.WriteLine("{0} processes enumerated.",arrProcess.Length);
foreach (Process proc in arrProcess)
Console.WriteLine("Process ID {0}, Handle: {1}", proc.Id, proc.Handle);
}
}
 
You can download the updated source files for Rotor v1.0 from http://www.wintoolzone.com/showpage.aspx?url=rotor.aspx. The zipped archive contains Changes for Process Enumeration.txt that indicates where the updated files need to be copied. Once done, rebuild Rotor to get the changes into effect.

[Original Post Date: 28th August 2005]
 
One of the features I miss in PocketPC is that of sharing contact details with other people without requiring to beam them off Bluetooth - basically meaning sending the data as a message to the recipient in question. A lot of other devices support such a functionality and I have had more than one occasion when I wished that such a feature was present in PocketPC device.
 
This lead me to explore on how to implement such a functionality and that too, in a standardized manner. This resulted me in looking up RFC 2426 (the spec. can be read here) -the vCard specification that allows us to share such information.
 
Soon, I was implementing a class library, vCardCE, for Windows Mobile 5.0 based PocketPC that allowed you to create a RFC 2426 compliant vCard:
  1. by setting few properties of the class, or
  2. by generating it from POOM Contact object - based out of Windows Mobile 5.0.

vCardCE currently supports the following attributes of RFC 2426:

  • Firstname
  • Middlename
  • Lastname
  • Home Address
  • Work Address
  • Title
  • Email Address
  • Photo (pointed via URL)
  • Website Address
 
The generated vCard is v3.0 compliant.
 
Next, I wrote an application to share my contacts as vCard using vCardCE and came up with ShareContacts for PocketPC :
 
 
 
Tried and tested it with phones that understand vCard - and it works great to share contacts :)
 
You can download it from http://www.wintoolzone.com/showpage.aspx?url=dotnet.aspx. It requires Windows Mobile 5.0 based Pocket PC and .NET Compact Framework 2.0.

[Original Post Date: 22nd August 2005]
 
Over the past weekend, I have been working a lot on Sudoku, the number game that has been catching up in India a lot. I started off with implementing a Sudoku solver (which, btw, is partially done - it can calculate all the optimized potential values for a given box in the 9x9 grid) and today, finished off with an implementation of a Sudoku generator, PlaySudoku - a Windows based application using which you can play the game:
 
PlaySudoku UI
 
The game is free for download from http://www.wintoolzone.com/showpage.aspx?url=dotnet.aspx and based upon .NET Framework 2.0 Beta 2. If you don't have Beta 2, you can download it from http://go.microsoft.com/fwlink/?LinkId=44381.
 
PlaySudoku features 4 different levels of play (easy, medium, intermediate and advanced) and can even provide you with hints if you positioned the number correctly or not (Green signifies correct position and Red signifies incorrect):
 
Using hints in PlaySudoku
 
Download and enjoy the game :) It comes with a setup that will put up a folder in your Start menu.

[Original Post Date: 16th August 2005]
 
System.Diagnostics.Process class is a managed wrap over a subset of the ToolHelp API - as it enumerates only the process list. Not only that, it will list all the running processes, irrespective of whether they are running unmanaged code or running managed code. What if you wish to identify which of these processes are running managed code?
Unfortunately, neither the ToolHelp API, nor the Process class allow us to identify managed processes from the list they provide us. However, if you have noticed while debugging using Visual Studio, the debugger does identify a managed process in such a list:
 
VS debugger showing processes running managed code
 
So, how does the VS debugger do it?
Well, the CLR exposes debugging interfaces, which contain this functionality. These interfaces include ICorPublish, ICorPublishProcess, ICorPublishAppDomain, just to name a few. Infact, if you have installed the .NET Framework 2.0 SDK and navigate to the %SDKRoot%\v2.0\include folder, you will see the relevant header files that contain these interface definitions
The same identification can now also be done using managed code. Under %SDKRoot%\v2.0\bin folder, you will find, amongst others, MdbgCore.dll - the core of the managed debugger. If you ILASM this file (yes, its an assembly), you will see the managed wraps of the unmanaged interfaces mentioned above:
 
Managed wraps of the unmanaged interfaces
 
The starting point is Microsoft.Samples.Debugging.CorPublish.CorPublish. This lets us enumerate the managed processes, returning an instance of Microsoft.Samples.Debugging.CorPublish.CorPublishProcess type. Below is a sample that exemplifies doing the same:
 
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Samples.Debugging.MdbgEngine;
using Microsoft.Samples.Debugging.CorPublish;

namespace ManagedProcessList
{
class Program
{
static void Main(string[] args)
{
CorPublish pub = new CorPublish();
foreach (CorPublishProcess proc in pub.EnumProcesses())
{
Console.WriteLine("{0} IsManaged: {1}",proc.DisplayName, proc.IsManaged.ToString());
}
}
}
}