public static SafeLocalFree LocalAlloc(int cb) {
SafeLocalFree result = UnsafeNclNativeMethods.SafeNetHandles.LocalAlloc(LMEM_FIXED, (UIntPtr) cb);
if (result.IsInvalid) {
result.SetHandleAsInvalid();
throw new OutOfMemoryException();
}
return result;
}