Changed names of delegates where existing ALLCAP name was a reference to another name. Could be a breaking change.

pull/83/head
David Hall 2019-07-25 20:25:24 -06:00
parent 42630dd833
commit fa9ba9ff74
16 changed files with 88 additions and 219 deletions

View File

@ -14,7 +14,7 @@ namespace Vanara.PInvoke
/// this callback function. FlsCallback is a placeholder for the application-defined function name.
/// </summary>
/// <param name="lpFlsData">The value stored in the FLS slot for the calling fiber.</param>
public delegate void PFLS_CALLBACK_FUNCTION(IntPtr lpFlsData);
public delegate void FlsCallback(IntPtr lpFlsData);
/// <summary>
/// Allocates a fiber local storage (FLS) index. Any fiber in the process can subsequently use this index to store and retrieve
@ -31,7 +31,7 @@ namespace Vanara.PInvoke
// DWORD WINAPI FlsAlloc( _In_ PFLS_CALLBACK_FUNCTION lpCallback); https://msdn.microsoft.com/en-us/library/windows/desktop/ms682664(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
[PInvokeData("WinBase.h", MSDNShortId = "ms682664")]
public static extern uint FlsAlloc(PFLS_CALLBACK_FUNCTION lpCallback);
public static extern uint FlsAlloc(FlsCallback lpCallback);
/// <summary>Releases a fiber local storage (FLS) index, making it available for reuse.</summary>
/// <param name="dwFlsIndex">The FLS index that was allocated by the <c>FlsAlloc</c> function.</param>

View File

@ -11,7 +11,7 @@ namespace Vanara.PInvoke
/// memory pages are detected.
/// </summary>
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
public delegate void PBAD_MEMORY_CALLBACK_ROUTINE();
public delegate void BadMemoryCallbackRoutine();
/// <summary>Flags that indicate which of the file cache limits are enabled.</summary>
[PInvokeData("MemoryApi.h")]
@ -2296,7 +2296,7 @@ namespace Vanara.PInvoke
// PVOID WINAPI RegisterBadMemoryNotification( _In_ PBAD_MEMORY_CALLBACK_ROUTINE Callback);
[DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("WinBase.h", MSDNShortId = "hh691013")]
public static extern IntPtr RegisterBadMemoryNotification(PBAD_MEMORY_CALLBACK_ROUTINE Callback);
public static extern IntPtr RegisterBadMemoryNotification(BadMemoryCallbackRoutine Callback);
/// <summary>
/// <para>

View File

@ -136,7 +136,7 @@ namespace Vanara.PInvoke
[DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("rtlsupportapi.h", MSDNShortId = "63b35b17-0b0e-46ed-9dbf-98290ab08bd1")]
[return: MarshalAs(UnmanagedType.U1)]
public static extern bool RtlInstallFunctionTableCallback(ulong TableIdentifier, ulong BaseAddress, uint Length, PGET_RUNTIME_FUNCTION_CALLBACK Callback, IntPtr Context = default, [MarshalAs(UnmanagedType.LPWStr)] string OutOfProcessCallbackDll = null);
public static extern bool RtlInstallFunctionTableCallback(ulong TableIdentifier, ulong BaseAddress, uint Length, GetRuntimeFunctionCallback Callback, IntPtr Context = default, [MarshalAs(UnmanagedType.LPWStr)] string OutOfProcessCallbackDll = null);
/// <summary>Searches the active function tables for an entry that corresponds to the specified PC value.</summary>
/// <param name="ControlPc">The virtual address of an instruction bundle within the function.</param>

View File

@ -278,7 +278,7 @@ namespace Vanara.PInvoke
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("winbase.h", MSDNShortId = "118392de-166b-413e-99c9-b3deb756de0e")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool CopyFileTransacted(string lpExistingFileName, string lpNewFileName, LpprogressRoutine lpProgressRoutine, IntPtr lpData, [MarshalAs(UnmanagedType.Bool)] ref bool pbCancel, COPY_FILE dwCopyFlags, IntPtr hTransaction);
public static extern bool CopyFileTransacted(string lpExistingFileName, string lpNewFileName, CopyProgressRoutine lpProgressRoutine, IntPtr lpData, [MarshalAs(UnmanagedType.Bool)] ref bool pbCancel, COPY_FILE dwCopyFlags, IntPtr hTransaction);
/// <summary>
/// <para>
@ -2573,7 +2573,7 @@ namespace Vanara.PInvoke
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("winbase.h", MSDNShortId = "466d733b-30d2-4297-a0e6-77038f1a21d5")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool MoveFileTransacted(string lpExistingFileName, string lpNewFileName, LpprogressRoutine lpProgressRoutine, IntPtr lpData, MOVEFILE dwFlags, IntPtr hTransaction);
public static extern bool MoveFileTransacted(string lpExistingFileName, string lpNewFileName, CopyProgressRoutine lpProgressRoutine, IntPtr lpData, MOVEFILE dwFlags, IntPtr hTransaction);
/// <summary>
/// <para>

View File

@ -148,95 +148,6 @@ namespace Vanara.PInvoke
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
public delegate COPYFILE2_MESSAGE_ACTION CopyFile2ProgressRoutine(ref COPYFILE2_MESSAGE pMessage, IntPtr pvCallbackContext);
/// <summary>
/// An application-defined callback function used with the CopyFileEx, MoveFileTransacted, and MoveFileWithProgress functions. It is
/// called when a portion of a copy or move operation is completed. The <c>LPPROGRESS_ROUTINE</c> type defines a pointer to this
/// callback function. <c>CopyProgressRoutine</c> is a placeholder for the application-defined function name.
/// </summary>
/// <param name="TotalFileSize">
/// <para>The total size of the file, in bytes.</para>
/// </param>
/// <param name="TotalBytesTransferred">
/// <para>The total number of bytes transferred from the source file to the destination file since the copy operation began.</para>
/// </param>
/// <param name="StreamSize">
/// <para>The total size of the current file stream, in bytes.</para>
/// </param>
/// <param name="StreamBytesTransferred">
/// <para>
/// The total number of bytes in the current stream that have been transferred from the source file to the destination file since the
/// copy operation began.
/// </para>
/// </param>
/// <param name="dwStreamNumber">
/// <para>A handle to the current stream. The first time <c>CopyProgressRoutine</c> is called, the stream number is 1.</para>
/// </param>
/// <param name="dwCallbackReason">
/// <para>The reason that <c>CopyProgressRoutine</c> was called. This parameter can be one of the following values.</para>
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>CALLBACK_CHUNK_FINISHED 0x00000000</term>
/// <term>Another part of the data file was copied.</term>
/// </item>
/// <item>
/// <term>CALLBACK_STREAM_SWITCH 0x00000001</term>
/// <term>
/// Another stream was created and is about to be copied. This is the callback reason given when the callback routine is first invoked.
/// </term>
/// </item>
/// </list>
/// </param>
/// <param name="hSourceFile">
/// <para>A handle to the source file.</para>
/// </param>
/// <param name="hDestinationFile">
/// <para>A handle to the destination file</para>
/// </param>
/// <param name="lpData">
/// <para>Argument passed to <c>CopyProgressRoutine</c> by CopyFileEx, MoveFileTransacted, or MoveFileWithProgress.</para>
/// </param>
/// <returns>
/// <para>The <c>CopyProgressRoutine</c> function should return one of the following values.</para>
/// <list type="table">
/// <listheader>
/// <term>Return code/value</term>
/// <term>Description</term>
/// </listheader>
/// <item>
/// <term>PROGRESS_CANCEL 1</term>
/// <term>Cancel the copy operation and delete the destination file.</term>
/// </item>
/// <item>
/// <term>PROGRESS_CONTINUE 0</term>
/// <term>Continue the copy operation.</term>
/// </item>
/// <item>
/// <term>PROGRESS_QUIET 3</term>
/// <term>Continue the copy operation, but stop invoking CopyProgressRoutine to report progress.</term>
/// </item>
/// <item>
/// <term>PROGRESS_STOP 2</term>
/// <term>Stop the copy operation. It can be restarted at a later time.</term>
/// </item>
/// </list>
/// </returns>
/// <remarks>
/// <para>
/// An application can use this information to display a progress bar that shows the total number of bytes copied as a percent of the
/// total file size.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nc-winbase-lpprogress_routine LPPROGRESS_ROUTINE LpprogressRoutine;
// DWORD LpprogressRoutine( LARGE_INTEGER TotalFileSize, LARGE_INTEGER TotalBytesTransferred, LARGE_INTEGER StreamSize, LARGE_INTEGER
// StreamBytesTransferred, DWORD dwStreamNumber, DWORD dwCallbackReason, HANDLE hSourceFile, HANDLE hDestinationFile, LPVOID lpData ) {...}
[UnmanagedFunctionPointer(CallingConvention.Winapi, CharSet = CharSet.Auto)]
[PInvokeData("winbase.h", MSDNShortId = "2c02b212-d4ac-4b01-8955-2561d8c42b1b")]
public delegate COPYFILE_CALLBACK_RESULT LpprogressRoutine(long TotalFileSize, long TotalBytesTransferred, long StreamSize, long StreamBytesTransferred, uint dwStreamNumber, COPYFILE_CALLBACK dwCallbackReason, IntPtr hSourceFile, IntPtr hDestinationFile, IntPtr lpData);
/// <summary>Flags for SetSearchPathMode.</summary>
[PInvokeData("winbase.h", MSDNShortId = "1874933d-92c3-4945-a3e4-e6dede232d5e")]
[Flags]
@ -257,34 +168,6 @@ namespace Vanara.PInvoke
BASE_SEARCH_PATH_PERMANENT = 0x00008000,
}
/// <summary>Used by <see cref="LpprogressRoutine"/>.</summary>
public enum COPYFILE_CALLBACK
{
/// <summary>Another part of the data file was copied.</summary>
CALLBACK_CHUNK_FINISHED = 0x00000000,
/// <summary>
/// Another stream was created and is about to be copied. This is the callback reason given when the callback routine is first invoked.
/// </summary>
CALLBACK_STREAM_SWITCH = 0x00000001,
}
/// <summary>Returned by <see cref="LpprogressRoutine"/>.</summary>
public enum COPYFILE_CALLBACK_RESULT
{
/// <summary>Cancel the copy operation and delete the destination file.</summary>
PROGRESS_CANCEL = 1,
/// <summary>Continue the copy operation.</summary>
PROGRESS_CONTINUE = 0,
/// <summary>Continue the copy operation, but stop invoking CopyProgressRoutine to report progress.</summary>
PROGRESS_QUIET = 3,
/// <summary>Stop the copy operation. It can be restarted at a later time.</summary>
PROGRESS_STOP = 2,
}
/// <summary>
/// <para>
/// Indicates the phase of a copy at the time of an error. This is used in the <c>Error</c> structure embedded in the

View File

@ -24,7 +24,7 @@ namespace Vanara.PInvoke
/// list of handlers for this process is used.
/// </returns>
[return: MarshalAs(UnmanagedType.Bool)]
public delegate bool PHANDLER_ROUTINE(CTRL_EVENT CtrlType);
public delegate bool HandlerRoutine(CTRL_EVENT CtrlType);
/// <summary>
/// Character attributes can be divided into two classes: color and DBCS. The following attributes are defined in the Wincon.h header file.
@ -1851,7 +1851,7 @@ namespace Vanara.PInvoke
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
[PInvokeData("Wincon.h", MSDNShortId = "")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetConsoleCtrlHandler(PHANDLER_ROUTINE HandlerRoutine, [MarshalAs(UnmanagedType.Bool)] bool Add);
public static extern bool SetConsoleCtrlHandler(HandlerRoutine HandlerRoutine, [MarshalAs(UnmanagedType.Bool)] bool Add);
/// <summary>Sets the size and visibility of the cursor for the specified console screen buffer.</summary>
/// <param name="hConsoleOutput">

View File

@ -19,11 +19,11 @@ namespace Vanara.PInvoke
/// <returns>Pointer to a <see cref="IMAGE_RUNTIME_FUNCTION_ENTRY"/> structure.</returns>
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
[PInvokeData("WinNT.h")]
public delegate IntPtr PGET_RUNTIME_FUNCTION_CALLBACK(IntPtr ControlPc, IntPtr Context);
public delegate IntPtr GetRuntimeFunctionCallback(IntPtr ControlPc, IntPtr Context);
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
[PInvokeData("WinNT.h")]
public delegate uint POUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK(HPROCESS Process, IntPtr TableAddress, out uint Entries, [Out] IMAGE_RUNTIME_FUNCTION_ENTRY[] Functions);
public delegate uint OutOfProcessFunctionTableCallback(HPROCESS Process, IntPtr TableAddress, out uint Entries, [Out] IMAGE_RUNTIME_FUNCTION_ENTRY[] Functions);
/// <summary>
/// <para>The application-defined user-mode scheduling (UMS) scheduler entry point function associated with a UMS completion list.</para>

View File

@ -77,8 +77,8 @@ namespace Vanara.PInvoke
// pCallbackCred, AUTHNEXTSTEP *NextStep, PFNDAVAUTHCALLBACK_FREECRED *pFreeCred ) {...}
[PInvokeData("davclnt.h", MSDNShortId = "6ac191ac-e63f-431f-893b-92c69320db58")]
[UnmanagedFunctionPointer(CallingConvention.Winapi, CharSet = CharSet.Unicode)]
public delegate Win32Error PFNDAVAUTHCALLBACK(string lpwzServerName, string lpwzRemoteName, DAV_AUTHN_SCHEME dwAuthScheme, uint dwFlags,
ref DAV_CALLBACK_CRED pCallbackCred, ref AUTHNEXTSTEP NextStep, out PFNDAVAUTHCALLBACK_FREECRED pFreeCred);
public delegate Win32Error DavAuthCallback(string lpwzServerName, string lpwzRemoteName, DAV_AUTHN_SCHEME dwAuthScheme, uint dwFlags,
ref DAV_CALLBACK_CRED pCallbackCred, ref AUTHNEXTSTEP NextStep, out DavFreeCredCallback pFreeCred);
/// <summary>
/// <para>
@ -108,7 +108,7 @@ namespace Vanara.PInvoke
// PfndavauthcallbackFreecred; DWORD PfndavauthcallbackFreecred( PVOID pbuffer ) {...}
[PInvokeData("davclnt.h", MSDNShortId = "96bacda5-8f24-4119-b0ae-82ff8aff54b4")]
[UnmanagedFunctionPointer(CallingConvention.Winapi, CharSet = CharSet.Unicode)]
public delegate Win32Error PFNDAVAUTHCALLBACK_FREECRED(IntPtr pbuffer);
public delegate Win32Error DavFreeCredCallback(IntPtr pbuffer);
/// <summary>
/// <para>Specifies the next action that the WebDAV client should take after a successful call to the DavAuthCallback callback function.</para>
@ -576,7 +576,7 @@ namespace Vanara.PInvoke
// DavRegisterAuthCallback( PFNDAVAUTHCALLBACK CallBack, ULONG Version );
[DllImport(Lib.NetApi32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("davclnt.h", MSDNShortId = "7b381929-174f-4b7b-aa22-dc7a2c3e3b4d")]
public static extern uint DavRegisterAuthCallback(PFNDAVAUTHCALLBACK CallBack, uint Version);
public static extern uint DavRegisterAuthCallback(DavAuthCallback CallBack, uint Version);
/// <summary>Unregisters a registered callback function that the WebDAV client uses to prompt the user for credentials.</summary>
/// <param name="hCallback">The opaque handle that was returned by the DavRegisterAuthCallback function.</param>

View File

@ -96,7 +96,7 @@ namespace Vanara.PInvoke
// Perflibrequest( IN ULONG RequestCode, IN PVOID Buffer, IN ULONG BufferSize ) {...}
[PInvokeData("perflib.h", MSDNShortId = "0f771ab7-af42-481b-b2da-20dcdf49b82b")]
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
public delegate NTStatus Perflibrequest([In] uint RequestCode, [In] IntPtr Buffer, [In] uint BufferSize);
public delegate NTStatus ControlCallback([In] uint RequestCode, [In] IntPtr Buffer, [In] uint BufferSize);
/// <summary>
/// <para>
@ -122,7 +122,7 @@ namespace Vanara.PInvoke
// PerfMemAlloc( IN SIZE_T AllocSize, IN LPVOID pContext ) {...}
[PInvokeData("perflib.h", MSDNShortId = "09af7e56-2174-4a82-b45b-59f4180e4aab")]
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
public delegate IntPtr PerfMemAlloc([In] SizeT AllocSize, [In] IntPtr pContext);
public delegate IntPtr AllocateMemory([In] SizeT AllocSize, [In] IntPtr pContext);
/// <summary>
/// <para>
@ -147,7 +147,7 @@ namespace Vanara.PInvoke
// IN LPVOID pBuffer, IN LPVOID pContext ) {...}
[PInvokeData("perflib.h", MSDNShortId = "3b2f9f68-131a-4e17-8b43-6c3a20871dad")]
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
public delegate void PerfMemFree([In] IntPtr pBuffer, [In] IntPtr pContext);
public delegate void FreeMemory([In] IntPtr pBuffer, [In] IntPtr pContext);
/// <summary>
/// Indicates the content type of a PERF_COUNTER_HEADER block that the PerfQueryCounterData function includes as part of the
@ -1285,7 +1285,7 @@ namespace Vanara.PInvoke
// ProviderGuid, PERFLIBREQUEST ControlCallback, HANDLE *phProvider );
[DllImport(Lib.AdvApi32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("perflib.h", MSDNShortId = "b417b19b-adbc-40e3-aca1-c2cd94a79232")]
public static extern NTStatus PerfStartProvider(in Guid ProviderGuid, Perflibrequest ControlCallback, out SafeHPERFPROV phProvider);
public static extern NTStatus PerfStartProvider(in Guid ProviderGuid, ControlCallback ControlCallback, out SafeHPERFPROV phProvider);
/// <summary>Registers the provider.</summary>
/// <param name="ProviderGuid">
@ -2346,21 +2346,21 @@ namespace Vanara.PInvoke
/// used the <c>-NotificationCallback</c> argument when calling CTRPP. Otherwise, <c>NULL</c>.
/// </summary>
[MarshalAs(UnmanagedType.FunctionPtr)]
public Perflibrequest ControlCallback;
public ControlCallback ControlCallback;
/// <summary>
/// The name of the AllocateMemory function that PERFLIB calls to allocate memory. Set this member if you used the
/// <c>-MemoryRoutines</c> argument when calling CTRPP. Otherwise, <c>NULL</c>.
/// </summary>
[MarshalAs(UnmanagedType.FunctionPtr)]
public PerfMemAlloc MemAllocRoutine;
public AllocateMemory MemAllocRoutine;
/// <summary>
/// The name of the FreeMemory function that PERFLIB calls to free memory allocated by the AllocateMemory function. Must be
/// <c>NULL</c> if <c>MemAllocRoutine</c> is <c>NULL</c>.
/// </summary>
[MarshalAs(UnmanagedType.FunctionPtr)]
public PerfMemFree MemFreeRoutine;
public FreeMemory MemFreeRoutine;
/// <summary>Context information passed to the memory allocation and free routines. Can be <c>NULL</c>.</summary>
public IntPtr pMemContext;

View File

@ -14,7 +14,7 @@ namespace Vanara.PInvoke
/// <returns></returns>
[PInvokeData("Shobjidl.h")]
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
public delegate bool LPFNSVADDPROPSHEETPAGE(IntPtr hPropSheetPage, IntPtr lParam);
public delegate bool LPFNSVADDPROPSHEETPAGE(HPROPSHEETPAGE hPropSheetPage, IntPtr lParam);
/// <summary>Used by IShellPropSheetExt::ReplacePage.</summary>
[PInvokeData("Shobjidl.h")]

View File

@ -12,20 +12,6 @@ namespace Vanara.PInvoke
/// <summary>Exposes interfaces, functions and structures defined in shlwapi.dll.</summary>
public static partial class ShlwApi
{
/// <summary>
/// <para>Points to a function that notifies the host that a thread has started to execute.</para>
/// </summary>
/// <remarks>
/// <para>
/// The function to which <c>LPTHREAD_START_ROUTINE</c> points is a callback function and must be implemented by the writer of the
/// hosting application.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-3.5/aa964928(v=vs.90)
[PInvokeData("Processthreadsapi.h")]
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
public delegate uint LPTHREAD_START_ROUTINE([In] IntPtr lpParameter);
/// <summary>
/// <para>Used by IQueryAssociations::GetData to define the type of data that is to be returned.</para>
/// </summary>
@ -2675,7 +2661,7 @@ namespace Vanara.PInvoke
[DllImport(Lib.Shlwapi, SetLastError = true, ExactSpelling = true)]
[PInvokeData("shlwapi.h", MSDNShortId = "2140e396-29cd-4665-b684-337170570b73")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SHCreateThread(LPTHREAD_START_ROUTINE pfnThreadProc, IntPtr pData, SHCT_FLAGS flags, LPTHREAD_START_ROUTINE pfnCallback);
public static extern bool SHCreateThread(ThreadProc pfnThreadProc, IntPtr pData, SHCT_FLAGS flags, ThreadProc pfnCallback);
/// <summary>
/// <para>Creates a per-thread reference to a Component Object Model (COM) object.</para>
@ -2770,7 +2756,7 @@ namespace Vanara.PInvoke
[DllImport(Lib.Shlwapi, SetLastError = true, ExactSpelling = true)]
[PInvokeData("shlwapi.h", MSDNShortId = "22a3a97a-857f-46b8-a2e0-8f3a14f40322")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SHCreateThreadWithHandle(LPTHREAD_START_ROUTINE pfnThreadProc, IntPtr pData, SHCT_FLAGS flags, LPTHREAD_START_ROUTINE pfnCallback, out SafeHFILE pHandle);
public static extern bool SHCreateThreadWithHandle(ThreadProc pfnThreadProc, IntPtr pData, SHCT_FLAGS flags, ThreadProc pfnCallback, out SafeHFILE pHandle);
/// <summary>
/// <para>Deletes an empty key.</para>

View File

@ -520,7 +520,7 @@ namespace Vanara.PInvoke
[DllImport(Lib.User32, SetLastError = true, ExactSpelling = true)]
[PInvokeData("winuser.h", MSDNShortId = "b399ff19-e2e5-4509-8bb5-9647734881b3")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool EnumDesktopWindows(HDESK hDesktop, WNDENUMPROC lpfn, IntPtr lParam);
public static extern bool EnumDesktopWindows(HDESK hDesktop, EnumWindowsProc lpfn, IntPtr lParam);
/// <summary>
/// <para>

View File

@ -10,6 +10,53 @@ namespace Vanara.PInvoke
public const int CCHILDREN_SCROLLBAR = 5;
public const int CCHILDREN_TITLEBAR = 5;
/// <summary>
/// An application-defined callback function used with the <c>EnumChildWindows</c> function. It receives the child window handles.
/// The <c>WNDENUMPROC</c> type defines a pointer to this callback function. EnumChildProc is a placeholder for the
/// application-defined function name.
/// </summary>
/// <param name="hwnd">A handle to a child window of the parent window specified in <c>EnumChildWindows</c>.</param>
/// <param name="lParam">The application-defined value given in <c>EnumChildWindows</c>.</param>
/// <returns>To continue enumeration, the callback function must return <c>TRUE</c>; to stop enumeration, it must return <c>FALSE</c>.</returns>
// BOOL CALLBACK EnumChildProc( _In_ HWND hwnd, _In_ LPARAM lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/ms633493(v=vs.85).aspx
[PInvokeData("Winuser.h", MSDNShortId = "ms633493")]
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
[return: MarshalAs(UnmanagedType.Bool)]
public delegate bool EnumWindowsProc([In] HWND hwnd, [In] IntPtr lParam);
/// <summary>
/// <para>
/// An application-defined function that processes messages sent to a window. The <c>WNDPROC</c> type defines a pointer to this
/// callback function.
/// </para>
/// <para>WindowProc is a placeholder for the application-defined function name.</para>
/// </summary>
/// <param name="hwnd">
/// <para>Type: <c>HWND</c></para>
/// <para>A handle to the window.</para>
/// </param>
/// <param name="uMsg">
/// <para>Type: <c>UINT</c></para>
/// <para>The message.</para>
/// <para>For lists of the system-provided messages, see System-Defined Messages.</para>
/// </param>
/// <param name="wParam">
/// <para>Type: <c>WPARAM</c></para>
/// <para>Additional message information. The contents of this parameter depend on the value of the uMsg parameter.</para>
/// </param>
/// <param name="lParam">
/// <para>Type: <c>LPARAM</c></para>
/// <para>Additional message information. The contents of this parameter depend on the value of the uMsg parameter.</para>
/// </param>
/// <returns>
/// <para>Type:</para>
/// <para>The return value is the result of the message processing and depends on the message sent.</para>
/// </returns>
// LRESULT CALLBACK WindowProc( _In_ HWND hwnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/ms633573(v=vs.85).aspx
[PInvokeData("Winuser.h", MSDNShortId = "ms633573")]
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
public delegate IntPtr WindowProc([In] HWND hwnd, [In] uint uMsg, [In] IntPtr wParam, [In] IntPtr lParam);
/// <summary>
/// <para>The user-provided entry point for a graphical Windows-based application.</para>
/// <para><c>WinMain</c> is the conventional name used for the application entry point. For more information, see Remarks.</para>
@ -113,53 +160,6 @@ namespace Vanara.PInvoke
[PInvokeData("Winbase.h", MSDNShortId = "ms633559")]
public delegate int WinMain([In] HINSTANCE hInstance, [In] HINSTANCE hPrevInstance, [In] [MarshalAs(UnmanagedType.LPStr)] string lpCmdLine, [In] ShowWindowCommand nCmdShow);
/// <summary>
/// An application-defined callback function used with the <c>EnumChildWindows</c> function. It receives the child window handles.
/// The <c>WNDENUMPROC</c> type defines a pointer to this callback function. EnumChildProc is a placeholder for the
/// application-defined function name.
/// </summary>
/// <param name="hwnd">A handle to a child window of the parent window specified in <c>EnumChildWindows</c>.</param>
/// <param name="lParam">The application-defined value given in <c>EnumChildWindows</c>.</param>
/// <returns>To continue enumeration, the callback function must return <c>TRUE</c>; to stop enumeration, it must return <c>FALSE</c>.</returns>
// BOOL CALLBACK EnumChildProc( _In_ HWND hwnd, _In_ LPARAM lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/ms633493(v=vs.85).aspx
[PInvokeData("Winuser.h", MSDNShortId = "ms633493")]
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
[return: MarshalAs(UnmanagedType.Bool)]
public delegate bool WNDENUMPROC([In] HWND hwnd, [In] IntPtr lParam);
/// <summary>
/// <para>
/// An application-defined function that processes messages sent to a window. The <c>WNDPROC</c> type defines a pointer to this
/// callback function.
/// </para>
/// <para>WindowProc is a placeholder for the application-defined function name.</para>
/// </summary>
/// <param name="hwnd">
/// <para>Type: <c>HWND</c></para>
/// <para>A handle to the window.</para>
/// </param>
/// <param name="uMsg">
/// <para>Type: <c>UINT</c></para>
/// <para>The message.</para>
/// <para>For lists of the system-provided messages, see System-Defined Messages.</para>
/// </param>
/// <param name="wParam">
/// <para>Type: <c>WPARAM</c></para>
/// <para>Additional message information. The contents of this parameter depend on the value of the uMsg parameter.</para>
/// </param>
/// <param name="lParam">
/// <para>Type: <c>LPARAM</c></para>
/// <para>Additional message information. The contents of this parameter depend on the value of the uMsg parameter.</para>
/// </param>
/// <returns>
/// <para>Type:</para>
/// <para>The return value is the result of the message processing and depends on the message sent.</para>
/// </returns>
// LRESULT CALLBACK WindowProc( _In_ HWND hwnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/ms633573(v=vs.85).aspx
[PInvokeData("Winuser.h", MSDNShortId = "ms633573")]
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
public delegate IntPtr WNDPROC([In] HWND hwnd, [In] uint uMsg, [In] IntPtr wParam, [In] IntPtr lParam);
/// <summary>
/// The type of animation. Note that, by default, these flags take effect when showing a window. To take effect when hiding a window,
/// use <c>AW_HIDE</c> and a logical OR operator with the appropriate flags.
@ -1589,7 +1589,7 @@ namespace Vanara.PInvoke
// lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam );
[DllImport(Lib.User32, SetLastError = false, CharSet = CharSet.Auto)]
[PInvokeData("winuser.h", MSDNShortId = "")]
public static extern IntPtr CallWindowProc(WNDPROC lpPrevWndFunc, HWND hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
public static extern IntPtr CallWindowProc(WindowProc lpPrevWndFunc, HWND hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
/// <summary>
/// <para>Cascades the specified child windows of the specified parent window.</para>
@ -2825,7 +2825,7 @@ namespace Vanara.PInvoke
[DllImport(Lib.User32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("winuser.h", MSDNShortId = "enumchildwindows")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool EnumChildWindows(HWND hWndParent, WNDENUMPROC lpEnumFunc, IntPtr lParam);
public static extern bool EnumChildWindows(HWND hWndParent, EnumWindowsProc lpEnumFunc, IntPtr lParam);
/// <summary>
/// <para>
@ -2859,7 +2859,7 @@ namespace Vanara.PInvoke
[DllImport(Lib.User32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("winuser.h", MSDNShortId = "enumthreadwindows")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool EnumThreadWindows(uint dwThreadId, WNDENUMPROC lpfn, IntPtr lParam);
public static extern bool EnumThreadWindows(uint dwThreadId, EnumWindowsProc lpfn, IntPtr lParam);
/// <summary>
/// <para>
@ -2900,7 +2900,7 @@ namespace Vanara.PInvoke
[DllImport(Lib.User32, SetLastError = true, ExactSpelling = true)]
[PInvokeData("winuser.h", MSDNShortId = "enumwindows")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool EnumWindows(WNDENUMPROC lpEnumFunc, IntPtr lParam);
public static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam);
/// <summary>
/// <para>
@ -8209,7 +8209,7 @@ namespace Vanara.PInvoke
/// information, see WindowProc.
/// </para>
/// </summary>
public WNDPROC lpfnWndProc;
public WindowProc lpfnWndProc;
/// <summary>
/// <para>Type: <c>int</c></para>
@ -8392,7 +8392,7 @@ namespace Vanara.PInvoke
/// information, see WindowProc.
/// </para>
/// </summary>
public WNDPROC lpfnWndProc;
public WindowProc lpfnWndProc;
/// <summary>
/// <para>Type: <c>int</c></para>

View File

@ -75,7 +75,7 @@ namespace Vanara.PInvoke
// HWINEVENTHOOK hWinEventHook, DWORD event, HWND hwnd, LONG idObject, LONG idChild, DWORD idEventThread, DWORD dwmsEventTime ) {...}
[PInvokeData("winuser.h", MSDNShortId = "5fe3cacc-4563-43da-960d-729d3fe4ff70")]
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
public delegate void WINEVENTPROC(HWINEVENTHOOK hWinEventHook, uint winEvent, HWND hwnd, int idObject, int idChild, uint idEventThread, uint dwmsEventTime);
public delegate void WinEventProc(HWINEVENTHOOK hWinEventHook, uint winEvent, HWND hwnd, int idObject, int idChild, uint idEventThread, uint dwmsEventTime);
/// <summary>The type of hook procedure to be installed.</summary>
[PInvokeData("WinUser.h", MSDNShortId = "ms644990")]
@ -762,7 +762,7 @@ namespace Vanara.PInvoke
// eventMin, DWORD eventMax, HMODULE hmodWinEventProc, WINEVENTPROC pfnWinEventProc, DWORD idProcess, DWORD idThread, DWORD dwFlags );
[DllImport(Lib.User32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("winuser.h", MSDNShortId = "090bda1b-0635-4aa3-ae33-3987b36e30b8")]
public static extern HWINEVENTHOOK SetWinEventHook(uint eventMin, uint eventMax, HINSTANCE hmodWinEventProc, WINEVENTPROC pfnWinEventProc, uint idProcess, uint idThread, WINEVENT dwFlags);
public static extern HWINEVENTHOOK SetWinEventHook(uint eventMin, uint eventMax, HINSTANCE hmodWinEventProc, WinEventProc pfnWinEventProc, uint idProcess, uint idThread, WINEVENT dwFlags);
/// <summary>
/// <para>Removes a hook procedure installed in a hook chain by the SetWindowsHookEx function.</para>

View File

@ -35,7 +35,7 @@ namespace Vanara.PInvoke
/// DWORD that contains one or more of the <see cref="InternetState"/> flags.
/// </param>
/// <param name="dwStatusInformationLength">The size, in bytes, of the data pointed to by lpvStatusInformation.</param>
public delegate void INTERNET_STATUS_CALLBACK([In] IntPtr hInternet, [In, Optional] IntPtr dwContext, [In] InternetStatus dwInternetStatus, [In, Optional] IntPtr lpvStatusInformation, [In] uint dwStatusInformationLength);
public delegate void InternetStatusCallback([In] IntPtr hInternet, [In, Optional] IntPtr dwContext, [In] InternetStatus dwInternetStatus, [In, Optional] IntPtr lpvStatusInformation, [In] uint dwStatusInformationLength);
/// <summary>Flags used by <see cref="INTERNET_DIAGNOSTIC_SOCKET_INFO"/>.</summary>
[Flags]
@ -433,7 +433,7 @@ namespace Vanara.PInvoke
/// Sets or retrieves the address of the callback function defined for this handle. This option can be used on all HINTERNET
/// handles. Used by InternetQueryOption and InternetSetOption.
/// </summary>
[CorrespondingType(typeof(INTERNET_STATUS_CALLBACK))]
[CorrespondingType(typeof(InternetStatusCallback))]
INTERNET_OPTION_CALLBACK = 1,
/// <summary>Not implemented.</summary>
@ -1258,7 +1258,7 @@ namespace Vanara.PInvoke
INTERNET_SERVICE_HTTP = 3
}
/// <summary>Values passed using the <see cref="INTERNET_STATUS_CALLBACK"/> delegate.</summary>
/// <summary>Values passed using the <see cref="InternetStatusCallback"/> delegate.</summary>
[Flags]
public enum InternetState
{
@ -1278,7 +1278,7 @@ namespace Vanara.PInvoke
INTERNET_STATE_BUSY = 0x200,
}
/// <summary>Values passed using the <see cref="INTERNET_STATUS_CALLBACK"/> delegate.</summary>
/// <summary>Values passed using the <see cref="InternetStatusCallback"/> delegate.</summary>
public enum InternetStatus
{
/// <summary>Closing the connection to the server. The lpvStatusInformation parameter is NULL.</summary>
@ -1568,7 +1568,7 @@ namespace Vanara.PInvoke
/// function, or INTERNET_INVALID_STATUS_CALLBACK if the callback function is not valid.
/// </returns>
[DllImport(Lib.WinInet, ExactSpelling = true, SetLastError = true)]
public static extern IntPtr InternetSetStatusCallback(SafeInternetHandle hInternet, INTERNET_STATUS_CALLBACK lpfnInternetCallback);
public static extern IntPtr InternetSetStatusCallback(SafeInternetHandle hInternet, InternetStatusCallback lpfnInternetCallback);
[DllImport("inetcpl.cpl", SetLastError = true)]
private static extern int LaunchInternetControlPanel(HWND hWnd);

View File

@ -78,7 +78,7 @@ namespace Vanara.PInvoke
/// <returns></returns>
[PInvokeData("winsock2.h", MSDNShortId = "f385f63f-49b2-4eb7-8717-ad4cca1a2252")]
[UnmanagedFunctionPointer(CallingConvention.Winapi, CharSet = CharSet.Unicode)]
public delegate CF LPCONDITIONPROC(in WSABUF lpCallerId, in WSABUF lpCallerData, IntPtr lpSQOS, IntPtr lpGQOS, in WSABUF lpCalleeId, in WSABUF lpCalleeData, out GROUP g, IntPtr dwCallbackData);
public delegate CF ConditionFunc(in WSABUF lpCallerId, in WSABUF lpCallerData, IntPtr lpSQOS, IntPtr lpGQOS, in WSABUF lpCalleeId, in WSABUF lpCalleeData, out GROUP g, IntPtr dwCallbackData);
[PInvokeData("winsock2.h")]
public enum ADDRESS_FAMILY : ushort
@ -2607,7 +2607,7 @@ namespace Vanara.PInvoke
// *addr, LPINT addrlen, LPCONDITIONPROC lpfnCondition, DWORD_PTR dwCallbackData );
[DllImport(Lib.Ws2_32, SetLastError = true, ExactSpelling = true)]
[PInvokeData("winsock2.h", MSDNShortId = "f385f63f-49b2-4eb7-8717-ad4cca1a2252")]
public static extern SOCKET WSAAccept(SOCKET s, SOCKADDR addr, ref int addrlen, [In, Out, Optional] LPCONDITIONPROC lpfnCondition, [In, Out, Optional] IntPtr dwCallbackData);
public static extern SOCKET WSAAccept(SOCKET s, SOCKADDR addr, ref int addrlen, [In, Out, Optional] ConditionFunc lpfnCondition, [In, Out, Optional] IntPtr dwCallbackData);
/// <summary>
/// <para>