¡@

Home 

c# Programming Glossary: marshal.sizeof

How do you get total amount of RAM the computer has?

http://stackoverflow.com/questions/105031/how-do-you-get-total-amount-of-ram-the-computer-has

public MEMORYSTATUSEX this.dwLength uint Marshal.SizeOf typeof NativeMethods.MEMORYSTATUSEX return MarshalAs UnmanagedType.Bool..

How do I access ARP-protocol information through .NET?

http://stackoverflow.com/questions/1148778/how-do-i-access-arp-protocol-information-through-net

the int. IntPtr currentBuffer new IntPtr buffer.ToInt64 Marshal.SizeOf typeof int Allocate an array of entries. MIB_IPNETROW table.. new IntPtr currentBuffer.ToInt64 index Marshal.SizeOf typeof MIB_IPNETROW typeof MIB_IPNETROW for int index 0 index..

How do you retrieve a list of logged-in/connected users in .NET?

http://stackoverflow.com/questions/132620/how-do-you-retrieve-a-list-of-logged-in-connected-users-in-net

0 1 ref SessionInfoPtr ref sessionCount Int32 dataSize Marshal.SizeOf typeof WTS_SESSION_INFO Int32 currentSession int SessionInfoPtr..

Win32 API function to programmatically enable/disable device

http://stackoverflow.com/questions/1438371/win32-api-function-to-programmatically-enable-disable-device

DeviceInfoData did new DeviceInfoData int didSize Marshal.SizeOf did did.Size didSize int index 0 while NativeMethods.SetupDiEnumDeviceInfo.. handle ref diData ref @params Marshal.SizeOf @params if result false throw new Win32Exception result NativeMethods.SetupDiCallClassInstaller..

Getting the size of a field in bytes with C#

http://stackoverflow.com/questions/207592/getting-the-size-of-a-field-in-bytes-with-c-sharp

to a variable of that type within another type. Next Marshal.SizeOf this only shows the unmanaged size after marshalling not the..

Reading a C/C++ data structure in C# from a byte array

http://stackoverflow.com/questions/2871/reading-a-c-c-data-structure-in-c-sharp-from-a-byte-array

of clunky. GCHandle handle NewStuff MyStuff int BufferSize Marshal.SizeOf typeof NewStuff byte buff new byte BufferSize Array.Copy SomeByteArray..

Changing master volume level

http://stackoverflow.com/questions/294292/changing-master-volume-level

mlc new MIXERLINECONTROLS mxl.cbStruct uint Marshal.SizeOf typeof MIXERLINE mlc.cbStruct uint Marshal.SizeOf typeof MIXERLINECONTROLS.. uint Marshal.SizeOf typeof MIXERLINE mlc.cbStruct uint Marshal.SizeOf typeof MIXERLINECONTROLS mixerGetLineInfo IntPtr.Zero ref mxl.. mxl.dwLineID mlc.cControls mxl.cControls mlc.cbmxctrl uint Marshal.SizeOf typeof MIXERCONTROL mlc.pamxctrl Marshal.AllocHGlobal int mlc.cbmxctrl..

Kill child process when parent process is killed

http://stackoverflow.com/questions/3342941/kill-child-process-when-parent-process-is-killed

extendedInfo.BasicLimitInformation info int length Marshal.SizeOf typeof JOBOBJECT_EXTENDED_LIMIT_INFORMATION IntPtr extendedInfoPtr..

Using C#, how does one figure out what process locked a file?

http://stackoverflow.com/questions/860656/using-c-how-does-one-figure-out-what-process-locked-a-file

return null IntPtr ipBasic Marshal.AllocHGlobal Marshal.SizeOf objBasic Win32API.NtQueryObject ipHandle int Win32API.ObjectInformationClass.ObjectBasicInformation.. ipBasic Marshal.SizeOf objBasic ref nLength objBasic Win32API.OBJECT_BASIC_INFORMATION.. shHandle.GetType ipHandle new IntPtr ipHandle.ToInt64 Marshal.SizeOf shHandle 8 else ipHandle new IntPtr ipHandle.ToInt64 Marshal.SizeOf..