diff --git a/CHANGELOG.md b/CHANGELOG.md index cb094203f..5de729825 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,61 @@ ## 5.3.0-wip -- Migrate away from `.elementAt` (#XXX) -- Bump minimum required Dart version to `3.3.0` +- Migrate away from `.elementAt` (#825) +- Bump minimum required Dart version to `3.3.0` (#825) +- Deprecate `CallWndProc` typedef in favor of `HOOKPROC` (#826) +- Deprecate `CCHookProc` typedef in favor of `LPCCHOOKPROC` (#826) +- Deprecate `CFHookProc` typedef in favor of `LPCFHOOKPROC` (#826) +- Deprecate `DlgProc` typedef in favor of `DLGPROC` (#826) +- Deprecate `DrawStateProc` typedef in favor of `DRAWSTATEPROC` (#826) +- Deprecate `DrawTextCallback` typedef in favor of `DTT_CALLBACK_PROC` (#826) +- Deprecate `EnumPageFilesProc` typedef in favor of + `PENUM_PAGE_FILE_CALLBACK` (#826) +- Deprecate `EnumFontFamExProc` typedef in favor of `FONTENUMPROC` (#826) +- Deprecate `EnumResNameProc` typedef in favor of `ENUMRESNAMEPROC` (#826) +- Deprecate `EnumResTypeProc` typedef in favor of `ENUMRESTYPEPROC` (#826) +- Deprecate `EnumWindowsProc` typedef in favor of `WNDENUMPROC` (#826) +- Deprecate `ExcepInfoProc` typedef in favor of + `LPEXCEPFINO_DEFERRED_FILLIN` (#826) +- Deprecate `FRHookProc` typedef in favor of `LPFRHOOKPROC` (#826) +- Deprecate `HandlerRoutine` typedef in favor of `PHANDLER_ROUTINE` (#826) +- Deprecate `LphandlerFunction` typedef in favor of `LPHANDLER_FUNCTION` (#826) +- Deprecate `LphandlerFunctionEx` typedef in favor of + `LPHANDLER_FUNCTION_EX` (#826) +- Deprecate `LpoverlappedCompletionRoutine` in favor of + `LPOVERLAPPED_COMPLETION_ROUTINE` (#826) +- Deprecate `LpserviceMainFunctionw` in favor of + `LPSERVICE_MAIN_FUNCTION` (#826) +- Deprecate `MidiInProc` typedef in favor of `MIDIINPROC` (#826) +- Deprecate `MidiOutProc` typedef in favor of `MIDIOUTPROC` (#826) +- Deprecate `MonitorEnumProc` typedef in favor of `MONITORENUMPROC` (#826) +- Deprecate `OFNHookProc` typedef in favor of `LPOFNHOOKPROC` (#826) +- Deprecate `OpenCardCheckProc` typedef in favor of `LPOCNCHKPROC` (#826) +- Deprecate `OpenCardConnProc` typedef in favor of `LPOCNCONNPROC` (#826) +- Deprecate `OpenCardDisconnProc` typedef in favor of `LPOCNDSCPROC` (#826) +- Deprecate `OutputProc` typedef in favor of `GRAYSTRINGPROC` (#826) +- Deprecate `PfnAuthenticationCallbackEx` in favor of + `PFN_AUTHENTICATION_CALLBACK_EX` (#826) +- Deprecate `PfnbluetoothGattEventCallback` in favor of + `PFN_BLUETOOTH_GATT_EVENT_CALLBACK` (#826) +- Deprecate `PfnBluetoothEnumAttributesCallback` in favor of + `PFN_BLUETOOTH_ENUM_ATTRIBUTES_CALLBACK` (#826) +- Deprecate `PfnDeviceCallback` typedef in favor of `PFN_DEVICE_CALLBACK` (#826) +- Deprecate `PfnScNotifyCallbackFunction` in favor of + `PFN_SC_NOTIFY_CALLBACK` (#826) +- Deprecate `SendAsyncProc` typedef in favor of `SENDASYNCPROC` (#826) +- Deprecate `SpNotifyCallback` typedef in favor of `SPNOTIFYCALLBACK` (#826) +- Deprecate `SubclassProc` typedef in favor of `SUBCLASSPROC` (#826) +- Deprecate `SymEnumSymbolsProc` in favor of + `PSYM_ENUMERATESYMBOLS_CALLBACK` (#826) +- Deprecate `TaskDialogCallbackProc` typedef in favor of + `PFTASKDIALOGCALLBACK` (#826) +- Deprecate `ThreadProc` typedef in favor of `LPTHREAD_START_ROUTINE` (#826) +- Deprecate `TimerProc` typedef in favor of `TIMERPROC` (#826) +- Deprecate `WindowProc` typedef in favor of `WNDPROC` (#826) +- Deprecate `WlanNotificationCallback` in favor of + `WLAN_NOTIFICATION_CALLBACK` (#826) +- **Note**: You can automatically migrate your code to use the new typedefs by + running `dart fix --apply` in your terminal. ## 5.2.0 diff --git a/analysis_options.yaml b/analysis_options.yaml index d32b6a663..9ca854240 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,7 +1,7 @@ include: package:dartwindows_lints/analysis_options.yaml analyzer: - exclude: [example/explorer/**] + exclude: ['example/explorer/**', 'test_fixes/**'] errors: todo: ignore diff --git a/example/customtitlebar.dart b/example/customtitlebar.dart index 07c00d1e5..0452e2f56 100644 --- a/example/customtitlebar.dart +++ b/example/customtitlebar.dart @@ -517,7 +517,7 @@ void main() { // Register the window class. final windowClassName = 'WIN32_CUSTOM_TITLEBAR_EXAMPLE'.toNativeUtf16(); - final lpfnWndProc = NativeCallable.isolateLocal( + final lpfnWndProc = NativeCallable.isolateLocal( mainWindowProc, exceptionalReturn: 0, ); diff --git a/example/customwin.dart b/example/customwin.dart index b70ba4dc0..288c5bc6c 100644 --- a/example/customwin.dart +++ b/example/customwin.dart @@ -60,7 +60,7 @@ void winMain(int hInstance, List args, int nShowCmd) { // Register the window class. final className = TEXT('Sample Window Class'); - final lpfnWndProc = NativeCallable.isolateLocal( + final lpfnWndProc = NativeCallable.isolateLocal( mainWindowProc, exceptionalReturn: 0, ); diff --git a/example/dialogbox.dart b/example/dialogbox.dart index 392174083..cd1395fe7 100644 --- a/example/dialogbox.dart +++ b/example/dialogbox.dart @@ -87,7 +87,7 @@ void main() { windowSystemClass: 0x0081, // edit text: 'Enter text'); - final lpDialogFunc = NativeCallable.isolateLocal( + final lpDialogFunc = NativeCallable.isolateLocal( dialogReturnProc, exceptionalReturn: 0, ); diff --git a/example/dump.dart b/example/dump.dart index 1af2d2c0f..14461a02d 100644 --- a/example/dump.dart +++ b/example/dump.dart @@ -48,7 +48,7 @@ Map getExports(int hProcess, String module) { final mask = '*'.toNativeUtf16(); - final callback = NativeCallable.isolateLocal( + final callback = NativeCallable.isolateLocal( _enumSymbolProc, exceptionalReturn: 0, ); diff --git a/example/fonts.dart b/example/fonts.dart index da52b180a..e76972e12 100644 --- a/example/fonts.dart +++ b/example/fonts.dart @@ -23,7 +23,7 @@ int enumerateFonts( void main() { final hDC = GetDC(NULL); final searchFont = calloc()..ref.lfCharSet = ANSI_CHARSET; - final lpProc = NativeCallable.isolateLocal( + final lpProc = NativeCallable.isolateLocal( enumerateFonts, exceptionalReturn: 0, ); diff --git a/example/hello.dart b/example/hello.dart index 08eab7084..131a42508 100644 --- a/example/hello.dart +++ b/example/hello.dart @@ -43,7 +43,7 @@ void winMain(int hInstance, List args, int nShowCmd) { // Register the window class. final className = TEXT('Sample Window Class'); - final lpfnWndProc = NativeCallable.isolateLocal( + final lpfnWndProc = NativeCallable.isolateLocal( mainWindowProc, exceptionalReturn: 0, ); diff --git a/example/hooks.dart b/example/hooks.dart index 60c962114..cd7137ccb 100644 --- a/example/hooks.dart +++ b/example/hooks.dart @@ -193,14 +193,14 @@ int mainWindowProc(int hWnd, int uMsg, int wParam, int lParam) { void main() => initApp(winMain); void winMain(int hInstance, List args, int nShowCmd) { - final lpfn = NativeCallable.isolateLocal( + final lpfn = NativeCallable.isolateLocal( lowlevelKeyboardHookProc, exceptionalReturn: 0, ); keyHook = SetWindowsHookEx(WH_KEYBOARD_LL, lpfn.nativeFunction, NULL, 0); - final lpfnWndProc = NativeCallable.isolateLocal( + final lpfnWndProc = NativeCallable.isolateLocal( mainWindowProc, exceptionalReturn: 0, ); diff --git a/example/magnifier.dart b/example/magnifier.dart index d4caffdb4..8c0a20b93 100644 --- a/example/magnifier.dart +++ b/example/magnifier.dart @@ -32,8 +32,8 @@ void main() => initApp(winMain); /// Entry point for the application void winMain(int hInstance, List args, int nCmdShow) { - final lpfnWndProc = NativeCallable.isolateLocal(hostWndProc, - exceptionalReturn: 0); + final lpfnWndProc = + NativeCallable.isolateLocal(hostWndProc, exceptionalReturn: 0); if (MagInitialize() == FALSE || !setupMagnifier(hInstance, lpfnWndProc.nativeFunction)) { @@ -43,7 +43,7 @@ void winMain(int hInstance, List args, int nCmdShow) { ShowWindow(hwndHost, nCmdShow); UpdateWindow(hwndHost); - final lpTimerFunc = NativeCallable.isolateLocal(updateMagWindow); + final lpTimerFunc = NativeCallable.isolateLocal(updateMagWindow); // Create a timer to update the control final timerId = @@ -109,7 +109,7 @@ int hostWndProc(int hWnd, int message, int wParam, int lParam) { /// Registers the window class for the window that contains the magnification /// control. int registerHostWindowClass( - int hInstance, Pointer> lpfnWndProc) { + int hInstance, Pointer> lpfnWndProc) { final wcex = calloc() ..ref.cbSize = sizeOf() ..ref.style = CS_HREDRAW | CS_VREDRAW @@ -122,8 +122,7 @@ int registerHostWindowClass( return RegisterClassEx(wcex); } -bool setupMagnifier( - int hInst, Pointer> lpfnWndProc) { +bool setupMagnifier(int hInst, Pointer> lpfnWndProc) { // Set bounds of host window according to screen size hostWindowRect ..ref.top = 0 diff --git a/example/monitor.dart b/example/monitor.dart index a15eea97a..805978974 100644 --- a/example/monitor.dart +++ b/example/monitor.dart @@ -93,7 +93,7 @@ void printMonitorCapabilities(int capabilitiesBitmask) { void main() { var result = FALSE; - final lpfnEnum = NativeCallable.isolateLocal( + final lpfnEnum = NativeCallable.isolateLocal( enumMonitorCallback, exceptionalReturn: 0, ); diff --git a/example/notepad/notepad.dart b/example/notepad/notepad.dart index 527dbc08d..cef5e72e8 100644 --- a/example/notepad/notepad.dart +++ b/example/notepad/notepad.dart @@ -212,7 +212,7 @@ int mainWindowProc(int hwnd, int message, int wParam, int lParam) { case IDM_APP_ABOUT: final pDialog = NotepadResources.loadAboutBox(); - final lpDialogFunc = NativeCallable.isolateLocal( + final lpDialogFunc = NativeCallable.isolateLocal( dialogReturnProc, exceptionalReturn: 0, ); @@ -293,7 +293,7 @@ void main() { // Register the window class. final className = TEXT(APP_NAME); - final lpfnWndProc = NativeCallable.isolateLocal( + final lpfnWndProc = NativeCallable.isolateLocal( mainWindowProc, exceptionalReturn: 0, ); diff --git a/example/paint.dart b/example/paint.dart index fd82ec217..c90e7ef66 100644 --- a/example/paint.dart +++ b/example/paint.dart @@ -54,7 +54,7 @@ void winMain(int hInstance, List args, int nShowCmd) { // Register the window class. final className = TEXT('Simple Paint Sample'); - final lpfnWndProc = NativeCallable.isolateLocal( + final lpfnWndProc = NativeCallable.isolateLocal( mainWindowProc, exceptionalReturn: 0, ); diff --git a/example/scroll.dart b/example/scroll.dart index 0288ea579..a3a79bf75 100644 --- a/example/scroll.dart +++ b/example/scroll.dart @@ -261,7 +261,7 @@ void winMain(int hInstance, List args, int nShowCmd) { // Register the window class. final className = TEXT('Scrollbar Sample'); - final lpfnWndProc = NativeCallable.isolateLocal( + final lpfnWndProc = NativeCallable.isolateLocal( mainWindowProc, exceptionalReturn: 0, ); diff --git a/example/shell_notify_icon/_app.dart b/example/shell_notify_icon/_app.dart index eaabf9679..23dfcca0b 100644 --- a/example/shell_notify_icon/_app.dart +++ b/example/shell_notify_icon/_app.dart @@ -14,7 +14,7 @@ const EVENT_TRAY_NOTIFY = WM_APP + 1; typedef LocalWndProc = bool Function( int hWnd, int uMsg, int wParam, int lParam); -final lpfnWndProc = NativeCallable.isolateLocal( +final lpfnWndProc = NativeCallable.isolateLocal( _appWndProc, exceptionalReturn: 0, ); diff --git a/example/snake.dart b/example/snake.dart index 35906dfd9..17335e6b8 100644 --- a/example/snake.dart +++ b/example/snake.dart @@ -541,7 +541,7 @@ void winMain(int hInstance, List args, int nShowCmd) { // Register the window class. final className = TEXT('WinSnakeWindowClass'); - final lpfnWndProc = NativeCallable.isolateLocal( + final lpfnWndProc = NativeCallable.isolateLocal( mainWindowProc, exceptionalReturn: 0, ); diff --git a/example/tetris/main.dart b/example/tetris/main.dart index 798ddf07f..1e62acacc 100644 --- a/example/tetris/main.dart +++ b/example/tetris/main.dart @@ -23,7 +23,7 @@ late Canvas canvas; void main() { final szAppName = 'Tetris'.toNativeUtf16(); - final lpfnWndProc = NativeCallable.isolateLocal( + final lpfnWndProc = NativeCallable.isolateLocal( mainWindowProc, exceptionalReturn: 0, ); diff --git a/example/window.dart b/example/window.dart index f0be67ddc..a9b656c08 100644 --- a/example/window.dart +++ b/example/window.dart @@ -30,7 +30,7 @@ int enumWindowsProc(int hWnd, int lParam) { /// List the window handle and text for all top-level desktop windows /// in the current session. void enumerateWindows() { - final lpEnumFunc = NativeCallable.isolateLocal( + final lpEnumFunc = NativeCallable.isolateLocal( enumWindowsProc, exceptionalReturn: 0, ); diff --git a/lib/fix_data.yaml b/lib/fix_data.yaml new file mode 100644 index 000000000..6565d7a4c --- /dev/null +++ b/lib/fix_data.yaml @@ -0,0 +1,329 @@ +# Copyright (c) 2024, Dart | Windows. Please see the AUTHORS file for details. +# All rights reserved. Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +# Please add new fixes to the top of the file. For documentation about this file +# format, see . + +version: 1 +transforms: + - title: "Migrate to 'DLGPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'DlgProc' + changes: + - kind: 'rename' + newName: 'DLGPROC' + - title: "Migrate to 'DRAWSTATEPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'DrawStateProc' + changes: + - kind: 'rename' + newName: 'DRAWSTATEPROC' + - title: "Migrate to 'DTT_CALLBACK_PROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'DrawTextCallback' + changes: + - kind: 'rename' + newName: 'DTT_CALLBACK_PROC' + - title: "Migrate to 'ENUMRESNAMEPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'EnumResNameProc' + changes: + - kind: 'rename' + newName: 'ENUMRESNAMEPROC' + - title: "Migrate to 'ENUMRESTYPEPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'EnumResTypeProc' + changes: + - kind: 'rename' + newName: 'ENUMRESTYPEPROC' + - title: "Migrate to 'FONTENUMPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'EnumFontFamExProc' + changes: + - kind: 'rename' + newName: 'FONTENUMPROC' + - title: "Migrate to 'GRAYSTRINGPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'OutputProc' + changes: + - kind: 'rename' + newName: 'GRAYSTRINGPROC' + - title: "Migrate to 'HOOKPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'CallWndProc' + changes: + - kind: 'rename' + newName: 'HOOKPROC' + - title: "Migrate to 'LPCCHOOKPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'CCHookProc' + changes: + - kind: 'rename' + newName: 'LPCCHOOKPROC' + - title: "Migrate to 'LPCFHOOKPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'CFHookProc' + changes: + - kind: 'rename' + newName: 'LPCFHOOKPROC' + - title: "Migrate to 'LPEXCEPFINO_DEFERRED_FILLIN'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'ExcepInfoProc' + changes: + - kind: 'rename' + newName: 'LPEXCEPFINO_DEFERRED_FILLIN' + - title: "Migrate to 'LPFRHOOKPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'FRHookProc' + changes: + - kind: 'rename' + newName: 'LPFRHOOKPROC' + - title: "Migrate to 'LPHANDLER_FUNCTION'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'LphandlerFunction' + changes: + - kind: 'rename' + newName: 'LPHANDLER_FUNCTION' + - title: "Migrate to 'LPHANDLER_FUNCTION_EX'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'LphandlerFunctionEx' + changes: + - kind: 'rename' + newName: 'LPHANDLER_FUNCTION_EX' + - title: "Migrate to 'LPOCNCHKPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'OpenCardCheckProc' + changes: + - kind: 'rename' + newName: 'LPOCNCHKPROC' + - title: "Migrate to 'LPOCNCONNPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'OpenCardConnProc' + changes: + - kind: 'rename' + newName: 'LPOCNCONNPROC' + - title: "Migrate to 'LPOCNDSCPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'OpenCardDisconnProc' + changes: + - kind: 'rename' + newName: 'LPOCNDSCPROC' + - title: "Migrate to 'LPOFNHOOKPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'OFNHookProc' + changes: + - kind: 'rename' + newName: 'LPOFNHOOKPROC' + - title: "Migrate to 'LPOVERLAPPED_COMPLETION_ROUTINE'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'LpoverlappedCompletionRoutine' + changes: + - kind: 'rename' + newName: 'LPOVERLAPPED_COMPLETION_ROUTINE' + - title: "Migrate to 'LPSERVICE_MAIN_FUNCTION'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'LpserviceMainFunctionw' + changes: + - kind: 'rename' + newName: 'LPSERVICE_MAIN_FUNCTION' + - title: "Migrate to 'LPTHREAD_START_ROUTINE'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'ThreadProc' + changes: + - kind: 'rename' + newName: 'LPTHREAD_START_ROUTINE' + - title: "Migrate to 'MIDIINPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'MidiInProc' + changes: + - kind: 'rename' + newName: 'MIDIINPROC' + - title: "Migrate to 'MIDIOUTPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'MidiOutProc' + changes: + - kind: 'rename' + newName: 'MIDIOUTPROC' + - title: "Migrate to 'MONITORENUMPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'MonitorEnumProc' + changes: + - kind: 'rename' + newName: 'MONITORENUMPROC' + - title: "Migrate to 'PENUM_PAGE_FILE_CALLBACK'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'EnumPageFilesProc' + changes: + - kind: 'rename' + newName: 'PENUM_PAGE_FILE_CALLBACK' + - title: "Migrate to 'PFN_SC_NOTIFY_CALLBACK'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'PfnScNotifyCallbackFunction' + changes: + - kind: 'rename' + newName: 'PFN_SC_NOTIFY_CALLBACK' + - title: "Migrate to 'PFN_AUTHENTICATION_CALLBACK_EX'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'PfnAuthenticationCallbackEx' + changes: + - kind: 'rename' + newName: 'PFN_AUTHENTICATION_CALLBACK_EX' + - title: "Migrate to 'PFNBLUETOOTH_GATT_EVENT_CALLBACK'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'PfnbluetoothGattEventCallback' + changes: + - kind: 'rename' + newName: 'PFNBLUETOOTH_GATT_EVENT_CALLBACK' + - title: "Migrate to 'PFN_BLUETOOTH_ENUM_ATTRIBUTES_CALLBACK'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'PfnBluetoothEnumAttributesCallback' + changes: + - kind: 'rename' + newName: 'PFN_BLUETOOTH_ENUM_ATTRIBUTES_CALLBACK' + - title: "Migrate to 'PFN_DEVICE_CALLBACK'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'PfnDeviceCallback' + changes: + - kind: 'rename' + newName: 'PFN_DEVICE_CALLBACK' + - title: "Migrate to 'PFTASKDIALOGCALLBACK'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'TaskDialogCallbackProc' + changes: + - kind: 'rename' + newName: 'PFTASKDIALOGCALLBACK' + - title: "Migrate to 'PHANDLER_ROUTINE'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'HandlerRoutine' + changes: + - kind: 'rename' + newName: 'PHANDLER_ROUTINE' + - title: "Migrate to 'PSYM_ENUMERATESYMBOLS_CALLBACK'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'SymEnumSymbolsProc' + changes: + - kind: 'rename' + newName: 'PSYM_ENUMERATESYMBOLS_CALLBACK' + - title: "Migrate to 'SENDASYNCPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'SendAsyncProc' + changes: + - kind: 'rename' + newName: 'SENDASYNCPROC' + - title: "Migrate to 'SPNOTIFYCALLBACK'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'SpNotifyCallback' + changes: + - kind: 'rename' + newName: 'SPNOTIFYCALLBACK' + - title: "Migrate to 'SUBCLASSPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'SubclassProc' + changes: + - kind: 'rename' + newName: 'SUBCLASSPROC' + - title: "Migrate to 'TIMERPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'TimerProc' + changes: + - kind: 'rename' + newName: 'TIMERPROC' + - title: "Migrate to 'WLAN_NOTIFICATION_CALLBACK'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'WlanNotificationCallback' + changes: + - kind: 'rename' + newName: 'WLAN_NOTIFICATION_CALLBACK' + - title: "Migrate to 'WNDENUMPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'EnumWindowsProc' + changes: + - kind: 'rename' + newName: 'WNDENUMPROC' + - title: "Migrate to 'WNDPROC'" + date: 2024-03-05 + element: + uris: ['package:win32/win32.dart'] + typedef: 'WindowProc' + changes: + - kind: 'rename' + newName: 'WNDPROC' diff --git a/lib/src/callbacks.dart b/lib/src/callbacks.dart index c19366999..0240ae7a5 100644 --- a/lib/src/callbacks.dart +++ b/lib/src/callbacks.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// ignore_for_file: non_constant_identifier_names +// ignore_for_file: camel_case_types, non_constant_identifier_names // Native callback functions that can get called by the Win32 API @@ -13,106 +13,162 @@ import 'package:ffi/ffi.dart'; import 'structs.g.dart'; import 'types.dart'; +@Deprecated('Use HOOKPROC instead') +typedef CallWndProc = HOOKPROC; + /// An application-defined or library-defined callback function used with the /// SetWindowsHookEx function. The system calls this function before calling the /// window procedure to process a message sent to the thread. -typedef CallWndProc = LRESULT Function( - Int32 nCode, WPARAM wParam, LPARAM lParam); +typedef HOOKPROC = LRESULT Function(Int32 nCode, WPARAM wParam, LPARAM lParam); + +@Deprecated('Use LPCCHOOKPROC instead') +typedef CCHookProc = LPCCHOOKPROC; /// Application-defined callback function used with the ChooseColor function. /// Receives messages or notifications intended for the default dialog box /// procedure of the Color dialog box. -typedef CCHookProc = UINT_PTR Function(HWND, UINT, WPARAM, LPARAM); +typedef LPCCHOOKPROC = UINT_PTR Function(HWND, UINT, WPARAM, LPARAM); + +@Deprecated('Use LPCFHOOKPROC instead') +typedef CFHookProc = LPCFHOOKPROC; /// Application-defined callback function used with the ChooseFont function. /// Receives messages or notifications intended for the default dialog box /// procedure of the Font dialog box. -typedef CFHookProc = UINT_PTR Function(HWND, UINT, WPARAM, LPARAM); +typedef LPCFHOOKPROC = UINT_PTR Function(HWND, UINT, WPARAM, LPARAM); + +@Deprecated('Use DLGPROC instead') +typedef DlgProc = DLGPROC; /// Application-defined callback function used with the CreateDialog and /// DialogBox families of functions. It processes messages sent to a modal or /// modeless dialog box. -typedef DlgProc = INT_PTR Function(HWND, UINT, WPARAM, LPARAM); +typedef DLGPROC = INT_PTR Function(HWND, UINT, WPARAM, LPARAM); + +@Deprecated('Use DTT_CALLBACK_PROC instead') +typedef DrawTextCallback = DTT_CALLBACK_PROC; /// Application-defined callback function used with the DrawThemeTextEx /// function. This function is used instead of DrawText. -typedef DrawTextCallback = Int32 Function(HDC hdc, LPWSTR pszText, +typedef DTT_CALLBACK_PROC = Int32 Function(HDC hdc, LPWSTR pszText, Int32 cchText, Pointer prc, UINT dwFlags, LPARAM lparam); +@Deprecated('Use DRAWSTATEPROC instead') +typedef DrawStateProc = DRAWSTATEPROC; + /// Application-defined callback function that renders a complex image for the /// DrawState function. -typedef DrawStateProc = Int32 Function( +typedef DRAWSTATEPROC = Int32 Function( IntPtr hdc, IntPtr lData, IntPtr wData, Int32 cx, Int32 cy); +@Deprecated('Use PENUM_PAGE_FILE_CALLBACK instead') +typedef EnumPageFilesProc = PENUM_PAGE_FILE_CALLBACK; + /// Application-defined callback function used with the EnumPageFiles function. -typedef EnumPageFilesProc = BOOL Function(PVOID pContext, +typedef PENUM_PAGE_FILE_CALLBACK = BOOL Function(PVOID pContext, Pointer pPageFileInfo, LPWSTR lpFilename); +@Deprecated('Use WNDENUMPROC instead') +typedef EnumWindowsProc = WNDENUMPROC; + /// Application-defined callback function used with the EnumChildWindows /// function. It receives the child window handles. -typedef EnumWindowsProc = BOOL Function(HWND hwnd, LPARAM lParam); +typedef WNDENUMPROC = BOOL Function(HWND hwnd, LPARAM lParam); + +@Deprecated('Use FONTENUMPROC instead') +typedef EnumFontFamExProc = FONTENUMPROC; /// Application defined callback function used with the EnumFontFamiliesEx /// function. It is used to process the fonts. -typedef EnumFontFamExProc = Int32 Function(Pointer lpelfe, +typedef FONTENUMPROC = Int32 Function(Pointer lpelfe, Pointer lpntme, DWORD FontType, LPARAM lParam); +@Deprecated('Use ENUMRESNAMEPROC instead') +typedef EnumResNameProc = ENUMRESNAMEPROC; + /// Application-defined callback function used with the EnumResourceNames and /// EnumResourceNamesEx functions. It receives the type and name of a resource. -typedef EnumResNameProc = BOOL Function(HMODULE hModule, Pointer lpType, +typedef ENUMRESNAMEPROC = BOOL Function(HMODULE hModule, Pointer lpType, Pointer lpName, LONG_PTR lParam); +@Deprecated('Use ENUMRESTYPEPROC instead') +typedef EnumResTypeProc = ENUMRESTYPEPROC; + /// Application-defined callback function used with the EnumResourceTypes and /// EnumResourceTypesEx functions. It receives resource types. -typedef EnumResTypeProc = BOOL Function( +typedef ENUMRESTYPEPROC = BOOL Function( HMODULE hModule, Pointer lpszType, LONG_PTR lParam); +@Deprecated('Use LPEXCEPFINO_DEFERRED_FILLIN instead') +typedef ExcepInfoProc = IntPtr Function(Pointer); + /// Application-defined callback function used with the IDispatch::Invoke /// function to defer filling in bstrDescription, bstrHelpFile, and /// dwHelpContext fields until they are needed. -typedef ExcepInfoProc = IntPtr Function(Pointer); +typedef LPEXCEPFINO_DEFERRED_FILLIN = IntPtr Function(Pointer); + +@Deprecated('Use LPFRHOOKPROC instead') +typedef FRHookProc = LPFRHOOKPROC; /// Application-defined callback function used with the FindText or ReplaceText /// function. Receives messages or notifications intended for the default dialog /// box procedure of the Find or Replace dialog box. -typedef FRHookProc = UINT_PTR Function(HWND, UINT, WPARAM, LPARAM); +typedef LPFRHOOKPROC = UINT_PTR Function(HWND, UINT, WPARAM, LPARAM); + +@Deprecated('Use PHANDLER_ROUTINE instead') +typedef HandlerRoutine = PHANDLER_ROUTINE; /// Application-defined callback function used with the SetConsoleCtrlHandler /// function. A console process uses this function to handle control signals /// received by the process. When the signal is received, the system creates a /// new thread in the process to execute the function. -typedef HandlerRoutine = BOOL Function(DWORD dwCtrlType); +typedef PHANDLER_ROUTINE = BOOL Function(DWORD dwCtrlType); + +@Deprecated('Use LPHANDLER_FUNCTION instead') +typedef LphandlerFunction = LPHANDLER_FUNCTION; /// Application-defined callback function used with the /// RegisterServiceCtrlHandler function. A service program can use it as the /// control handler function of a particular service. -typedef LphandlerFunction = Void Function(DWORD dwControl); +typedef LPHANDLER_FUNCTION = Void Function(DWORD dwControl); + +@Deprecated('Use LPHANDLER_FUNCTION_EX instead') +typedef LphandlerFunctionEx = LPHANDLER_FUNCTION_EX; /// Application-defined callback function used with the /// RegisterServiceCtrlHandlerEx function. A service program can use it as the /// control handler function of a particular service. -typedef LphandlerFunctionEx = DWORD Function( +typedef LPHANDLER_FUNCTION_EX = DWORD Function( DWORD dwControl, DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext); +@Deprecated('Use LPOVERLAPPED_COMPLETION_ROUTINE instead') +typedef LpoverlappedCompletionRoutine = LPOVERLAPPED_COMPLETION_ROUTINE; + /// Application-defined callback function used with the ReadFileEx and /// WriteFileEx functions. It is called when the asynchronous input and output /// (I/O) operation is completed or canceled and the calling thread is in an /// alertable state (by using the SleepEx, MsgWaitForMultipleObjectsEx, /// WaitForSingleObjectEx, or WaitForMultipleObjectsEx function with the /// fAlertable parameter set to TRUE). -typedef LpoverlappedCompletionRoutine = Void Function(DWORD dwErrorCode, +typedef LPOVERLAPPED_COMPLETION_ROUTINE = Void Function(DWORD dwErrorCode, DWORD dwNumberOfBytesTransfered, OVERLAPPED lpOverlapped); +@Deprecated('Use LPSERVICE_MAIN_FUNCTION instead') +typedef LpserviceMainFunctionw = LPSERVICE_MAIN_FUNCTION; + /// Application-defined callback function used as the entry point for a service. /// The LPSERVICE_MAIN_FUNCTION type defines a pointer to this callback /// function. ServiceMain is a placeholder for an application-defined function /// name. -typedef LpserviceMainFunctionw = Void Function( +typedef LPSERVICE_MAIN_FUNCTION = Void Function( DWORD dwNumServicesArgs, Pointer lpServiceArgVectors); +@Deprecated('Use PFN_SC_NOTIFY_CALLBACK instead') +typedef PfnScNotifyCallbackFunction = PFN_SC_NOTIFY_CALLBACK; + /// Application-defined callback function that receives a pointer to the /// SERVICE_NOTIFY structure provided by the caller. -typedef PfnScNotifyCallbackFunction = PVOID Function(PVOID pParameter); +typedef PFN_SC_NOTIFY_CALLBACK = PVOID Function(PVOID pParameter); /// Application-defined callback function implements a custom transform for /// image scaling. @@ -126,112 +182,176 @@ typedef MagImageScalingCallback = BOOL Function( RECT clipped, HRGN dirty); +@Deprecated('Use MIDIINPROC instead') +typedef MidiInProc = MIDIINPROC; + /// Application-defined callback function for handling incoming MIDI messages. /// MidiInProc is a placeholder for the application-supplied function name. The /// address of this function can be specified in the callback-address parameter /// of the midiInOpen function. -typedef MidiInProc = Void Function(HMIDIIN hMidiIn, UINT wMsg, +typedef MIDIINPROC = Void Function(HMIDIIN hMidiIn, UINT wMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2); +@Deprecated('Use MIDIOUTPROC instead') +typedef MidiOutProc = MIDIOUTPROC; + /// Application-defined callback function for handling outgoing MIDI messages. /// MidiOutProc is a placeholder for the application-supplied function name. The /// address of the function can be specified in the callback-address parameter /// of the midiOutOpen function. -typedef MidiOutProc = Void Function(IntPtr hmo, Uint32 wMsg, IntPtr dwInstance, +typedef MIDIOUTPROC = Void Function(IntPtr hmo, Uint32 wMsg, IntPtr dwInstance, IntPtr dwParam1, IntPtr dwParam2); +@Deprecated('Use MONITORENUMPROC instead') +typedef MonitorEnumProc = MONITORENUMPROC; + /// Application-defined callback function used with the EnumDisplayMonitors /// function. It receives display monitors in the calculated enumeration set. -typedef MonitorEnumProc = Int32 Function( +typedef MONITORENUMPROC = Int32 Function( IntPtr hMonitor, IntPtr hDC, Pointer lpRect, IntPtr lParam); +@Deprecated('Use LPOFNHOOKPROC instead') +typedef OFNHookProc = LPOFNHOOKPROC; + /// Application-defined callback function used with the Explorer-style Open and /// Save As dialog boxes. Receives notification messages sent from the dialog /// box. The function also receives messages for any additional controls that /// you defined by specifying a child dialog template. -typedef OFNHookProc = UINT_PTR Function(HWND, UINT, WPARAM, LPARAM); +typedef LPOFNHOOKPROC = UINT_PTR Function(HWND, UINT, WPARAM, LPARAM); + +@Deprecated('Use GRAYSTRINGPROC instead') +typedef OutputProc = GRAYSTRINGPROC; /// Application-defined callback function used with the GrayString function. It /// is used to draw a string. -typedef OutputProc = Int32 Function(IntPtr Arg1, IntPtr Arg2, Int32 Arg3); +typedef GRAYSTRINGPROC = Int32 Function(IntPtr Arg1, IntPtr Arg2, Int32 Arg3); + +@Deprecated('Use PFN_AUTHENTICATION_CALLBACK_EX instead') +typedef PfnAuthenticationCallbackEx = PFN_AUTHENTICATION_CALLBACK_EX; /// Application-defined callback function used with the /// BluetoothRegisterForAuthenticationEx function. -typedef PfnAuthenticationCallbackEx = Int32 Function(Pointer pvParam, +typedef PFN_AUTHENTICATION_CALLBACK_EX = Int32 Function(Pointer pvParam, Pointer pAuthCallbackParams); +@Deprecated('Use PFNBLUETOOTH_GATT_EVENT_CALLBACK instead') +typedef PfnbluetoothGattEventCallback = PFNBLUETOOTH_GATT_EVENT_CALLBACK; + /// Application-defined callback function used with profile drivers to implement /// a Bluetooth GATT event callback to be called whenever the value of a /// specific characteristic changes. -typedef PfnbluetoothGattEventCallback = Void Function( +typedef PFNBLUETOOTH_GATT_EVENT_CALLBACK = Void Function( Int32 EventType, Pointer EventOutParameter, Pointer Context); +@Deprecated('Use PFN_BLUETOOTH_ENUM_ATTRIBUTES_CALLBACK instead') +typedef PfnBluetoothEnumAttributesCallback + = PFN_BLUETOOTH_ENUM_ATTRIBUTES_CALLBACK; + /// Application-defined callback function that is called once for each attribute /// found in the pSDPStream parameter passed to the BluetoothSdpEnumAttributes /// function call. -typedef PfnBluetoothEnumAttributesCallback = BOOL Function( +typedef PFN_BLUETOOTH_ENUM_ATTRIBUTES_CALLBACK = BOOL Function( ULONG uAttribId, LPBYTE pValueStream, ULONG cbStreamSize, LPVOID pvParam); +@Deprecated('Use PFN_DEVICE_CALLBACK instead') +typedef PfnDeviceCallback = PFN_DEVICE_CALLBACK; + /// Application-defined callback function used in association with selecting /// Bluetooth devices. The PFN_DEVICE_CALLBACK function can be set to NULL if no /// specialized filtering is required. -typedef PfnDeviceCallback = BOOL Function( +typedef PFN_DEVICE_CALLBACK = BOOL Function( LPVOID pvParam, Pointer pDevice); +@Deprecated('Use SENDASYNCPROC instead') +typedef SendAsyncProc = SENDASYNCPROC; + /// Application-defined callback function used with the SendMessageCallback /// function. The system passes the message to the callback function after /// passing the message to the destination window procedure. The SENDASYNCPROC /// type defines a pointer to this callback function. SendAsyncProc is a /// placeholder for the application-defined function name. -typedef SendAsyncProc = Void Function(IntPtr, Uint32, IntPtr, IntPtr); +typedef SENDASYNCPROC = Void Function(IntPtr, Uint32, IntPtr, IntPtr); + +@Deprecated('Use SPNOTIFYCALLBACK instead') +typedef SpNotifyCallback = SPNOTIFYCALLBACK; // Application-defined callback function used with SAPI clients to receive // notifications. -typedef SpNotifyCallback = Void Function(WPARAM wParam, LPARAM lParam); +typedef SPNOTIFYCALLBACK = Void Function(WPARAM wParam, LPARAM lParam); + +@Deprecated('Use SUBCLASSPROC instead') +typedef SubclassProc = SUBCLASSPROC; /// Application-defined callback function used with the RemoveWindowSubclass /// and SetWindowSubclass functions. -typedef SubclassProc = LRESULT Function(HWND hWnd, UINT uMsg, WPARAM wParam, +typedef SUBCLASSPROC = LRESULT Function(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData); +@Deprecated('Use PSYM_ENUMERATESYMBOLS_CALLBACK instead') +typedef SymEnumSymbolsProc = PSYM_ENUMERATESYMBOLS_CALLBACK; + /// Application-defined callback function used with the SymEnumSymbols, /// SymEnumTypes, and SymEnumTypesByName functions. -typedef SymEnumSymbolsProc = Int32 Function( +typedef PSYM_ENUMERATESYMBOLS_CALLBACK = Int32 Function( Pointer pSymInfo, Uint32 SymbolSize, Pointer UserContext); +@Deprecated('Use PFTASKDIALOGCALLBACK instead') +typedef TaskDialogCallbackProc = PFTASKDIALOGCALLBACK; + /// Application-defined callback function used with the TaskDialogIndirect /// function. It receives messages from the task dialog when various events /// occur. -typedef TaskDialogCallbackProc = IntPtr Function( +typedef PFTASKDIALOGCALLBACK = IntPtr Function( IntPtr hwnd, Uint32 uMsg, IntPtr wParam, IntPtr lParam, IntPtr lpRefData); +@Deprecated('Use LPTHREAD_START_ROUTINE instead') +typedef ThreadProc = LPTHREAD_START_ROUTINE; + /// Application-defined callback function that serves as the starting address /// for a thread. Specify this address when calling the CreateThread, /// CreateRemoteThread, or CreateRemoteThreadEx function. -typedef ThreadProc = DWORD Function(Pointer lpParameter); +typedef LPTHREAD_START_ROUTINE = DWORD Function(Pointer lpParameter); + +@Deprecated('Use TIMERPROC instead') +typedef TimerProc = TIMERPROC; /// Application-defined callback function that processes WM_TIMER messages. -typedef TimerProc = Void Function(IntPtr, Uint32, Pointer, Int32); +typedef TIMERPROC = Void Function(IntPtr, Uint32, Pointer, Int32); + +@Deprecated('Use WNDPROC instead') +typedef WindowProc = WNDPROC; /// Application-defined callback function that processes messages sent to a /// window. -typedef WindowProc = LRESULT Function( +typedef WNDPROC = LRESULT Function( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); +@Deprecated('Use WLAN_NOTIFICATION_CALLBACK instead') +typedef WlanNotificationCallback = WLAN_NOTIFICATION_CALLBACK; + /// Application-defined callback function that is used by an application to /// register and unregister notifications on all wireless interfaces. -typedef WlanNotificationCallback = Void Function( +typedef WLAN_NOTIFICATION_CALLBACK = Void Function( Pointer, Pointer); +@Deprecated('Use LPOCNCHKPROC instead') +typedef OpenCardCheckProc = LPOCNCHKPROC; + /// Application-defined callback function that provides special verification /// for smart card searches. -typedef OpenCardCheckProc = Int32 Function(IntPtr, IntPtr, Pointer); +typedef LPOCNCHKPROC = Int32 Function(IntPtr, IntPtr, Pointer); + +@Deprecated('Use LPOCNCONNPROC instead') +typedef OpenCardConnProc = LPOCNCONNPROC; /// Application-defined callback function that allows callers to perform /// additional processing to connect to the smart card. -typedef OpenCardConnProc = IntPtr Function( +typedef LPOCNCONNPROC = IntPtr Function( IntPtr, Pointer, Pointer, Pointer); +@Deprecated('Use LPOCNDSCPROC instead') +typedef OpenCardDisconnProc = LPOCNDSCPROC; + /// Application-defined callback function that can be used for disconnecting /// smart cards. -typedef OpenCardDisconnProc = Void Function(IntPtr, IntPtr, Pointer); +typedef LPOCNDSCPROC = Void Function(IntPtr, IntPtr, Pointer); diff --git a/lib/src/com/ispnotifysource.dart b/lib/src/com/ispnotifysource.dart index 12ecbac06..3f855631b 100644 --- a/lib/src/com/ispnotifysource.dart +++ b/lib/src/com/ispnotifysource.dart @@ -62,7 +62,7 @@ class ISpNotifySource extends IUnknown { int lParam)>()(ptr.ref.lpVtbl, hWnd, Msg, wParam, lParam); int setNotifyCallbackFunction( - Pointer>> pfnCallback, + Pointer>> pfnCallback, int wParam, int lParam) => (ptr.ref.vtable + 5) @@ -71,7 +71,7 @@ class ISpNotifySource extends IUnknown { NativeFunction< Int32 Function( Pointer, - Pointer>> + Pointer>> pfnCallback, IntPtr wParam, IntPtr lParam)>>>() @@ -79,7 +79,7 @@ class ISpNotifySource extends IUnknown { .asFunction< int Function( Pointer, - Pointer>> + Pointer>> pfnCallback, int wParam, int lParam)>()(ptr.ref.lpVtbl, pfnCallback, wParam, lParam); diff --git a/lib/src/inline.dart b/lib/src/inline.dart index 5c8df17d2..b9ca96463 100644 --- a/lib/src/inline.dart +++ b/lib/src/inline.dart @@ -74,7 +74,7 @@ int CreateWindow( /// ``` /// {@category user32} void DialogBoxIndirect(int hInstance, Pointer lpTemplate, - int hWndParent, Pointer> lpDialogFunc) => + int hWndParent, Pointer> lpDialogFunc) => DialogBoxIndirectParam(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0); /// Retrieves a pseudo-handle that you can use as a shorthand way to refer to diff --git a/lib/src/structs.g.dart b/lib/src/structs.g.dart index f412c60f4..3fc990c8e 100644 --- a/lib/src/structs.g.dart +++ b/lib/src/structs.g.dart @@ -715,7 +715,7 @@ base class BLUETOOTH_SELECT_DEVICE_PARAMS extends Struct { @Int32() external int fSkipServicesPage; - external Pointer> pfnDeviceCallback; + external Pointer> pfnDeviceCallback; external Pointer pvParam; @@ -1367,7 +1367,7 @@ base class CHOOSECOLOR extends Struct { @IntPtr() external int lCustData; - external Pointer> lpfnHook; + external Pointer> lpfnHook; external Pointer lpTemplateName; } @@ -1401,7 +1401,7 @@ base class CHOOSEFONT extends Struct { @IntPtr() external int lCustData; - external Pointer> lpfnHook; + external Pointer> lpfnHook; external Pointer lpTemplateName; @@ -3153,7 +3153,7 @@ base class DTTOPTS extends Struct { @Int32() external int iGlowSize; - external Pointer> pfnDrawTextCallback; + external Pointer> pfnDrawTextCallback; @IntPtr() external int lParam; @@ -3383,7 +3383,8 @@ base class EXCEPINFO extends Struct { external Pointer pvReserved; - external Pointer> pfnDeferredFillIn; + external Pointer> + pfnDeferredFillIn; @Int32() external int scode; @@ -3466,7 +3467,7 @@ base class FINDREPLACE extends Struct { @IntPtr() external int lCustData; - external Pointer> lpfnHook; + external Pointer> lpfnHook; external Pointer lpTemplateName; } @@ -6390,11 +6391,11 @@ base class OPENCARDNAME extends Struct { @Uint32() external int dwActiveProtocol; - external Pointer> lpfnConnect; + external Pointer> lpfnConnect; - external Pointer> lpfnCheck; + external Pointer> lpfnCheck; - external Pointer> lpfnDisconnect; + external Pointer> lpfnDisconnect; @IntPtr() external int hCardHandle; @@ -6427,7 +6428,7 @@ base class OPENCARDNAME_EX extends Struct { external Pointer pOpenCardSearchCriteria; - external Pointer> lpfnConnect; + external Pointer> lpfnConnect; external Pointer pvUserData; @@ -6479,11 +6480,11 @@ base class OPENCARD_SEARCH_CRITERIA extends Struct { @Uint32() external int nMaxCardNames; - external Pointer> lpfnCheck; + external Pointer> lpfnCheck; - external Pointer> lpfnConnect; + external Pointer> lpfnConnect; - external Pointer> lpfnDisconnect; + external Pointer> lpfnDisconnect; external Pointer pvUserData; @@ -6548,7 +6549,7 @@ base class OPENFILENAME extends Struct { @IntPtr() external int lCustData; - external Pointer> lpfnHook; + external Pointer> lpfnHook; external Pointer lpTemplateName; @@ -8240,8 +8241,7 @@ base class SERVICE_NOTIFY_2 extends Struct { @Uint32() external int dwVersion; - external Pointer> - pfnNotifyCallback; + external Pointer> pfnNotifyCallback; external Pointer pContext; @@ -8361,7 +8361,7 @@ base class SERVICE_STATUS_PROCESS extends Struct { base class SERVICE_TABLE_ENTRY extends Struct { external Pointer lpServiceName; - external Pointer> lpServiceProc; + external Pointer> lpServiceProc; } /// Contains system time change settings. @@ -9646,7 +9646,7 @@ base class TASKDIALOGCONFIG extends Struct { external Pointer pszFooter; - external Pointer> pfCallback; + external Pointer> pfCallback; @IntPtr() external int lpCallbackData; @@ -11332,7 +11332,7 @@ base class WNDCLASSEX extends Struct { @Uint32() external int style; - external Pointer> lpfnWndProc; + external Pointer> lpfnWndProc; @Int32() external int cbClsExtra; @@ -11368,7 +11368,7 @@ base class WNDCLASS extends Struct { @Uint32() external int style; - external Pointer> lpfnWndProc; + external Pointer> lpfnWndProc; @Int32() external int cbClsExtra; diff --git a/lib/src/win32/advapi32.g.dart b/lib/src/win32/advapi32.g.dart index 865579fa1..46379a088 100644 --- a/lib/src/win32/advapi32.g.dart +++ b/lib/src/win32/advapi32.g.dart @@ -1334,14 +1334,14 @@ final _RegGetValue = _advapi32.lookupFunction< /// ``` /// {@category advapi32} int RegisterServiceCtrlHandler(Pointer lpServiceName, - Pointer> lpHandlerProc) => + Pointer> lpHandlerProc) => _RegisterServiceCtrlHandler(lpServiceName, lpHandlerProc); final _RegisterServiceCtrlHandler = _advapi32.lookupFunction< IntPtr Function(Pointer lpServiceName, - Pointer> lpHandlerProc), + Pointer> lpHandlerProc), int Function(Pointer lpServiceName, - Pointer> lpHandlerProc)>( + Pointer> lpHandlerProc)>( 'RegisterServiceCtrlHandlerW'); /// Registers a function to handle extended service control requests. @@ -1356,18 +1356,18 @@ final _RegisterServiceCtrlHandler = _advapi32.lookupFunction< /// {@category advapi32} int RegisterServiceCtrlHandlerEx( Pointer lpServiceName, - Pointer> lpHandlerProc, + Pointer> lpHandlerProc, Pointer lpContext) => _RegisterServiceCtrlHandlerEx(lpServiceName, lpHandlerProc, lpContext); final _RegisterServiceCtrlHandlerEx = _advapi32.lookupFunction< IntPtr Function( Pointer lpServiceName, - Pointer> lpHandlerProc, + Pointer> lpHandlerProc, Pointer lpContext), int Function( Pointer lpServiceName, - Pointer> lpHandlerProc, + Pointer> lpHandlerProc, Pointer lpContext)>('RegisterServiceCtrlHandlerExW'); /// Loads the specified registry hive as an application hive. diff --git a/lib/src/win32/bluetoothapis.g.dart b/lib/src/win32/bluetoothapis.g.dart index e3284dd38..9b6d4353b 100644 --- a/lib/src/win32/bluetoothapis.g.dart +++ b/lib/src/win32/bluetoothapis.g.dart @@ -525,7 +525,7 @@ int BluetoothGATTRegisterEvent( int hService, int EventType, Pointer EventParameterIn, - Pointer> Callback, + Pointer> Callback, Pointer CallbackContext, Pointer pEventHandle, int Flags) => @@ -537,7 +537,7 @@ final _BluetoothGATTRegisterEvent = _bluetoothapis.lookupFunction< IntPtr hService, Int32 EventType, Pointer EventParameterIn, - Pointer> Callback, + Pointer> Callback, Pointer CallbackContext, Pointer pEventHandle, Uint32 Flags), @@ -545,7 +545,7 @@ final _BluetoothGATTRegisterEvent = _bluetoothapis.lookupFunction< int hService, int EventType, Pointer EventParameterIn, - Pointer> Callback, + Pointer> Callback, Pointer CallbackContext, Pointer pEventHandle, int Flags)>('BluetoothGATTRegisterEvent'); @@ -730,7 +730,7 @@ final _BluetoothIsVersionAvailable = _bluetoothapis.lookupFunction< int BluetoothRegisterForAuthenticationEx( Pointer pbtdiIn, Pointer phRegHandleOut, - Pointer> pfnCallbackIn, + Pointer> pfnCallbackIn, Pointer pvParam) => _BluetoothRegisterForAuthenticationEx( pbtdiIn, phRegHandleOut, pfnCallbackIn, pvParam); @@ -739,12 +739,12 @@ final _BluetoothRegisterForAuthenticationEx = _bluetoothapis.lookupFunction< Uint32 Function( Pointer pbtdiIn, Pointer phRegHandleOut, - Pointer> pfnCallbackIn, + Pointer> pfnCallbackIn, Pointer pvParam), int Function( Pointer pbtdiIn, Pointer phRegHandleOut, - Pointer> pfnCallbackIn, + Pointer> pfnCallbackIn, Pointer pvParam)>('BluetoothRegisterForAuthenticationEx'); /// The BluetoothRemoveDevice function removes authentication between a @@ -780,7 +780,8 @@ final _BluetoothRemoveDevice = _bluetoothapis.lookupFunction< int BluetoothSdpEnumAttributes( Pointer pSDPStream, int cbStreamSize, - Pointer> pfnCallback, + Pointer> + pfnCallback, Pointer pvParam) => _BluetoothSdpEnumAttributes(pSDPStream, cbStreamSize, pfnCallback, pvParam); @@ -788,12 +789,14 @@ final _BluetoothSdpEnumAttributes = _bluetoothapis.lookupFunction< Int32 Function( Pointer pSDPStream, Uint32 cbStreamSize, - Pointer> pfnCallback, + Pointer> + pfnCallback, Pointer pvParam), int Function( Pointer pSDPStream, int cbStreamSize, - Pointer> pfnCallback, + Pointer> + pfnCallback, Pointer pvParam)>('BluetoothSdpEnumAttributes'); /// The BluetoothSdpGetAttributeValue function retrieves the attribute value diff --git a/lib/src/win32/comctl32.g.dart b/lib/src/win32/comctl32.g.dart index fcc94f9d4..f0d952de1 100644 --- a/lib/src/win32/comctl32.g.dart +++ b/lib/src/win32/comctl32.g.dart @@ -91,13 +91,13 @@ final _InitCommonControlsEx = _comctl32.lookupFunction< /// ``` /// {@category comctl32} int RemoveWindowSubclass(int hWnd, - Pointer> pfnSubclass, int uIdSubclass) => + Pointer> pfnSubclass, int uIdSubclass) => _RemoveWindowSubclass(hWnd, pfnSubclass, uIdSubclass); final _RemoveWindowSubclass = _comctl32.lookupFunction< Int32 Function(IntPtr hWnd, - Pointer> pfnSubclass, IntPtr uIdSubclass), - int Function(int hWnd, Pointer> pfnSubclass, + Pointer> pfnSubclass, IntPtr uIdSubclass), + int Function(int hWnd, Pointer> pfnSubclass, int uIdSubclass)>('RemoveWindowSubclass'); /// Installs or updates a window subclass callback. @@ -113,7 +113,7 @@ final _RemoveWindowSubclass = _comctl32.lookupFunction< /// {@category comctl32} int SetWindowSubclass( int hWnd, - Pointer> pfnSubclass, + Pointer> pfnSubclass, int uIdSubclass, int dwRefData) => _SetWindowSubclass(hWnd, pfnSubclass, uIdSubclass, dwRefData); @@ -121,10 +121,10 @@ int SetWindowSubclass( final _SetWindowSubclass = _comctl32.lookupFunction< Int32 Function( IntPtr hWnd, - Pointer> pfnSubclass, + Pointer> pfnSubclass, IntPtr uIdSubclass, IntPtr dwRefData), - int Function(int hWnd, Pointer> pfnSubclass, + int Function(int hWnd, Pointer> pfnSubclass, int uIdSubclass, int dwRefData)>('SetWindowSubclass'); /// The TaskDialog function creates, displays, and operates a task dialog. diff --git a/lib/src/win32/dbghelp.g.dart b/lib/src/win32/dbghelp.g.dart index fa31f38f7..991f3957a 100644 --- a/lib/src/win32/dbghelp.g.dart +++ b/lib/src/win32/dbghelp.g.dart @@ -49,7 +49,8 @@ int SymEnumSymbols( int hProcess, int BaseOfDll, Pointer Mask, - Pointer> EnumSymbolsCallback, + Pointer> + EnumSymbolsCallback, Pointer UserContext) => _SymEnumSymbols( hProcess, BaseOfDll, Mask, EnumSymbolsCallback, UserContext); @@ -59,13 +60,15 @@ final _SymEnumSymbols = _dbghelp.lookupFunction< IntPtr hProcess, Uint64 BaseOfDll, Pointer Mask, - Pointer> EnumSymbolsCallback, + Pointer> + EnumSymbolsCallback, Pointer UserContext), int Function( int hProcess, int BaseOfDll, Pointer Mask, - Pointer> EnumSymbolsCallback, + Pointer> + EnumSymbolsCallback, Pointer UserContext)>('SymEnumSymbolsW'); /// Retrieves symbol information for the specified address. diff --git a/lib/src/win32/gdi32.g.dart b/lib/src/win32/gdi32.g.dart index b67ae3155..86c05cabd 100644 --- a/lib/src/win32/gdi32.g.dart +++ b/lib/src/win32/gdi32.g.dart @@ -647,7 +647,7 @@ final _EndPath = int EnumFontFamiliesEx( int hdc, Pointer lpLogfont, - Pointer> lpProc, + Pointer> lpProc, int lParam, int dwFlags) => _EnumFontFamiliesEx(hdc, lpLogfont, lpProc, lParam, dwFlags); @@ -656,13 +656,13 @@ final _EnumFontFamiliesEx = _gdi32.lookupFunction< Int32 Function( IntPtr hdc, Pointer lpLogfont, - Pointer> lpProc, + Pointer> lpProc, IntPtr lParam, Uint32 dwFlags), int Function( int hdc, Pointer lpLogfont, - Pointer> lpProc, + Pointer> lpProc, int lParam, int dwFlags)>('EnumFontFamiliesExW'); diff --git a/lib/src/win32/kernel32.g.dart b/lib/src/win32/kernel32.g.dart index f058f3f0e..8738a1d79 100644 --- a/lib/src/win32/kernel32.g.dart +++ b/lib/src/win32/kernel32.g.dart @@ -868,7 +868,7 @@ int CreateRemoteThread( int hProcess, Pointer lpThreadAttributes, int dwStackSize, - Pointer> lpStartAddress, + Pointer> lpStartAddress, Pointer lpParameter, int dwCreationFlags, Pointer lpThreadId) => @@ -880,7 +880,7 @@ final _CreateRemoteThread = _kernel32.lookupFunction< IntPtr hProcess, Pointer lpThreadAttributes, IntPtr dwStackSize, - Pointer> lpStartAddress, + Pointer> lpStartAddress, Pointer lpParameter, Uint32 dwCreationFlags, Pointer lpThreadId), @@ -888,7 +888,7 @@ final _CreateRemoteThread = _kernel32.lookupFunction< int hProcess, Pointer lpThreadAttributes, int dwStackSize, - Pointer> lpStartAddress, + Pointer> lpStartAddress, Pointer lpParameter, int dwCreationFlags, Pointer lpThreadId)>('CreateRemoteThread'); @@ -914,7 +914,7 @@ int CreateRemoteThreadEx( int hProcess, Pointer lpThreadAttributes, int dwStackSize, - Pointer> lpStartAddress, + Pointer> lpStartAddress, Pointer lpParameter, int dwCreationFlags, Pointer lpAttributeList, @@ -934,7 +934,7 @@ final _CreateRemoteThreadEx = _kernel32.lookupFunction< IntPtr hProcess, Pointer lpThreadAttributes, IntPtr dwStackSize, - Pointer> lpStartAddress, + Pointer> lpStartAddress, Pointer lpParameter, Uint32 dwCreationFlags, Pointer lpAttributeList, @@ -943,7 +943,7 @@ final _CreateRemoteThreadEx = _kernel32.lookupFunction< int hProcess, Pointer lpThreadAttributes, int dwStackSize, - Pointer> lpStartAddress, + Pointer> lpStartAddress, Pointer lpParameter, int dwCreationFlags, Pointer lpAttributeList, @@ -966,7 +966,7 @@ final _CreateRemoteThreadEx = _kernel32.lookupFunction< int CreateThread( Pointer lpThreadAttributes, int dwStackSize, - Pointer> lpStartAddress, + Pointer> lpStartAddress, Pointer lpParameter, int dwCreationFlags, Pointer lpThreadId) => @@ -977,14 +977,14 @@ final _CreateThread = _kernel32.lookupFunction< IntPtr Function( Pointer lpThreadAttributes, IntPtr dwStackSize, - Pointer> lpStartAddress, + Pointer> lpStartAddress, Pointer lpParameter, Uint32 dwCreationFlags, Pointer lpThreadId), int Function( Pointer lpThreadAttributes, int dwStackSize, - Pointer> lpStartAddress, + Pointer> lpStartAddress, Pointer lpParameter, int dwCreationFlags, Pointer lpThreadId)>('CreateThread'); @@ -1322,14 +1322,17 @@ final _K32EnumDeviceDrivers = _kernel32.lookupFunction< /// ); /// ``` /// {@category kernel32} -int EnumPageFiles(Pointer> pCallBackRoutine, +int EnumPageFiles( + Pointer> pCallBackRoutine, Pointer pContext) => _K32EnumPageFiles(pCallBackRoutine, pContext); final _K32EnumPageFiles = _kernel32.lookupFunction< - Int32 Function(Pointer> pCallBackRoutine, + Int32 Function( + Pointer> pCallBackRoutine, Pointer pContext), - int Function(Pointer> pCallBackRoutine, + int Function( + Pointer> pCallBackRoutine, Pointer pContext)>('K32EnumPageFilesW'); /// Retrieves the process identifier for each process object in the system. @@ -1418,16 +1421,16 @@ final _K32EnumProcessModulesEx = _kernel32.lookupFunction< /// ``` /// {@category kernel32} int EnumResourceNames(int hModule, Pointer lpType, - Pointer> lpEnumFunc, int lParam) => + Pointer> lpEnumFunc, int lParam) => _EnumResourceNames(hModule, lpType, lpEnumFunc, lParam); final _EnumResourceNames = _kernel32.lookupFunction< Int32 Function(IntPtr hModule, Pointer lpType, - Pointer> lpEnumFunc, IntPtr lParam), + Pointer> lpEnumFunc, IntPtr lParam), int Function( int hModule, Pointer lpType, - Pointer> lpEnumFunc, + Pointer> lpEnumFunc, int lParam)>('EnumResourceNamesW'); /// Enumerates resource types within a binary module. Starting with Windows @@ -1447,15 +1450,15 @@ final _EnumResourceNames = _kernel32.lookupFunction< /// ``` /// {@category kernel32} int EnumResourceTypes(int hModule, - Pointer> lpEnumFunc, int lParam) => + Pointer> lpEnumFunc, int lParam) => _EnumResourceTypes(hModule, lpEnumFunc, lParam); final _EnumResourceTypes = _kernel32.lookupFunction< Int32 Function(IntPtr hModule, - Pointer> lpEnumFunc, IntPtr lParam), + Pointer> lpEnumFunc, IntPtr lParam), int Function( int hModule, - Pointer> lpEnumFunc, + Pointer> lpEnumFunc, int lParam)>('EnumResourceTypesW'); /// Enumerates all system firmware tables of the specified type. @@ -5518,7 +5521,7 @@ int ReadFileEx( Pointer lpBuffer, int nNumberOfBytesToRead, Pointer lpOverlapped, - Pointer> + Pointer> lpCompletionRoutine) => _ReadFileEx(hFile, lpBuffer, nNumberOfBytesToRead, lpOverlapped, lpCompletionRoutine); @@ -5529,14 +5532,14 @@ final _ReadFileEx = _kernel32.lookupFunction< Pointer lpBuffer, Uint32 nNumberOfBytesToRead, Pointer lpOverlapped, - Pointer> + Pointer> lpCompletionRoutine), int Function( int hFile, Pointer lpBuffer, int nNumberOfBytesToRead, Pointer lpOverlapped, - Pointer> + Pointer> lpCompletionRoutine)>('ReadFileEx'); /// Reads data from a file and stores it in an array of buffers. The @@ -5828,13 +5831,13 @@ final _SetCommTimeouts = _kernel32.lookupFunction< /// ``` /// {@category kernel32} int SetConsoleCtrlHandler( - Pointer> HandlerRoutine, int Add) => + Pointer> HandlerRoutine, int Add) => _SetConsoleCtrlHandler(HandlerRoutine, Add); final _SetConsoleCtrlHandler = _kernel32.lookupFunction< Int32 Function( - Pointer> HandlerRoutine, Int32 Add), - int Function(Pointer> HandlerRoutine, + Pointer> HandlerRoutine, Int32 Add), + int Function(Pointer> HandlerRoutine, int Add)>('SetConsoleCtrlHandler'); /// Sets the size and visibility of the cursor for the specified console @@ -7275,7 +7278,7 @@ int WriteFileEx( Pointer lpBuffer, int nNumberOfBytesToWrite, Pointer lpOverlapped, - Pointer> + Pointer> lpCompletionRoutine) => _WriteFileEx(hFile, lpBuffer, nNumberOfBytesToWrite, lpOverlapped, lpCompletionRoutine); @@ -7286,14 +7289,14 @@ final _WriteFileEx = _kernel32.lookupFunction< Pointer lpBuffer, Uint32 nNumberOfBytesToWrite, Pointer lpOverlapped, - Pointer> + Pointer> lpCompletionRoutine), int Function( int hFile, Pointer lpBuffer, int nNumberOfBytesToWrite, Pointer lpOverlapped, - Pointer> + Pointer> lpCompletionRoutine)>('WriteFileEx'); /// Retrieves data from an array of buffers and writes the data to a file. diff --git a/lib/src/win32/user32.g.dart b/lib/src/win32/user32.g.dart index babba8765..934922b18 100644 --- a/lib/src/win32/user32.g.dart +++ b/lib/src/win32/user32.g.dart @@ -450,14 +450,14 @@ final _CallNextHookEx = _user32.lookupFunction< /// ); /// ``` /// {@category user32} -int CallWindowProc(Pointer> lpPrevWndFunc, int hWnd, +int CallWindowProc(Pointer> lpPrevWndFunc, int hWnd, int Msg, int wParam, int lParam) => _CallWindowProc(lpPrevWndFunc, hWnd, Msg, wParam, lParam); final _CallWindowProc = _user32.lookupFunction< - IntPtr Function(Pointer> lpPrevWndFunc, - IntPtr hWnd, Uint32 Msg, IntPtr wParam, IntPtr lParam), - int Function(Pointer> lpPrevWndFunc, int hWnd, + IntPtr Function(Pointer> lpPrevWndFunc, IntPtr hWnd, + Uint32 Msg, IntPtr wParam, IntPtr lParam), + int Function(Pointer> lpPrevWndFunc, int hWnd, int Msg, int wParam, int lParam)>('CallWindowProcW'); /// Cascades the specified child windows of the specified parent window. @@ -1008,7 +1008,7 @@ int CreateDialogIndirectParam( int hInstance, Pointer lpTemplate, int hWndParent, - Pointer> lpDialogFunc, + Pointer> lpDialogFunc, int dwInitParam) => _CreateDialogIndirectParam( hInstance, lpTemplate, hWndParent, lpDialogFunc, dwInitParam); @@ -1018,13 +1018,13 @@ final _CreateDialogIndirectParam = _user32.lookupFunction< IntPtr hInstance, Pointer lpTemplate, IntPtr hWndParent, - Pointer> lpDialogFunc, + Pointer> lpDialogFunc, IntPtr dwInitParam), int Function( int hInstance, Pointer lpTemplate, int hWndParent, - Pointer> lpDialogFunc, + Pointer> lpDialogFunc, int dwInitParam)>('CreateDialogIndirectParamW'); /// Creates an icon that has the specified size, colors, and bit patterns. @@ -1514,7 +1514,7 @@ int DialogBoxIndirectParam( int hInstance, Pointer hDialogTemplate, int hWndParent, - Pointer> lpDialogFunc, + Pointer> lpDialogFunc, int dwInitParam) => _DialogBoxIndirectParam( hInstance, hDialogTemplate, hWndParent, lpDialogFunc, dwInitParam); @@ -1524,13 +1524,13 @@ final _DialogBoxIndirectParam = _user32.lookupFunction< IntPtr hInstance, Pointer hDialogTemplate, IntPtr hWndParent, - Pointer> lpDialogFunc, + Pointer> lpDialogFunc, IntPtr dwInitParam), int Function( int hInstance, Pointer hDialogTemplate, int hWndParent, - Pointer> lpDialogFunc, + Pointer> lpDialogFunc, int dwInitParam)>('DialogBoxIndirectParamW'); /// Disables the window ghosting feature for the calling GUI process. Window @@ -1709,7 +1709,7 @@ final _DrawIcon = _user32.lookupFunction< int DrawState( int hdc, int hbrFore, - Pointer> qfnCallBack, + Pointer> qfnCallBack, int lData, int wData, int x, @@ -1723,7 +1723,7 @@ final _DrawState = _user32.lookupFunction< Int32 Function( IntPtr hdc, IntPtr hbrFore, - Pointer> qfnCallBack, + Pointer> qfnCallBack, IntPtr lData, IntPtr wData, Int32 x, @@ -1734,7 +1734,7 @@ final _DrawState = _user32.lookupFunction< int Function( int hdc, int hbrFore, - Pointer> qfnCallBack, + Pointer> qfnCallBack, int lData, int wData, int x, @@ -1967,15 +1967,15 @@ final _EndPaint = _user32.lookupFunction< /// ``` /// {@category user32} int EnumChildWindows(int hWndParent, - Pointer> lpEnumFunc, int lParam) => + Pointer> lpEnumFunc, int lParam) => _EnumChildWindows(hWndParent, lpEnumFunc, lParam); final _EnumChildWindows = _user32.lookupFunction< Int32 Function(IntPtr hWndParent, - Pointer> lpEnumFunc, IntPtr lParam), + Pointer> lpEnumFunc, IntPtr lParam), int Function( int hWndParent, - Pointer> lpEnumFunc, + Pointer> lpEnumFunc, int lParam)>('EnumChildWindows'); /// Enumerates the data formats currently available on the clipboard. @@ -2004,14 +2004,14 @@ final _EnumClipboardFormats = _user32.lookupFunction< /// ); /// ``` /// {@category user32} -int EnumDesktopWindows(int hDesktop, - Pointer> lpfn, int lParam) => +int EnumDesktopWindows( + int hDesktop, Pointer> lpfn, int lParam) => _EnumDesktopWindows(hDesktop, lpfn, lParam); final _EnumDesktopWindows = _user32.lookupFunction< - Int32 Function(IntPtr hDesktop, - Pointer> lpfn, IntPtr lParam), - int Function(int hDesktop, Pointer> lpfn, + Int32 Function(IntPtr hDesktop, Pointer> lpfn, + IntPtr lParam), + int Function(int hDesktop, Pointer> lpfn, int lParam)>('EnumDesktopWindows'); /// The EnumDisplayDevices function lets you obtain information about the @@ -2057,16 +2057,16 @@ final _EnumDisplayDevices = _user32.lookupFunction< /// ``` /// {@category user32} int EnumDisplayMonitors(int hdc, Pointer lprcClip, - Pointer> lpfnEnum, int dwData) => + Pointer> lpfnEnum, int dwData) => _EnumDisplayMonitors(hdc, lprcClip, lpfnEnum, dwData); final _EnumDisplayMonitors = _user32.lookupFunction< Int32 Function(IntPtr hdc, Pointer lprcClip, - Pointer> lpfnEnum, IntPtr dwData), + Pointer> lpfnEnum, IntPtr dwData), int Function( int hdc, Pointer lprcClip, - Pointer> lpfnEnum, + Pointer> lpfnEnum, int dwData)>('EnumDisplayMonitors'); /// The EnumDisplaySettings function retrieves information about one of the @@ -2129,14 +2129,14 @@ final _EnumDisplaySettingsEx = _user32.lookupFunction< /// ); /// ``` /// {@category user32} -int EnumThreadWindows(int dwThreadId, - Pointer> lpfn, int lParam) => +int EnumThreadWindows(int dwThreadId, Pointer> lpfn, + int lParam) => _EnumThreadWindows(dwThreadId, lpfn, lParam); final _EnumThreadWindows = _user32.lookupFunction< - Int32 Function(Uint32 dwThreadId, - Pointer> lpfn, IntPtr lParam), - int Function(int dwThreadId, Pointer> lpfn, + Int32 Function(Uint32 dwThreadId, Pointer> lpfn, + IntPtr lParam), + int Function(int dwThreadId, Pointer> lpfn, int lParam)>('EnumThreadWindows'); /// Enumerates all top-level windows on the screen by passing the handle to @@ -2151,14 +2151,13 @@ final _EnumThreadWindows = _user32.lookupFunction< /// ); /// ``` /// {@category user32} -int EnumWindows( - Pointer> lpEnumFunc, int lParam) => +int EnumWindows(Pointer> lpEnumFunc, int lParam) => _EnumWindows(lpEnumFunc, lParam); final _EnumWindows = _user32.lookupFunction< Int32 Function( - Pointer> lpEnumFunc, IntPtr lParam), - int Function(Pointer> lpEnumFunc, + Pointer> lpEnumFunc, IntPtr lParam), + int Function(Pointer> lpEnumFunc, int lParam)>('EnumWindows'); /// The EqualRect function determines whether the two specified rectangles @@ -4651,7 +4650,7 @@ final _GetWindowThreadProcessId = _user32.lookupFunction< int GrayString( int hDC, int hBrush, - Pointer> lpOutputFunc, + Pointer> lpOutputFunc, int lpData, int nCount, int X, @@ -4665,7 +4664,7 @@ final _GrayString = _user32.lookupFunction< Int32 Function( IntPtr hDC, IntPtr hBrush, - Pointer> lpOutputFunc, + Pointer> lpOutputFunc, IntPtr lpData, Int32 nCount, Int32 X, @@ -4675,7 +4674,7 @@ final _GrayString = _user32.lookupFunction< int Function( int hDC, int hBrush, - Pointer> lpOutputFunc, + Pointer> lpOutputFunc, int lpData, int nCount, int X, @@ -6610,18 +6609,18 @@ final _SendMessage = _user32.lookupFunction< /// ``` /// {@category user32} int SendMessageCallback(int hWnd, int Msg, int wParam, int lParam, - Pointer> lpResultCallBack, int dwData) => + Pointer> lpResultCallBack, int dwData) => _SendMessageCallback(hWnd, Msg, wParam, lParam, lpResultCallBack, dwData); final _SendMessageCallback = _user32.lookupFunction< Int32 Function(IntPtr hWnd, Uint32 Msg, IntPtr wParam, IntPtr lParam, - Pointer> lpResultCallBack, IntPtr dwData), + Pointer> lpResultCallBack, IntPtr dwData), int Function( int hWnd, int Msg, int wParam, int lParam, - Pointer> lpResultCallBack, + Pointer> lpResultCallBack, int dwData)>('SendMessageCallbackW'); /// Sends the specified message to one or more windows. @@ -6783,17 +6782,17 @@ final _SetClipboardViewer = _user32.lookupFunction< /// ``` /// {@category user32} int SetCoalescableTimer(int hWnd, int nIDEvent, int uElapse, - Pointer> lpTimerFunc, int uToleranceDelay) => + Pointer> lpTimerFunc, int uToleranceDelay) => _SetCoalescableTimer(hWnd, nIDEvent, uElapse, lpTimerFunc, uToleranceDelay); final _SetCoalescableTimer = _user32.lookupFunction< IntPtr Function(IntPtr hWnd, IntPtr nIDEvent, Uint32 uElapse, - Pointer> lpTimerFunc, Uint32 uToleranceDelay), + Pointer> lpTimerFunc, Uint32 uToleranceDelay), int Function( int hWnd, int nIDEvent, int uElapse, - Pointer> lpTimerFunc, + Pointer> lpTimerFunc, int uToleranceDelay)>('SetCoalescableTimer'); /// Sets the cursor shape. @@ -7406,14 +7405,14 @@ final _SetThreadDpiHostingBehavior = _user32.lookupFunction< /// ``` /// {@category user32} int SetTimer(int hWnd, int nIDEvent, int uElapse, - Pointer> lpTimerFunc) => + Pointer> lpTimerFunc) => _SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc); final _SetTimer = _user32.lookupFunction< IntPtr Function(IntPtr hWnd, IntPtr nIDEvent, Uint32 uElapse, - Pointer> lpTimerFunc), + Pointer> lpTimerFunc), int Function(int hWnd, int nIDEvent, int uElapse, - Pointer> lpTimerFunc)>('SetTimer'); + Pointer> lpTimerFunc)>('SetTimer'); /// Sets information about the specified window station or desktop object. /// @@ -7548,15 +7547,15 @@ final _SetWindowRgn = _user32.lookupFunction< /// ); /// ``` /// {@category user32} -int SetWindowsHookEx(int idHook, Pointer> lpfn, +int SetWindowsHookEx(int idHook, Pointer> lpfn, int hmod, int dwThreadId) => _SetWindowsHookEx(idHook, lpfn, hmod, dwThreadId); final _SetWindowsHookEx = _user32.lookupFunction< - IntPtr Function(Int32 idHook, Pointer> lpfn, + IntPtr Function(Int32 idHook, Pointer> lpfn, IntPtr hmod, Uint32 dwThreadId), - int Function(int idHook, Pointer> lpfn, - int hmod, int dwThreadId)>('SetWindowsHookExW'); + int Function(int idHook, Pointer> lpfn, int hmod, + int dwThreadId)>('SetWindowsHookExW'); /// Changes the text of the specified window's title bar (if it has one). If /// the specified window is a control, the text of the control is changed. diff --git a/lib/src/win32/wlanapi.g.dart b/lib/src/win32/wlanapi.g.dart index 53571ef0a..c61c0bd86 100644 --- a/lib/src/win32/wlanapi.g.dart +++ b/lib/src/win32/wlanapi.g.dart @@ -1134,7 +1134,7 @@ int WlanRegisterNotification( int hClientHandle, int dwNotifSource, int bIgnoreDuplicate, - Pointer> funcCallback, + Pointer> funcCallback, Pointer pCallbackContext, Pointer pReserved, Pointer pdwPrevNotifSource) => @@ -1146,7 +1146,7 @@ final _WlanRegisterNotification = _wlanapi.lookupFunction< IntPtr hClientHandle, Uint32 dwNotifSource, Int32 bIgnoreDuplicate, - Pointer> funcCallback, + Pointer> funcCallback, Pointer pCallbackContext, Pointer pReserved, Pointer pdwPrevNotifSource), @@ -1154,7 +1154,7 @@ final _WlanRegisterNotification = _wlanapi.lookupFunction< int hClientHandle, int dwNotifSource, int bIgnoreDuplicate, - Pointer> funcCallback, + Pointer> funcCallback, Pointer pCallbackContext, Pointer pReserved, Pointer pdwPrevNotifSource)>('WlanRegisterNotification'); diff --git a/test/api_test.dart b/test/api_test.dart index 1d08e79a0..374de1c00 100644 --- a/test/api_test.dart +++ b/test/api_test.dart @@ -281,13 +281,13 @@ void main() { Int32 Function( IntPtr hdc, Pointer lpLogfont, - Pointer> lpProc, + Pointer> lpProc, IntPtr lParam, Uint32 dwFlags), int Function( int hdc, Pointer lpLogfont, - Pointer> lpProc, + Pointer> lpProc, int lParam, int dwFlags)>('EnumFontFamiliesExW'); expect(EnumFontFamiliesEx, isA()); @@ -2059,7 +2059,7 @@ void main() { IntPtr hProcess, Pointer lpThreadAttributes, IntPtr dwStackSize, - Pointer> lpStartAddress, + Pointer> lpStartAddress, Pointer lpParameter, Uint32 dwCreationFlags, Pointer lpThreadId), @@ -2067,7 +2067,7 @@ void main() { int hProcess, Pointer lpThreadAttributes, int dwStackSize, - Pointer> lpStartAddress, + Pointer> lpStartAddress, Pointer lpParameter, int dwCreationFlags, Pointer lpThreadId)>('CreateRemoteThread'); @@ -2080,7 +2080,7 @@ void main() { IntPtr hProcess, Pointer lpThreadAttributes, IntPtr dwStackSize, - Pointer> lpStartAddress, + Pointer> lpStartAddress, Pointer lpParameter, Uint32 dwCreationFlags, Pointer lpAttributeList, @@ -2089,7 +2089,7 @@ void main() { int hProcess, Pointer lpThreadAttributes, int dwStackSize, - Pointer> lpStartAddress, + Pointer> lpStartAddress, Pointer lpParameter, int dwCreationFlags, Pointer lpAttributeList, @@ -2102,14 +2102,14 @@ void main() { IntPtr Function( Pointer lpThreadAttributes, IntPtr dwStackSize, - Pointer> lpStartAddress, + Pointer> lpStartAddress, Pointer lpParameter, Uint32 dwCreationFlags, Pointer lpThreadId), int Function( Pointer lpThreadAttributes, int dwStackSize, - Pointer> lpStartAddress, + Pointer> lpStartAddress, Pointer lpParameter, int dwCreationFlags, Pointer lpThreadId)>('CreateThread'); @@ -2269,10 +2269,12 @@ void main() { final kernel32 = DynamicLibrary.open('kernel32.dll'); final K32EnumPageFiles = kernel32.lookupFunction< Int32 Function( - Pointer> pCallBackRoutine, + Pointer> + pCallBackRoutine, Pointer pContext), int Function( - Pointer> pCallBackRoutine, + Pointer> + pCallBackRoutine, Pointer pContext)>('K32EnumPageFilesW'); expect(K32EnumPageFiles, isA()); }); @@ -2313,12 +2315,12 @@ void main() { Int32 Function( IntPtr hModule, Pointer lpType, - Pointer> lpEnumFunc, + Pointer> lpEnumFunc, IntPtr lParam), int Function( int hModule, Pointer lpType, - Pointer> lpEnumFunc, + Pointer> lpEnumFunc, int lParam)>('EnumResourceNamesW'); expect(EnumResourceNames, isA()); }); @@ -2327,11 +2329,11 @@ void main() { final EnumResourceTypes = kernel32.lookupFunction< Int32 Function( IntPtr hModule, - Pointer> lpEnumFunc, + Pointer> lpEnumFunc, IntPtr lParam), int Function( int hModule, - Pointer> lpEnumFunc, + Pointer> lpEnumFunc, int lParam)>('EnumResourceTypesW'); expect(EnumResourceTypes, isA()); }); @@ -4255,14 +4257,14 @@ void main() { Pointer lpBuffer, Uint32 nNumberOfBytesToRead, Pointer lpOverlapped, - Pointer> + Pointer> lpCompletionRoutine), int Function( int hFile, Pointer lpBuffer, int nNumberOfBytesToRead, Pointer lpOverlapped, - Pointer> + Pointer> lpCompletionRoutine)>('ReadFileEx'); expect(ReadFileEx, isA()); }); @@ -4402,9 +4404,10 @@ void main() { test('Can instantiate SetConsoleCtrlHandler', () { final kernel32 = DynamicLibrary.open('kernel32.dll'); final SetConsoleCtrlHandler = kernel32.lookupFunction< - Int32 Function(Pointer> HandlerRoutine, + Int32 Function( + Pointer> HandlerRoutine, Int32 Add), - int Function(Pointer> HandlerRoutine, + int Function(Pointer> HandlerRoutine, int Add)>('SetConsoleCtrlHandler'); expect(SetConsoleCtrlHandler, isA()); }); @@ -5083,14 +5086,14 @@ void main() { Pointer lpBuffer, Uint32 nNumberOfBytesToWrite, Pointer lpOverlapped, - Pointer> + Pointer> lpCompletionRoutine), int Function( int hFile, Pointer lpBuffer, int nNumberOfBytesToWrite, Pointer lpOverlapped, - Pointer> + Pointer> lpCompletionRoutine)>('WriteFileEx'); expect(WriteFileEx, isA()); }); @@ -5314,10 +5317,10 @@ void main() { test('Can instantiate CallWindowProc', () { final user32 = DynamicLibrary.open('user32.dll'); final CallWindowProc = user32.lookupFunction< - IntPtr Function(Pointer> lpPrevWndFunc, + IntPtr Function(Pointer> lpPrevWndFunc, IntPtr hWnd, Uint32 Msg, IntPtr wParam, IntPtr lParam), - int Function(Pointer> lpPrevWndFunc, - int hWnd, int Msg, int wParam, int lParam)>('CallWindowProcW'); + int Function(Pointer> lpPrevWndFunc, int hWnd, + int Msg, int wParam, int lParam)>('CallWindowProcW'); expect(CallWindowProc, isA()); }); test('Can instantiate CascadeWindows', () { @@ -5576,13 +5579,13 @@ void main() { IntPtr hInstance, Pointer lpTemplate, IntPtr hWndParent, - Pointer> lpDialogFunc, + Pointer> lpDialogFunc, IntPtr dwInitParam), int Function( int hInstance, Pointer lpTemplate, int hWndParent, - Pointer> lpDialogFunc, + Pointer> lpDialogFunc, int dwInitParam)>('CreateDialogIndirectParamW'); expect(CreateDialogIndirectParam, isA()); }); @@ -5821,13 +5824,13 @@ void main() { IntPtr hInstance, Pointer hDialogTemplate, IntPtr hWndParent, - Pointer> lpDialogFunc, + Pointer> lpDialogFunc, IntPtr dwInitParam), int Function( int hInstance, Pointer hDialogTemplate, int hWndParent, - Pointer> lpDialogFunc, + Pointer> lpDialogFunc, int dwInitParam)>('DialogBoxIndirectParamW'); expect(DialogBoxIndirectParam, isA()); }); @@ -5908,7 +5911,7 @@ void main() { Int32 Function( IntPtr hdc, IntPtr hbrFore, - Pointer> qfnCallBack, + Pointer> qfnCallBack, IntPtr lData, IntPtr wData, Int32 x, @@ -5919,7 +5922,7 @@ void main() { int Function( int hdc, int hbrFore, - Pointer> qfnCallBack, + Pointer> qfnCallBack, int lData, int wData, int x, @@ -6028,13 +6031,11 @@ void main() { test('Can instantiate EnumChildWindows', () { final user32 = DynamicLibrary.open('user32.dll'); final EnumChildWindows = user32.lookupFunction< - Int32 Function( - IntPtr hWndParent, - Pointer> lpEnumFunc, - IntPtr lParam), + Int32 Function(IntPtr hWndParent, + Pointer> lpEnumFunc, IntPtr lParam), int Function( int hWndParent, - Pointer> lpEnumFunc, + Pointer> lpEnumFunc, int lParam)>('EnumChildWindows'); expect(EnumChildWindows, isA()); }); @@ -6049,10 +6050,8 @@ void main() { final user32 = DynamicLibrary.open('user32.dll'); final EnumDesktopWindows = user32.lookupFunction< Int32 Function(IntPtr hDesktop, - Pointer> lpfn, IntPtr lParam), - int Function( - int hDesktop, - Pointer> lpfn, + Pointer> lpfn, IntPtr lParam), + int Function(int hDesktop, Pointer> lpfn, int lParam)>('EnumDesktopWindows'); expect(EnumDesktopWindows, isA()); }); @@ -6072,11 +6071,11 @@ void main() { final user32 = DynamicLibrary.open('user32.dll'); final EnumDisplayMonitors = user32.lookupFunction< Int32 Function(IntPtr hdc, Pointer lprcClip, - Pointer> lpfnEnum, IntPtr dwData), + Pointer> lpfnEnum, IntPtr dwData), int Function( int hdc, Pointer lprcClip, - Pointer> lpfnEnum, + Pointer> lpfnEnum, int dwData)>('EnumDisplayMonitors'); expect(EnumDisplayMonitors, isA()); }); @@ -6105,19 +6104,19 @@ void main() { final user32 = DynamicLibrary.open('user32.dll'); final EnumThreadWindows = user32.lookupFunction< Int32 Function(Uint32 dwThreadId, - Pointer> lpfn, IntPtr lParam), + Pointer> lpfn, IntPtr lParam), int Function( int dwThreadId, - Pointer> lpfn, + Pointer> lpfn, int lParam)>('EnumThreadWindows'); expect(EnumThreadWindows, isA()); }); test('Can instantiate EnumWindows', () { final user32 = DynamicLibrary.open('user32.dll'); final EnumWindows = user32.lookupFunction< - Int32 Function(Pointer> lpEnumFunc, - IntPtr lParam), - int Function(Pointer> lpEnumFunc, + Int32 Function( + Pointer> lpEnumFunc, IntPtr lParam), + int Function(Pointer> lpEnumFunc, int lParam)>('EnumWindows'); expect(EnumWindows, isA()); }); @@ -7310,7 +7309,7 @@ void main() { Int32 Function( IntPtr hDC, IntPtr hBrush, - Pointer> lpOutputFunc, + Pointer> lpOutputFunc, IntPtr lpData, Int32 nCount, Int32 X, @@ -7320,7 +7319,7 @@ void main() { int Function( int hDC, int hBrush, - Pointer> lpOutputFunc, + Pointer> lpOutputFunc, int lpData, int nCount, int X, @@ -8167,14 +8166,14 @@ void main() { Uint32 Msg, IntPtr wParam, IntPtr lParam, - Pointer> lpResultCallBack, + Pointer> lpResultCallBack, IntPtr dwData), int Function( int hWnd, int Msg, int wParam, int lParam, - Pointer> lpResultCallBack, + Pointer> lpResultCallBack, int dwData)>('SendMessageCallbackW'); expect(SendMessageCallback, isA()); }); @@ -8244,13 +8243,13 @@ void main() { IntPtr hWnd, IntPtr nIDEvent, Uint32 uElapse, - Pointer> lpTimerFunc, + Pointer> lpTimerFunc, Uint32 uToleranceDelay), int Function( int hWnd, int nIDEvent, int uElapse, - Pointer> lpTimerFunc, + Pointer> lpTimerFunc, int uToleranceDelay)>('SetCoalescableTimer'); expect(SetCoalescableTimer, isA()); }); @@ -8530,9 +8529,9 @@ void main() { final user32 = DynamicLibrary.open('user32.dll'); final SetTimer = user32.lookupFunction< IntPtr Function(IntPtr hWnd, IntPtr nIDEvent, Uint32 uElapse, - Pointer> lpTimerFunc), + Pointer> lpTimerFunc), int Function(int hWnd, int nIDEvent, int uElapse, - Pointer> lpTimerFunc)>('SetTimer'); + Pointer> lpTimerFunc)>('SetTimer'); expect(SetTimer, isA()); }); test('Can instantiate SetUserObjectInformation', () { @@ -8586,12 +8585,9 @@ void main() { test('Can instantiate SetWindowsHookEx', () { final user32 = DynamicLibrary.open('user32.dll'); final SetWindowsHookEx = user32.lookupFunction< - IntPtr Function( - Int32 idHook, - Pointer> lpfn, - IntPtr hmod, - Uint32 dwThreadId), - int Function(int idHook, Pointer> lpfn, + IntPtr Function(Int32 idHook, Pointer> lpfn, + IntPtr hmod, Uint32 dwThreadId), + int Function(int idHook, Pointer> lpfn, int hmod, int dwThreadId)>('SetWindowsHookExW'); expect(SetWindowsHookEx, isA()); }); @@ -9357,7 +9353,8 @@ void main() { IntPtr hService, Int32 EventType, Pointer EventParameterIn, - Pointer> Callback, + Pointer> + Callback, Pointer CallbackContext, Pointer pEventHandle, Uint32 Flags), @@ -9365,7 +9362,8 @@ void main() { int hService, int EventType, Pointer EventParameterIn, - Pointer> Callback, + Pointer> + Callback, Pointer CallbackContext, Pointer pEventHandle, int Flags)>('BluetoothGATTRegisterEvent'); @@ -9467,13 +9465,13 @@ void main() { Uint32 Function( Pointer pbtdiIn, Pointer phRegHandleOut, - Pointer> + Pointer> pfnCallbackIn, Pointer pvParam), int Function( Pointer pbtdiIn, Pointer phRegHandleOut, - Pointer> + Pointer> pfnCallbackIn, Pointer pvParam)>('BluetoothRegisterForAuthenticationEx'); expect(BluetoothRegisterForAuthenticationEx, isA()); @@ -9492,13 +9490,13 @@ void main() { Int32 Function( Pointer pSDPStream, Uint32 cbStreamSize, - Pointer> + Pointer> pfnCallback, Pointer pvParam), int Function( Pointer pSDPStream, int cbStreamSize, - Pointer> + Pointer> pfnCallback, Pointer pvParam)>('BluetoothSdpEnumAttributes'); expect(BluetoothSdpEnumAttributes, isA()); @@ -10250,9 +10248,9 @@ void main() { final advapi32 = DynamicLibrary.open('advapi32.dll'); final RegisterServiceCtrlHandler = advapi32.lookupFunction< IntPtr Function(Pointer lpServiceName, - Pointer> lpHandlerProc), + Pointer> lpHandlerProc), int Function(Pointer lpServiceName, - Pointer> lpHandlerProc)>( + Pointer> lpHandlerProc)>( 'RegisterServiceCtrlHandlerW'); expect(RegisterServiceCtrlHandler, isA()); }); @@ -10261,11 +10259,11 @@ void main() { final RegisterServiceCtrlHandlerEx = advapi32.lookupFunction< IntPtr Function( Pointer lpServiceName, - Pointer> lpHandlerProc, + Pointer> lpHandlerProc, Pointer lpContext), int Function( Pointer lpServiceName, - Pointer> lpHandlerProc, + Pointer> lpHandlerProc, Pointer lpContext)>('RegisterServiceCtrlHandlerExW'); expect(RegisterServiceCtrlHandlerEx, isA()); }); @@ -11543,11 +11541,11 @@ void main() { final RemoveWindowSubclass = comctl32.lookupFunction< Int32 Function( IntPtr hWnd, - Pointer> pfnSubclass, + Pointer> pfnSubclass, IntPtr uIdSubclass), int Function( int hWnd, - Pointer> pfnSubclass, + Pointer> pfnSubclass, int uIdSubclass)>('RemoveWindowSubclass'); expect(RemoveWindowSubclass, isA()); }); @@ -11556,12 +11554,12 @@ void main() { final SetWindowSubclass = comctl32.lookupFunction< Int32 Function( IntPtr hWnd, - Pointer> pfnSubclass, + Pointer> pfnSubclass, IntPtr uIdSubclass, IntPtr dwRefData), int Function( int hWnd, - Pointer> pfnSubclass, + Pointer> pfnSubclass, int uIdSubclass, int dwRefData)>('SetWindowSubclass'); expect(SetWindowSubclass, isA()); @@ -13948,13 +13946,15 @@ void main() { IntPtr hProcess, Uint64 BaseOfDll, Pointer Mask, - Pointer> EnumSymbolsCallback, + Pointer> + EnumSymbolsCallback, Pointer UserContext), int Function( int hProcess, int BaseOfDll, Pointer Mask, - Pointer> EnumSymbolsCallback, + Pointer> + EnumSymbolsCallback, Pointer UserContext)>('SymEnumSymbolsW'); expect(SymEnumSymbols, isA()); }); diff --git a/test/dart_fix_test.dart b/test/dart_fix_test.dart new file mode 100644 index 000000000..f679dfc2b --- /dev/null +++ b/test/dart_fix_test.dart @@ -0,0 +1,96 @@ +@TestOn('windows') + +import 'dart:io'; + +import 'package:path/path.dart' as p; +import 'package:test/test.dart'; + +// Used for debugging the test. +const keepTempDir = false; + +void main() { + test("'dart fix' integration", () { + // create temp dir + final tempDir = Directory.systemTemp.createTempSync('test'); + + var sdkVersion = Platform.version; + if (sdkVersion.contains(' ')) { + sdkVersion = sdkVersion.substring(0, sdkVersion.indexOf(' ')); + } + + try { + // set up project + writeFile(tempDir, 'pubspec.yaml', ''' +name: test_project +environment: + sdk: '^$sdkVersion' +dependencies: + win32: + path: ${Directory.current.path.replaceAll(r'\', '/')} +'''); + final sourceFile = File(p.join('test_fixes', 'renames.dart')); + writeFile( + tempDir, + p.join('lib', sourceFile.name), + sourceFile.readAsStringSync(), + ); + + // run pub get + pubGet(tempDir); + + // dart fix + dartFix(tempDir); + + // verify no analysis issues + dartAnalyze(tempDir); + } finally { + // ignore: dead_code + if (keepTempDir) { + print('dart fix test temp dir: ${tempDir.path}'); + } else { + tempDir.deleteSync(recursive: true); + } + } + }); +} + +void writeFile(Directory dir, String filePath, String contents) { + final file = File(p.join(dir.path, filePath)); + file.parent.createSync(); + file.writeAsStringSync(contents); +} + +void pubGet(Directory dir) { + exec('pub', ['get'], cwd: dir); +} + +void dartFix(Directory dir) { + exec('fix', ['--apply'], cwd: dir); +} + +void dartAnalyze(Directory dir) { + exec('analyze', [], cwd: dir); +} + +void exec(String command, List args, {required Directory cwd}) { + printOnFailure('dart $command ${args.join(', ')}'); + + final result = Process.runSync( + Platform.resolvedExecutable, + [command, ...args], + workingDirectory: cwd.path, + ); + + var out = result.stdout as String; + if (out.isNotEmpty) printOnFailure(out); + out = result.stderr as String; + if (out.isNotEmpty) printOnFailure(out); + + if (result.exitCode != 0) { + fail('dart $command: exitCode ${result.exitCode}'); + } +} + +extension on File { + String get name => p.basename(path); +} diff --git a/test/window_test.dart b/test/window_test.dart index f7b0a6902..967e67e8b 100644 --- a/test/window_test.dart +++ b/test/window_test.dart @@ -20,7 +20,7 @@ void main() { test('RegisterClass()', () { final hInstance = GetModuleHandle(nullptr); final pClassName = 'CLASS_NAME'.toNativeUtf16(); - final lpfnWndProc = NativeCallable.isolateLocal( + final lpfnWndProc = NativeCallable.isolateLocal( MainWindowProc, exceptionalReturn: 0, ); diff --git a/test_fixes/README.md b/test_fixes/README.md new file mode 100644 index 000000000..31ab84a2a --- /dev/null +++ b/test_fixes/README.md @@ -0,0 +1,20 @@ +## What's here? + +For information about the files in this directory, see +https://github.com/flutter/flutter/wiki/Data-driven-Fixes#testing. + +## Organization + +The contents of this directory are used to test the `dart fix` refactorings +offered by this package. See `lib/fix_data.yaml` for the fix definitions. + +Note that files in this directory are excluded from analysis. + +## Running the dart fix tests + +In order to test the fixes manually: + +```cmd +> cd test_fixes +> dart fix --compare-to-golden +``` diff --git a/test_fixes/analysis_options.yaml b/test_fixes/analysis_options.yaml new file mode 100644 index 000000000..9a3b13430 --- /dev/null +++ b/test_fixes/analysis_options.yaml @@ -0,0 +1 @@ +include: package:dartwindows_lints/analysis_options.yaml diff --git a/test_fixes/renames.dart b/test_fixes/renames.dart new file mode 100644 index 000000000..4687129e2 --- /dev/null +++ b/test_fixes/renames.dart @@ -0,0 +1,46 @@ +// Copyright (c) 2024, Dart | Windows. Please see the AUTHORS file for details. +// All rights reserved. Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +import 'package:win32/win32.dart'; + +late DlgProc $0; +late DrawStateProc $1; +late DrawTextCallback $2; +late EnumResNameProc $3; +late EnumResTypeProc $4; +late EnumFontFamExProc $5; +late FRHookProc $6; +late OutputProc $7; +late CallWndProc $8; +late CCHookProc $9; +late CFHookProc $10; +late ExcepInfoProc $11; +late LphandlerFunction $12; +late LphandlerFunctionEx $13; +late OpenCardCheckProc $14; +late OpenCardConnProc $15; +late OpenCardDisconnProc $16; +late OFNHookProc $17; +late LpoverlappedCompletionRoutine $18; +late LpserviceMainFunctionw $19; +late ThreadProc $20; +late MidiInProc $21; +late MidiOutProc $22; +late MonitorEnumProc $23; +late EnumPageFilesProc $24; +late PfnScNotifyCallbackFunction $25; +late PfnAuthenticationCallbackEx $26; +late PfnbluetoothGattEventCallback $27; +late PfnBluetoothEnumAttributesCallback $28; +late PfnDeviceCallback $29; +late TaskDialogCallbackProc $30; +late HandlerRoutine $31; +late SymEnumSymbolsProc $32; +late SendAsyncProc $33; +late SpNotifyCallback $34; +late SubclassProc $35; +late TimerProc $36; +late WlanNotificationCallback $37; +late EnumWindowsProc $38; +late WindowProc $39; diff --git a/test_fixes/renames.dart.expect b/test_fixes/renames.dart.expect new file mode 100644 index 000000000..ac87f7786 --- /dev/null +++ b/test_fixes/renames.dart.expect @@ -0,0 +1,46 @@ +// Copyright (c) 2024, Dart | Windows. Please see the AUTHORS file for details. +// All rights reserved. Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +import 'package:win32/win32.dart'; + +late DLGPROC $0; +late DRAWSTATEPROC $1; +late DTT_CALLBACK_PROC $2; +late ENUMRESNAMEPROC $3; +late ENUMRESTYPEPROC $4; +late FONTENUMPROC $5; +late LPFRHOOKPROC $6; +late GRAYSTRINGPROC $7; +late HOOKPROC $8; +late LPCCHOOKPROC $9; +late LPCFHOOKPROC $10; +late LPEXCEPFINO_DEFERRED_FILLIN $11; +late LPHANDLER_FUNCTION $12; +late LPHANDLER_FUNCTION_EX $13; +late LPOCNCHKPROC $14; +late LPOCNCONNPROC $15; +late LPOCNDSCPROC $16; +late LPOFNHOOKPROC $17; +late LPOVERLAPPED_COMPLETION_ROUTINE $18; +late LPSERVICE_MAIN_FUNCTION $19; +late LPTHREAD_START_ROUTINE $20; +late MIDIINPROC $21; +late MIDIOUTPROC $22; +late MONITORENUMPROC $23; +late PENUM_PAGE_FILE_CALLBACK $24; +late PFN_SC_NOTIFY_CALLBACK $25; +late PFN_AUTHENTICATION_CALLBACK_EX $26; +late PFNBLUETOOTH_GATT_EVENT_CALLBACK $27; +late PFN_BLUETOOTH_ENUM_ATTRIBUTES_CALLBACK $28; +late PFN_DEVICE_CALLBACK $29; +late PFTASKDIALOGCALLBACK $30; +late PHANDLER_ROUTINE $31; +late PSYM_ENUMERATESYMBOLS_CALLBACK $32; +late SENDASYNCPROC $33; +late SPNOTIFYCALLBACK $34; +late SUBCLASSPROC $35; +late TIMERPROC $36; +late WLAN_NOTIFICATION_CALLBACK $37; +late WNDENUMPROC $38; +late WNDPROC $39; diff --git a/tool/win32gen/data/win32_callbacks.json b/tool/win32gen/data/win32_callbacks.json index d76cb3cb3..c423caedc 100644 --- a/tool/win32gen/data/win32_callbacks.json +++ b/tool/win32gen/data/win32_callbacks.json @@ -1,45 +1,45 @@ { - "DLGPROC": "Pointer>", - "DRAWSTATEPROC": "Pointer>", - "DTT_CALLBACK_PROC": "Pointer>", - "ENUMRESNAMEPROCW": "Pointer>", - "ENUMRESTYPEPROCW": "Pointer>", + "DLGPROC": "Pointer>", + "DRAWSTATEPROC": "Pointer>", + "DTT_CALLBACK_PROC": "Pointer>", + "ENUMRESNAMEPROCW": "Pointer>", + "ENUMRESTYPEPROCW": "Pointer>", "FARPROC": "Pointer", - "FONTENUMPROCW": "Pointer>", - "GRAYSTRINGPROC": "Pointer>", - "HOOKPROC": "Pointer>", - "LPCCHOOKPROC": "Pointer>", - "LPCFHOOKPROC": "Pointer>", - "LPEXCEPFINO_DEFERRED_FILLIN": "Pointer>", - "LPFRHOOKPROC": "Pointer>", - "LPHANDLER_FUNCTION": "Pointer>", - "LPHANDLER_FUNCTION_EX": "Pointer>", - "LPOCNCHKPROC": "Pointer>", - "LPOCNCONNPROCW": "Pointer>", - "LPOCNDSCPROC": "Pointer>", - "LPOFNHOOKPROC": "Pointer>", - "LPOVERLAPPED_COMPLETION_ROUTINE": "Pointer>", - "LPSERVICE_MAIN_FUNCTIONW": "Pointer>", - "LPTHREAD_START_ROUTINE": "Pointer>", - "MONITORENUMPROC": "Pointer>", + "FONTENUMPROCW": "Pointer>", + "GRAYSTRINGPROC": "Pointer>", + "HOOKPROC": "Pointer>", + "LPCCHOOKPROC": "Pointer>", + "LPCFHOOKPROC": "Pointer>", + "LPEXCEPFINO_DEFERRED_FILLIN": "Pointer>", + "LPFRHOOKPROC": "Pointer>", + "LPHANDLER_FUNCTION": "Pointer>", + "LPHANDLER_FUNCTION_EX": "Pointer>", + "LPOCNCHKPROC": "Pointer>", + "LPOCNCONNPROCW": "Pointer>", + "LPOCNDSCPROC": "Pointer>", + "LPOFNHOOKPROC": "Pointer>", + "LPOVERLAPPED_COMPLETION_ROUTINE": "Pointer>", + "LPSERVICE_MAIN_FUNCTIONW": "Pointer>", + "LPTHREAD_START_ROUTINE": "Pointer>", + "MONITORENUMPROC": "Pointer>", "MagImageScalingCallback": "Pointer>", "NEARPROC": "Pointer", - "PENUM_PAGE_FILE_CALLBACKW": "Pointer>", - "PFNBLUETOOTH_GATT_EVENT_CALLBACK": "Pointer>", - "PFN_AUTHENTICATION_CALLBACK_EX": "Pointer>", - "PFN_BLUETOOTH_ENUM_ATTRIBUTES_CALLBACK": "Pointer>", - "PFN_DEVICE_CALLBACK": "Pointer>", - "PFN_SC_NOTIFY_CALLBACK": "Pointer>", - "PFTASKDIALOGCALLBACK": "Pointer>", - "PHANDLER_ROUTINE": "Pointer>", + "PENUM_PAGE_FILE_CALLBACKW": "Pointer>", + "PFNBLUETOOTH_GATT_EVENT_CALLBACK": "Pointer>", + "PFN_AUTHENTICATION_CALLBACK_EX": "Pointer>", + "PFN_BLUETOOTH_ENUM_ATTRIBUTES_CALLBACK": "Pointer>", + "PFN_DEVICE_CALLBACK": "Pointer>", + "PFN_SC_NOTIFY_CALLBACK": "Pointer>", + "PFTASKDIALOGCALLBACK": "Pointer>", + "PHANDLER_ROUTINE": "Pointer>", "PPERFORMANCEINFORMATION": "Pointer>", "PROC": "Pointer", - "PSYM_ENUMERATESYMBOLS_CALLBACKW": "Pointer>", - "SENDASYNCPROC": "Pointer>", - "SPNOTIFYCALLBACK": "Pointer>", - "SUBCLASSPROC": "Pointer>", - "TIMERPROC": "Pointer>", - "WLAN_NOTIFICATION_CALLBACK": "Pointer>", - "WNDENUMPROC": "Pointer>", - "WNDPROC": "Pointer>" + "PSYM_ENUMERATESYMBOLS_CALLBACKW": "Pointer>", + "SENDASYNCPROC": "Pointer>", + "SPNOTIFYCALLBACK": "Pointer>", + "SUBCLASSPROC": "Pointer>", + "TIMERPROC": "Pointer>", + "WLAN_NOTIFICATION_CALLBACK": "Pointer>", + "WNDENUMPROC": "Pointer>", + "WNDPROC": "Pointer>" } \ No newline at end of file diff --git a/tool/win32gen/test/type_projection_test.dart b/tool/win32gen/test/type_projection_test.dart index 03a74e611..fe204bab6 100644 --- a/tool/win32gen/test/type_projection_test.dart +++ b/tool/win32gen/test/type_projection_test.dart @@ -216,9 +216,9 @@ void main() { final typeProjection = TypeProjection(type); expect(typeProjection.nativeType, - equals('Pointer>')); + equals('Pointer>')); expect(typeProjection.dartType, - equals('Pointer>')); + equals('Pointer>')); }); test('Callbacks are represented correctly 2', () { @@ -233,9 +233,9 @@ void main() { final typeProjection = TypeProjection(type); expect(typeProjection.nativeType, - equals('Pointer>')); + equals('Pointer>')); expect(typeProjection.dartType, - equals('Pointer>')); + equals('Pointer>')); }); test('Pointers to structs are represented correctly', () {