Articles tagged with: 64 bit
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> …
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 …
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 …
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 …
