|
This Blog Has Been Moved !This Blog Has been moved to http://aleemkhan.wordpress.com It is really amazing how the .NET Framework has made the development tasks easier. The Framework Class Library is undoubtedly an extremely rich set of API’s. I wanted to dump the entire address space of any process. So, I thought of doing a small Dump Tool in the free time which I get occasionally in the evenings or on weekends. I’ll post the complete code when it’s complete. Anyway I wrote the following C++ code to get SeDebugPrivilige for a process. SeDebugPrivilige allows any process to access memory and other information of operating system processes which you do not have access to otherwise. BOOL CTaskManagerDlg::SetPrivilege() { HANDLE hToken; if(!OpenProcessToken(::GetCurrentProcess(), if(!LookupPrivilegeValue( NULL, SE_DEBUG_NAME, &luid )) AdjustTokenPrivileges(hToken,FALSE,&tp, tpPrevious.PrivilegeCount = 1; AdjustTokenPrivileges(hToken,FALSE, &tpPrevious,cbPrevious, CloseHandle(hToken); } This code has been taken mostly from the MSDN Article Article ID: Q131065 To do all this from C# you just need to call a simple function J System.Diagnostics.Process.EnterDebugMode(); Yes ! Its that easy. The Base Class Library is quite rich but you only have to find the things. However, I still could not find the equivalent of Functions from the native ToolHelp32 library defined in the Kernel32.dll. So, I have to write a complete PInvoke wrapper for that. I will post the complete code on the weekend. Can anyone tell me where to find .NET Equivalents of ToolHelp32 Functions ?
Today I bought a new System. Pentium-IV 3.0 GHz and 17" LG Flatron Monitor :). Now I have two systems on my desktop. A Linux machine and a Windows machine. I am really anxious for checking out the New Team Foundation Server that I have recently recieved. Microsoft is Sending a Free 4 DVD Pack containing the Visual Studio 2005 Beta, Team Foundation Server and SQL Server 2005 (YUKON) with another DVD with some learning material. You can register too From the MSDN Visual Studio Developer Center.
Just installing a few softwares. I usually have a lot of softwares on board... and I've to transfer 50 GB of data too .... so its gonna take the night today, but tomorrow is a Sunday anyway......
Brad Abrams Posted a small Equality Quiz
Its just 10 min but it was fun. Here are my answers (Try yoursellf first) public static void Question1() { int x = 10; long y = 10; Console.WriteLine(x==y && !x.Equals(y)); } public static void Question2() { object x = 10; object y = 10; Console.WriteLine(x!=y && x.Equals(y)); } public static void Question3() { object x = new object(); int y = 10; Console.WriteLine(x==y); } public static void Question4() { int x = 10; int y = 10; Console.WriteLine(x == y && (object)x!=(object)y); } Ok! I said I’ll be sharing some of the MS Interview experience. For the preparation of the interview we (with my other friends) searched various resources on the internet. I even purchased an e-book but it didn’t turn out to be helpful. Generally there are three types of questions in an MS Interview. Analytical/Puzzles, Algorithms/Coding and Personality. We collected various questions in these categories. Logical/Puzzles Questions Usually Asked at Microsoft
There is a good discussion available on MSDN with “Anders Hejlsberg”, the lead Architect of C# language. The discussion focuses on various new features in C# and their comparison with C++ and Java, like Generics in C#, Checked and Un-Checked exceptions and other topics. It’s a useful reading. http://msdn.microsoft.com/vcsharp/homepageheadlines/hejlsberg/ There is a small problem with System.Drawing.dll in VS.NET 2003. Sometimes you get an Arithmetic Exception and the program is terminated. If u get this "Arithmetic Exception" in System.Drawing.dll, then there must be some spy software or some virus installed on your system which has hooked the system and changed the FPU (FloatingPoint Unit value) for all the processes. To Set the FPU value to dafault u can use _controlfp() function defined in "msvcrt.dll". This is a native function, to call this function in C# u will have to use .NET Runtime Interop Services. To do this add the following lines of code to your Form class [DllImport("msvcrt.dll")] Now call this function at the start of your form constructor _controlfp(_MCW_EW, _EM_INVALID); The FPU value is now set to default and you will not get any Exception in system.Drawing.dll Ohh ! Finally my Blog is set. For the last one month I have been trying to setup my Blog. In the process I went through various Blogging Engines. I downloaded and setup Community Server on my local machine and explored it a little. It was interesting to know that MSDN Blogs is also using the Community Server. On this Blog I will be sharing my personal experiences/learning and all the stuff that I go through the internet. I’ll try to keep up with the posts, queries and comments. My prime focus these days is .NET Framework/C# and Longhorn, so I think I’ll be saying things about that. Recently, I had the experience of being interviewed by Microsoft. Though, I could not get through but reaching the final step, going on a sponsored trip to |