Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate WBEM_TIMEOUT_TYPE #833

Merged
merged 1 commit into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

- Fix constant values `ERROR_SERVICE_NOT_ACTIVE`, `KF_FLAG_ALIAS_ONLY`,
`QS_INPUT`, `STD_INPUT_HANDLE`, `STD_OUTPUT_HANDLE`, `STD_ERROR_HANDLE`,
`UIA_ItemTypePropertyId`, and `UIA_OrientationPropertyId` (#XXX)
- Introduce Win32 enumerations as extension types based on `int` (#XXX)
`UIA_ItemTypePropertyId`, and `UIA_OrientationPropertyId` (#832)
- Introduce Win32 enumerations as extension types based on `int` (#832)
- Deprecate constants for the Win32 enumerations in favor of the newly
introduced extension types. For example, replace the usage of `ERROR_SUCCESS`
with `WIN32_ERROR.ERROR_SUCCESS` (#XXX)
with `WIN32_ERROR.ERROR_SUCCESS` (#832)
- Deprecate constant values `WBEM_TIMEOUT_TYPE.WBEM_NO_WAIT` and
`WBEM_TIMEOUT_TYPE.WBEM_INFINITE` in favor of the newly introduced constants
`WBEM_NO_WAIT` and `WBEM_INFINITE` (#833)

You can automatically migrate your code to use the new constants by running
`dart fix --apply` in your terminal.
Expand Down
3 changes: 1 addition & 2 deletions example/wmi_wql.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ void main() {
while (enumerator.ptr.address > 0) {
final pClsObj = calloc<IntPtr>();

hr = enumerator.next(
WBEM_TIMEOUT_TYPE.WBEM_INFINITE, 1, pClsObj.cast(), uReturn);
hr = enumerator.next(WBEM_INFINITE, 1, pClsObj.cast(), uReturn);

// Break out of the while loop if we've run out of processes to inspect
if (uReturn.value == 0) break;
Expand Down
24 changes: 24 additions & 0 deletions lib/fix_data/fix_win32/fix_constants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26732,3 +26732,27 @@ transforms:
uris: ['package:win32/win32.dart']
field: 'LIST_MODULES_DEFAULT'
inClass: 'ENUM_PROCESS_MODULES_EX_FLAGS'

- title: "Migrate to 'WBEM_NO_WAIT'"
date: 2024-03-23
element:
uris: ['package:win32/win32.dart']
field: 'WBEM_NO_WAIT'
inClass: 'WBEM_TIMEOUT_TYPE'
changes:
- kind: 'replacedBy'
newElement:
uris: ['package:win32/win32.dart']
variable: 'WBEM_NO_WAIT'

- title: "Migrate to 'WBEM_INFINITE'"
date: 2024-03-23
element:
uris: ['package:win32/win32.dart']
field: 'WBEM_INFINITE'
inClass: 'WBEM_TIMEOUT_TYPE'
changes:
- kind: 'replacedBy'
newElement:
uris: ['package:win32/win32.dart']
variable: 'WBEM_INFINITE'
7 changes: 7 additions & 0 deletions lib/src/constants_nodoc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3731,11 +3731,18 @@ class WBEM_REFRESHER_FLAGS {
}

/// {@category enum}
@Deprecated('No replacement')
class WBEM_TIMEOUT_TYPE {
@Deprecated('Use WBEM_NO_WAIT instead')
static const WBEM_NO_WAIT = 0;

@Deprecated('Use WBEM_INFINITE instead')
static const WBEM_INFINITE = 0xffffffff;
}

const WBEM_NO_WAIT = 0;
const WBEM_INFINITE = 0xffffffff;

/// {@category enum}
class NLM_CONNECTIVITY {
static const NLM_CONNECTIVITY_DISCONNECTED = 0;
Expand Down
2 changes: 2 additions & 0 deletions test_fixes/win32/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2227,3 +2227,5 @@ const $2219 = CORRECTIVE_ACTION.NONE;
const $2220 = CORRECTIVE_ACTION.GET_SUGGESTIONS;
const $2221 = CORRECTIVE_ACTION.REPLACE;
const $2222 = CORRECTIVE_ACTION.DELETE;
const $2223 = WBEM_TIMEOUT_TYPE.WBEM_NO_WAIT;
const $2224 = WBEM_TIMEOUT_TYPE.WBEM_INFINITE;
2 changes: 2 additions & 0 deletions test_fixes/win32/constants.dart.expect
Original file line number Diff line number Diff line change
Expand Up @@ -2227,3 +2227,5 @@ const $2219 = CORRECTIVE_ACTION.CORRECTIVE_ACTION_NONE;
const $2220 = CORRECTIVE_ACTION.CORRECTIVE_ACTION_GET_SUGGESTIONS;
const $2221 = CORRECTIVE_ACTION.CORRECTIVE_ACTION_REPLACE;
const $2222 = CORRECTIVE_ACTION.CORRECTIVE_ACTION_DELETE;
const $2223 = WBEM_NO_WAIT;
const $2224 = WBEM_INFINITE;