Tuesday, June 24, 2008

Ended runners-up!! A good start.

Not bad! not bad at all, is what i will say for the result of the Infy tournament just ended.
My team ended up being the runners up!
As for me, I played some amazing tennis(my standards :)) against a really great oponent, guy was a senior national player. So i knew i dont stand a chance, so just went ahead and enjoyed playing, no fear, just hit my shots and was able to streach him in the first set till the last stages loosing 5-7.

But more than the game, the things i enjoyed most was meeting soo many good players, now friends...learnt a lot from them.....

Hope to continue ...the good start.

Sunday, June 22, 2008

Played bad today :(

Gosh! Today i played in a tennis tournament after a very long gap, actually dont even remeber when did I last played, i think it was in my school days..

Its a totally different ball-game when you play in a tournament, but i am glad atleast i have started again .

When match started i felt the net was high :) :) funny ...then i was not moving well legs had gone heavy this happened for first few games :) happens i know..but my backhand ditched me totally, played too defensive....... but fought till end....
Never mind its over.

But the good news is that, we(my team) won, it is davis cup style team tournament...fellow players played an amazing doubles and a remarkable reverse singles....so we are in semi-finals...most probably i will be playing tommorow as well...:)

Lets c if my nervousness goes away......................................................................

Thursday, June 12, 2008

PInvoke DhcpGetServerBindingInfo / DhcpSetServerBindingInfo C# ulong gotcha

Phew!! there is a thing always to remember while pinvoking. ulong is 64bit in c# while 32 bit in win32 world. Learned it hard way .. :)..
The error that you will get if you try to pinvoke if "null reference" .
Here is the signature and code snippet to be used.

[DllImport("dhcpsapi.dll", SetLastError = true, CharSet = CharSet.Unicode)]
public static extern uint DhcpGetServerBindingInfo(
[MarshalAs(UnmanagedType.LPWStr)]
string ServerIpAddress,
uint Flags,
out IntPtr BindElementsInfo);

[DllImport("dhcpsapi.dll", SetLastError = true, CharSet = CharSet.Unicode)]
public static extern uint DhcpSetServerBindingInfo(
[MarshalAs(UnmanagedType.LPWStr)]
string ServerIpAddress,
uint Flags,
IntPtr BindElementsInfo);


How to call:
IntPtr intptrBindElemArray = new IntPtr();
UInt32 ret;
ret = DhcpGetServerBindingInfo(localIP,
0,
out intptrBindElemArray);
if (ret != 0)
{
int code = 0;
code = (int)ret;
Win32Exception winex = new Win32Exception(code);
handleDHCPError(winex.NativeErrorCode + " : " + winex.Message);
}

Simple right.
Just that searched the hell lot but nobody in the world did it before ... :).