Desktop Functions: Smart Device Functions:
|
Search Results for "CreateToolhelp32Snapshot" in [All]EnumsIncludes the undocumented TH32CS value without which your call to CreateToolhelp32Snapshot may well fail with an "Out of memory" error (ERROR_NOT_ENOUGH_MEMORY = 8). kernel32
static extern IntPtr CreateToolhelp32Snapshot(SnapshotFlags dwFlags, uint th32ProcessID);
Private Shared Function CreateToolhelp32Snapshot(ByVal dwFlags As SnapshotFlags, ByVal th32ProcessID As UInteger) As IntPtr You may find that you when calling CreateToolhelp32Snapshot that you must specify SnapshotFlag.NoHeaps in addition to any other flags or you will get an invalid handle and an "Out of Memory" error (ERROR_NOT_ENOUGH_MEMORY = 0x8). This is a seemingly undocumented flag. See the bottom of the MSDN page http://msdn.microsoft.com/en-us/library/windows/desktop/ms682489(v=vs.85).aspx
static extern IntPtr CreateToolhelp32Snapshot([In]UInt32 dwFlags, [In]UInt32 th32ProcessID);
handleToSnapshot = CreateToolhelp32Snapshot((uint)SnapshotFlags.Process, 0);
IntPtr heaplist_h = CreateToolhelp32Snapshot( (uint)ToolHelp.SnapshotFlags.HeapList,
var snapshot = CreateToolhelp32Snapshot(SnapshotFlags.Module | SnapshotFlags.Module32, (uint)procIDDDDDDDDDDDDD); 6: Module32Next
var snapshot = CreateToolhelp32Snapshot(SnapshotFlags.Module | SnapshotFlags.Module32, (uint)procIDDDDDDDDDDDDD); |