Replaced all references to SECURITY_ATTRIBUTES class with direct calls. Classes are already passed by reference.

pull/10/head
David Hall 2018-08-13 15:05:37 -06:00
parent f844f6a8f2
commit 0bf090b5b3
10 changed files with 23 additions and 23 deletions

View File

@ -94,7 +94,7 @@ namespace Vanara.PInvoke
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms682409(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("WinBase.h", MSDNShortId = "ms682409")]
public static extern IntPtr CreateJobObject([In] ref SECURITY_ATTRIBUTES lpJobAttributes, [In] string lpName);
public static extern IntPtr CreateJobObject([In] SECURITY_ATTRIBUTES lpJobAttributes, [In] string lpName);
/// <summary>Frees memory that a function related to job objects allocated. Functions related to job objects that allocate memory include <c>QueryIoRateControlInformationJobObject</c>.</summary>
/// <param name="Buffer">A pointer to the buffer of allocated memory that you want to free.</param>

View File

@ -633,7 +633,7 @@ namespace Vanara.PInvoke
// _In_ DWORD dwMaximumSizeLow, _In_opt_ LPCTSTR lpName);
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("WinBase.h", MSDNShortId = "aa366537")]
public static extern IntPtr CreateFileMapping([In] SafeFileHandle hFile, [In] ref SECURITY_ATTRIBUTES lpAttributes, MEM_PROTECTION flProtect,
public static extern IntPtr CreateFileMapping([In] SafeFileHandle hFile, [In] SECURITY_ATTRIBUTES lpAttributes, MEM_PROTECTION flProtect,
uint dwMaximumSizeHigh, uint dwMaximumSizeLow, [In] string lpName);
/// <summary>Creates or opens a named or unnamed file mapping object for a specified file from a Windows Store app.</summary>
@ -801,7 +801,7 @@ namespace Vanara.PInvoke
// MaximumSize, _In_opt_ PCWSTR Name);
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("MemoryApi.h", MSDNShortId = "hh994453")]
public static extern IntPtr CreateFileMappingFromApp([In] SafeFileHandle hFile, [In] ref SECURITY_ATTRIBUTES SecurityAttributes,
public static extern IntPtr CreateFileMappingFromApp([In] SafeFileHandle hFile, [In] SECURITY_ATTRIBUTES SecurityAttributes,
MEM_PROTECTION PageProtection, ulong MaximumSize, [In] string Name);
/// <summary>Creates or opens a named or unnamed file mapping object for a specified file and specifies the NUMA node for the physical memory.</summary>
@ -1009,7 +1009,7 @@ namespace Vanara.PInvoke
// dwMaximumSizeHigh, _In_ DWORD dwMaximumSizeLow, _In_opt_ LPCTSTR lpName, _In_ DWORD nndPreferred);
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("WinBase.h", MSDNShortId = "aa366539")]
public static extern IntPtr CreateFileMappingNuma([In] SafeFileHandle hFile, [In] ref SECURITY_ATTRIBUTES lpFileMappingAttributes, MEM_PROTECTION flProtect,
public static extern IntPtr CreateFileMappingNuma([In] SafeFileHandle hFile, [In] SECURITY_ATTRIBUTES lpFileMappingAttributes, MEM_PROTECTION flProtect,
uint dwMaximumSizeHigh, uint dwMaximumSizeLow, [In] string lpName, uint nndPreferred);
/// <summary>

View File

@ -66,7 +66,7 @@ namespace Vanara.PInvoke
// lpAliasPrefix); https://msdn.microsoft.com/en-us/library/windows/desktop/ms682419(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("WinBase.h", MSDNShortId = "ms682419")]
public static extern IntPtr CreatePrivateNamespace(ref SECURITY_ATTRIBUTES lpPrivateNamespaceAttributes, IntPtr lpBoundaryDescriptor, string lpAliasPrefix);
public static extern IntPtr CreatePrivateNamespace(SECURITY_ATTRIBUTES lpPrivateNamespaceAttributes, IntPtr lpBoundaryDescriptor, string lpAliasPrefix);
/// <summary>Deletes the specified boundary descriptor.</summary>
/// <param name="BoundaryDescriptor">A handle to the boundary descriptor. The <c>CreateBoundaryDescriptor</c> function returns this handle.</param>

View File

@ -413,7 +413,7 @@ namespace Vanara.PInvoke
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("Winbase.h", MSDNShortId = "aa365150")]
public static extern IntPtr CreateNamedPipe([In] string lpName, uint dwOpenMode, PIPE_TYPE dwPipeMode, uint nMaxInstances, uint nOutBufferSize, uint nInBufferSize,
uint nDefaultTimeOut, [In] ref SECURITY_ATTRIBUTES lpSecurityAttributes);
uint nDefaultTimeOut, [In] SECURITY_ATTRIBUTES lpSecurityAttributes);
/// <summary>Creates an anonymous pipe, and returns handles to the read and write ends of the pipe.</summary>
/// <param name="hReadPipe">A pointer to a variable that receives the read handle for the pipe.</param>
@ -440,7 +440,7 @@ namespace Vanara.PInvoke
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
[PInvokeData("Winbase.h", MSDNShortId = "aa365152")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool CreatePipe(out IntPtr hReadPipe, out IntPtr hWritePipe, [In] ref SECURITY_ATTRIBUTES lpPipeAttributes, uint nSize);
public static extern bool CreatePipe(out IntPtr hReadPipe, out IntPtr hWritePipe, [In] SECURITY_ATTRIBUTES lpPipeAttributes, uint nSize);
/// <summary>Disconnects the server end of a named pipe instance from a client process.</summary>
/// <param name="hNamedPipe">A handle to an instance of a named pipe. This handle must be created by the <c>CreateNamedPipe</c> function.</param>

View File

@ -1091,8 +1091,8 @@ namespace Vanara.PInvoke
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("WinBase.h", MSDNShortId = "ms682425")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool CreateProcess([In] string lpApplicationName, StringBuilder lpCommandLine, [In] ref SECURITY_ATTRIBUTES lpProcessAttributes,
[In] ref SECURITY_ATTRIBUTES lpThreadAttributes, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandles, CREATE_PROCESS dwCreationFlags, [In] IntPtr lpEnvironment,
public static extern bool CreateProcess([In] string lpApplicationName, StringBuilder lpCommandLine, [In] SECURITY_ATTRIBUTES lpProcessAttributes,
[In] SECURITY_ATTRIBUTES lpThreadAttributes, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandles, CREATE_PROCESS dwCreationFlags, [In] IntPtr lpEnvironment,
[In] string lpCurrentDirectory, [In] ref STARTUPINFO lpStartupInfo, out PROCESS_INFORMATION lpProcessInformation);
/// <summary>
@ -1277,7 +1277,7 @@ namespace Vanara.PInvoke
[PInvokeData("WinBase.h", MSDNShortId = "ms682429")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool CreateProcessAsUser(IntPtr hToken, string lpApplicationName, StringBuilder lpCommandLine,
ref SECURITY_ATTRIBUTES lpProcessAttributes, ref SECURITY_ATTRIBUTES lpThreadAttributes, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandles,
SECURITY_ATTRIBUTES lpProcessAttributes, SECURITY_ATTRIBUTES lpThreadAttributes, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandles,
CREATE_PROCESS dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, ref STARTUPINFO lpStartupInfo, out PROCESS_INFORMATION lpProcessInformation);
/// <summary>
@ -1355,7 +1355,7 @@ namespace Vanara.PInvoke
// LPTHREAD_START_ROUTINE lpStartAddress, _In_ LPVOID lpParameter, _In_ DWORD dwCreationFlags, _Out_ LPDWORD lpThreadId); https://msdn.microsoft.com/en-us/library/windows/desktop/ms682437(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
[PInvokeData("WinBase.h", MSDNShortId = "ms682437")]
public static extern IntPtr CreateRemoteThread([In] IntPtr hProcess, [In] ref SECURITY_ATTRIBUTES lpThreadAttributes, SizeT dwStackSize,
public static extern IntPtr CreateRemoteThread([In] IntPtr hProcess, [In] SECURITY_ATTRIBUTES lpThreadAttributes, SizeT dwStackSize,
PTHREAD_START_ROUTINE lpStartAddress, [In] IntPtr lpParameter, CREATE_THREAD_FLAGS dwCreationFlags, out uint lpThreadId);
/// <summary>
@ -1422,7 +1422,7 @@ namespace Vanara.PInvoke
// _Out_opt_ LPDWORD lpThreadId); https://msdn.microsoft.com/en-us/library/windows/desktop/dd405484(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
[PInvokeData("WinBase.h", MSDNShortId = "dd405484")]
public static extern void CreateRemoteThreadEx([In] IntPtr hProcess, [In] ref SECURITY_ATTRIBUTES lpThreadAttributes, SizeT dwStackSize,
public static extern void CreateRemoteThreadEx([In] IntPtr hProcess, [In] SECURITY_ATTRIBUTES lpThreadAttributes, SizeT dwStackSize,
PTHREAD_START_ROUTINE lpStartAddress, [In] IntPtr lpParameter, CREATE_THREAD_FLAGS dwCreationFlags, IntPtr lpAttributeList,
out uint lpThreadId);
@ -1491,7 +1491,7 @@ namespace Vanara.PInvoke
// _In_opt_ LPVOID lpParameter, _In_ DWORD dwCreationFlags, _Out_opt_ LPDWORD lpThreadId); https://msdn.microsoft.com/en-us/library/windows/desktop/ms682453(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
[PInvokeData("WinBase.h", MSDNShortId = "ms682453")]
public static extern IntPtr CreateThread([In] ref SECURITY_ATTRIBUTES lpThreadAttributes, SizeT dwStackSize, PTHREAD_START_ROUTINE lpStartAddress,
public static extern IntPtr CreateThread([In] SECURITY_ATTRIBUTES lpThreadAttributes, SizeT dwStackSize, PTHREAD_START_ROUTINE lpStartAddress,
[In] IntPtr lpParameter, CREATE_THREAD_FLAGS dwCreationFlags, out uint lpThreadId);
/// <summary>Deletes the specified list of attributes for process and thread creation.</summary>

View File

@ -252,7 +252,7 @@ namespace Vanara.PInvoke
// lpName); https://msdn.microsoft.com/en-us/library/windows/desktop/ms682396(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("WinBase.h", MSDNShortId = "ms682396")]
public static extern IntPtr CreateEvent([In] ref SECURITY_ATTRIBUTES lpEventAttributes, [MarshalAs(UnmanagedType.Bool)] bool bManualReset,
public static extern IntPtr CreateEvent([In] SECURITY_ATTRIBUTES lpEventAttributes, [MarshalAs(UnmanagedType.Bool)] bool bManualReset,
[MarshalAs(UnmanagedType.Bool)] bool bInitialState, [In] string lpName);
/// <summary>Creates or opens a named or unnamed event object and returns a handle to the object.</summary>
@ -317,7 +317,7 @@ namespace Vanara.PInvoke
// dwDesiredAccess); https://msdn.microsoft.com/en-us/library/windows/desktop/ms682400(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("WinBase.h", MSDNShortId = "ms682400")]
public static extern IntPtr CreateEventEx([In] ref SECURITY_ATTRIBUTES lpEventAttributes, [In] string lpName, CREATE_EVENT_FLAGS dwFlags, uint dwDesiredAccess);
public static extern IntPtr CreateEventEx([In] SECURITY_ATTRIBUTES lpEventAttributes, [In] string lpName, CREATE_EVENT_FLAGS dwFlags, uint dwDesiredAccess);
/// <summary>
/// <para>Creates or opens a named or unnamed mutex object.</para>
@ -367,7 +367,7 @@ namespace Vanara.PInvoke
// HANDLE WINAPI CreateMutex( _In_opt_ LPSECURITY_ATTRIBUTES lpMutexAttributes, _In_ BOOL bInitialOwner, _In_opt_ LPCTSTR lpName); https://msdn.microsoft.com/en-us/library/windows/desktop/ms682411(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("WinBase.h", MSDNShortId = "ms682411")]
public static extern IntPtr CreateMutex([In] ref SECURITY_ATTRIBUTES lpMutexAttributes, [MarshalAs(UnmanagedType.Bool)] bool bInitialOwner, string lpName);
public static extern IntPtr CreateMutex([In] SECURITY_ATTRIBUTES lpMutexAttributes, [MarshalAs(UnmanagedType.Bool)] bool bInitialOwner, string lpName);
/// <summary>Creates or opens a named or unnamed mutex object and returns a handle to the object.</summary>
/// <param name="lpMutexAttributes">
@ -475,7 +475,7 @@ namespace Vanara.PInvoke
// LPCTSTR lpName); https://msdn.microsoft.com/en-us/library/windows/desktop/ms682438(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("WinBase.h", MSDNShortId = "ms682438")]
public static extern IntPtr CreateSemaphore([In] ref SECURITY_ATTRIBUTES lpSemaphoreAttributes, int lInitialCount, int lMaximumCount, [In] string lpName);
public static extern IntPtr CreateSemaphore([In] SECURITY_ATTRIBUTES lpSemaphoreAttributes, int lInitialCount, int lMaximumCount, [In] string lpName);
/// <summary>Creates or opens a named or unnamed semaphore object and returns a handle to the object.</summary>
/// <param name="lpSemaphoreAttributes">
@ -573,7 +573,7 @@ namespace Vanara.PInvoke
// HANDLE WINAPI CreateWaitableTimer( _In_opt_ LPSECURITY_ATTRIBUTES lpTimerAttributes, _In_ BOOL bManualReset, _In_opt_ LPCTSTR lpTimerName); https://msdn.microsoft.com/en-us/library/windows/desktop/ms682492(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("WinBase.h", MSDNShortId = "ms682492")]
public static extern IntPtr CreateWaitableTimer([In] ref SECURITY_ATTRIBUTES lpTimerAttributes, [MarshalAs(UnmanagedType.Bool)] bool bManualReset, string lpTimerName);
public static extern IntPtr CreateWaitableTimer([In] SECURITY_ATTRIBUTES lpTimerAttributes, [MarshalAs(UnmanagedType.Bool)] bool bManualReset, string lpTimerName);
/// <summary>Creates or opens a waitable timer object and returns a handle to the object.</summary>
/// <param name="lpTimerAttributes">
@ -627,7 +627,7 @@ namespace Vanara.PInvoke
// dwDesiredAccess); https://msdn.microsoft.com/en-us/library/windows/desktop/ms682494(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("WinBase.h", MSDNShortId = "ms682494")]
public static extern IntPtr CreateWaitableTimerEx([In] ref SECURITY_ATTRIBUTES lpTimerAttributes, string lpTimerName, CREATE_WAITABLE_TIMER_FLAG dwFlags, uint dwDesiredAccess);
public static extern IntPtr CreateWaitableTimerEx([In] SECURITY_ATTRIBUTES lpTimerAttributes, string lpTimerName, CREATE_WAITABLE_TIMER_FLAG dwFlags, uint dwDesiredAccess);
/// <summary>Releases all resources used by an unowned critical section object.</summary>
/// <param name="lpCriticalSection">

View File

@ -645,7 +645,7 @@ namespace Vanara.PInvoke
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("WinBase.h", MSDNShortId = "aa363856")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool CreateDirectoryEx([In] string lpTemplateDirectory, [In] string lpNewDirectory, [In] ref SECURITY_ATTRIBUTES lpSecurityAttributes);
public static extern bool CreateDirectoryEx([In] string lpTemplateDirectory, [In] string lpNewDirectory, [In] SECURITY_ATTRIBUTES lpSecurityAttributes);
/// <summary>
/// Establishes a hard link between an existing file and a new file. This function is only supported on the NTFS file system, and only for files, not directories.

View File

@ -61,7 +61,7 @@ namespace Vanara.PInvoke
// lpSecurityAttributes); https://msdn.microsoft.com/en-us/library/windows/desktop/aa365147(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("Winbase.h", MSDNShortId = "aa365147")]
public static extern IntPtr CreateMailslot([In] string lpName, uint nMaxMessageSize, uint lReadTimeout, [In] ref SECURITY_ATTRIBUTES lpSecurityAttributes);
public static extern IntPtr CreateMailslot([In] string lpName, uint nMaxMessageSize, uint lReadTimeout, [In] SECURITY_ATTRIBUTES lpSecurityAttributes);
/// <summary>Retrieves information about the specified mailslot.</summary>
/// <param name="hMailslot">A handle to a mailslot. The <c>CreateMailslot</c> function must create this handle.</param>

View File

@ -5115,7 +5115,7 @@ namespace Vanara.PInvoke
// dwFlagsAndAttributes );
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
[PInvokeData("winbase.h", MSDNShortId = "caa757a2-fc3f-4883-8d3e-b98d28f92517")]
public static extern IntPtr OpenFileById(IntPtr hVolumeHint, IntPtr lpFileId, FileAccess dwDesiredAccess, FileShare dwShareMode, ref SECURITY_ATTRIBUTES lpSecurityAttributes, FileFlagsAndAttributes dwFlagsAndAttributes);
public static extern IntPtr OpenFileById(IntPtr hVolumeHint, IntPtr lpFileId, FileAccess dwDesiredAccess, FileShare dwShareMode, SECURITY_ATTRIBUTES lpSecurityAttributes, FileFlagsAndAttributes dwFlagsAndAttributes);
/// <summary>
/// <para>Decrements the count of power requests of the specified type for a power request object.</para>

View File

@ -433,7 +433,7 @@ namespace Vanara.PInvoke
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
[PInvokeData("Wincon.h", MSDNShortId = "")]
public static extern SafeFileHandle CreateConsoleScreenBuffer(ACCESS_MASK dwDesiredAccess, FileShare dwShareMode,
ref SECURITY_ATTRIBUTES lpSecurityAttributes, CONSOLE_TEXTMODE dwFlags = CONSOLE_TEXTMODE.CONSOLE_TEXTMODE_BUFFER, IntPtr lpScreenBufferData = default(IntPtr));
SECURITY_ATTRIBUTES lpSecurityAttributes, CONSOLE_TEXTMODE dwFlags = CONSOLE_TEXTMODE.CONSOLE_TEXTMODE_BUFFER, IntPtr lpScreenBufferData = default(IntPtr));
/// <summary>Sets the character attributes for a specified number of character cells, beginning at the specified coordinates in a screen buffer.</summary>
/// <param name="hConsoleOutput">