Skip to content

Commit ddc7371

Browse files
authored
Deprecate WBEM_TIMEOUT_TYPE (#833)
1 parent 06518c9 commit ddc7371

File tree

6 files changed

+42
-5
lines changed

6 files changed

+42
-5
lines changed

CHANGELOG.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

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

1114
You can automatically migrate your code to use the new constants by running
1215
`dart fix --apply` in your terminal.

example/wmi_wql.dart

+1-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ void main() {
133133
while (enumerator.ptr.address > 0) {
134134
final pClsObj = calloc<IntPtr>();
135135

136-
hr = enumerator.next(
137-
WBEM_TIMEOUT_TYPE.WBEM_INFINITE, 1, pClsObj.cast(), uReturn);
136+
hr = enumerator.next(WBEM_INFINITE, 1, pClsObj.cast(), uReturn);
138137

139138
// Break out of the while loop if we've run out of processes to inspect
140139
if (uReturn.value == 0) break;

lib/fix_data/fix_win32/fix_constants.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -26732,3 +26732,27 @@ transforms:
2673226732
uris: ['package:win32/win32.dart']
2673326733
field: 'LIST_MODULES_DEFAULT'
2673426734
inClass: 'ENUM_PROCESS_MODULES_EX_FLAGS'
26735+
26736+
- title: "Migrate to 'WBEM_NO_WAIT'"
26737+
date: 2024-03-23
26738+
element:
26739+
uris: ['package:win32/win32.dart']
26740+
field: 'WBEM_NO_WAIT'
26741+
inClass: 'WBEM_TIMEOUT_TYPE'
26742+
changes:
26743+
- kind: 'replacedBy'
26744+
newElement:
26745+
uris: ['package:win32/win32.dart']
26746+
variable: 'WBEM_NO_WAIT'
26747+
26748+
- title: "Migrate to 'WBEM_INFINITE'"
26749+
date: 2024-03-23
26750+
element:
26751+
uris: ['package:win32/win32.dart']
26752+
field: 'WBEM_INFINITE'
26753+
inClass: 'WBEM_TIMEOUT_TYPE'
26754+
changes:
26755+
- kind: 'replacedBy'
26756+
newElement:
26757+
uris: ['package:win32/win32.dart']
26758+
variable: 'WBEM_INFINITE'

lib/src/constants_nodoc.dart

+7
Original file line numberDiff line numberDiff line change
@@ -3731,11 +3731,18 @@ class WBEM_REFRESHER_FLAGS {
37313731
}
37323732

37333733
/// {@category enum}
3734+
@Deprecated('No replacement')
37343735
class WBEM_TIMEOUT_TYPE {
3736+
@Deprecated('Use WBEM_NO_WAIT instead')
37353737
static const WBEM_NO_WAIT = 0;
3738+
3739+
@Deprecated('Use WBEM_INFINITE instead')
37363740
static const WBEM_INFINITE = 0xffffffff;
37373741
}
37383742

3743+
const WBEM_NO_WAIT = 0;
3744+
const WBEM_INFINITE = 0xffffffff;
3745+
37393746
/// {@category enum}
37403747
class NLM_CONNECTIVITY {
37413748
static const NLM_CONNECTIVITY_DISCONNECTED = 0;

test_fixes/win32/constants.dart

+2
Original file line numberDiff line numberDiff line change
@@ -2227,3 +2227,5 @@ const $2219 = CORRECTIVE_ACTION.NONE;
22272227
const $2220 = CORRECTIVE_ACTION.GET_SUGGESTIONS;
22282228
const $2221 = CORRECTIVE_ACTION.REPLACE;
22292229
const $2222 = CORRECTIVE_ACTION.DELETE;
2230+
const $2223 = WBEM_TIMEOUT_TYPE.WBEM_NO_WAIT;
2231+
const $2224 = WBEM_TIMEOUT_TYPE.WBEM_INFINITE;

test_fixes/win32/constants.dart.expect

+2
Original file line numberDiff line numberDiff line change
@@ -2227,3 +2227,5 @@ const $2219 = CORRECTIVE_ACTION.CORRECTIVE_ACTION_NONE;
22272227
const $2220 = CORRECTIVE_ACTION.CORRECTIVE_ACTION_GET_SUGGESTIONS;
22282228
const $2221 = CORRECTIVE_ACTION.CORRECTIVE_ACTION_REPLACE;
22292229
const $2222 = CORRECTIVE_ACTION.CORRECTIVE_ACTION_DELETE;
2230+
const $2223 = WBEM_NO_WAIT;
2231+
const $2224 = WBEM_INFINITE;

0 commit comments

Comments
 (0)