Announcement

All important changes of my site and my blog will be announced here.

Computer security

This is my hobby. I spend my freetime for it. I am not professional in this area. But I like it very much.

Everything Else

Which doesn’t belong to other categories will land here. It maybe about my daily life, entertainment, music, game … or something like that

Programming

This is my job. That means everyday I must sit before the monitor. Tip something, be annoyed by bugs,… but I simply like it.

Tutorial

When I found something interesting, I would like to share it to everyone. That is the reason for this category comes.

Home » Archive by Tags

Articles tagged with: 64 bit

C# – Get all files being accessed by a process in 64 bits
Tuesday, 25 May, 2010 – 0:00 | 9 Comments

Today I would like to end my series working with some system APIs which should run on 64 bits operating system. This last post in this series will discuss how we get all files being accessed by a given process. For example, if I would like to find out which files Yahoo Messenger are accessing, I can use this code snippet as following

static void Main(string[] args)
{
string strTemp = "";
m_pTarget = Process.GetProcessesByName("YahooMessenger")[0];
m_ipProcessHwnd = Win32API.OpenProcess(Win32API.ProcessAccessFlags.DupHandle, false, m_pTarget.Id);
List<Win32API.SYSTEM_HANDLE_INFORMATION> …

C# – Get all handles of a given process in 64 bits
Saturday, 22 May, 2010 – 0:00 | One Comment

I am trying to convert some code snippet in C++ to C# which should run on 64 bit operating system. I would like to share it to you so that if you need you can use it immediately without losing time to implement yourself. Today I would like to introduce a code snippet which return all handles of a given process and can run on 64 bits operating system. The core API of this code …

C# – Get object type number in Windows 64 bits
Wednesday, 19 May, 2010 – 0:00 | No Comment

I am trying to port some C++ code into C# which then should run on a 64 bits operating system. It’s not easy for me to do that because all of functions which I need, are relevant to system API with little documentations and examples because only system programmers works with these API. The fact that it may be simple when implementing on OS 32 bits. However on OS 64 bits there are difference at …

C# – How to determine processor 64 bit or 32 bit?
Monday, 4 Jan, 2010 – 0:00 | One Comment

There are a lot of ways to find out which type of processor of your computer. Is it a 64 bit or 32 bit type? I would like to enumerate some methods which I know. You can use what you want.
1. Using environment variable

string strProcArchi = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE");
if (strProcArchi.IndexOf("64") > 0)
{
Console.WriteLine("Processor 64 bit");
}
else
{
Console.WriteLine("Processor 32 bit");
}

2. Using size of IntPtr (recommended)

if ( Marshal.SizeOf(typeof(IntPtr)) == 8 )
{
Console.WriteLine("Processor 64 bit");
}
else
{
Console.WriteLine("Processor 32 bit");
}

3. Using WMI

ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT …