Converting C++ types to C#

This is not meant to be a complete list of C++/C# types. It merely contains the types I come across as I implement the pinvoke calls for DbhHelp and CorDebug.

Integer Types

C++ Description C#
bool bool
DWORD 32-bit unsigned integer uint
DWORD 32-bit unsigned integer uint
LONG 32-bit signed integer int
UCHAR 8-bit unsigned integer byte
UINT 32-bit unsigned integer. uint
ULONG 32-bit unsigned integer uint
ULONG32 32-bit unsigned integer UInt32
ULONG64 64-bit unsigned integer UInt64
USHORT 16-bit unsigned integer ushort
WORD 16-bit unsigned integer ushort

System Types

C++ Description C#
HANDLE IntPtr or SafeHandle
LPVOID IntPtr
PVOID IntPtr
SIZE_T __int32 in a 32-bit translation and execution environment, or an __int64 in a 64-bit translation and execution environment. IntPtr

DbhHelp Types

C++ Type Description C# Type
RVA DWORD uint
RVA64 ULONG64 UInt64
Advertisements

2 Responses to Converting C++ types to C#

  1. Pingback: Minidump Explorer v0.2: Reading minidump MemoryListStream and Memory64ListStream | Greg's Blog

  2. Pingback: Minidump Explorer v0.2: Reading minidump ThreadListStream | Greg's Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s