Commit 4eb1b9d
authored
* refactor: Define `ITEMIDLIST` and `SHITEMID` as `Structure` in `shelllink.py`.
- Replace the placeholder `ITEMIDLIST = c_int` with actual `Structure`
definitions to match Windows API specifications.
- Include `SHITEMID` with `cb` and `abID` fields.
* test: Add `IShellLink::SetIDList` and `GetIDList` tests.
- Add `test_set_and_get_idlist` to `Test_IShellLinkA` and `Test_IShellLinkW`
in `test_shelllink.py`.
- Verify setting and retrieving a manually constructed `ITEMIDLIST`.
- Use `_CoTaskMemFree` to release the pointer returned by `GetIDList`.
* refactor: Improve `IShellLink` type hints for `GetIDList` and `SetIDList`.
- Use `_Pointer[ITEMIDLIST]` for `ITEMIDLIST` pointers in `IShellLinkA` and
`IShellLinkW`.
- Specify `hints.Hresult` as the return type for `SetIDList`.
- Import `_Pointer` from `ctypes` within the `TYPE_CHECKING` block.
* test: Use `ILIsEqual` for robust `ITEMIDLIST` comparisons in `test_shelllink.py`.
- Add assertions using `ILIsEqual` in `Test_IShellLinkA` and `Test_IShellLinkW`
to ensure correct `ITEMIDLIST` handling.
* test: Verify `PIDL` memory allocation using `CoGetMalloc().DidAlloc` in `test_shelllink.py`.
- Assert that input `PIDL`s are not COM-allocated and output `PIDL`s are,
ensuring proper `CoTaskMemFree` usage.
1 parent 844a111 commit 4eb1b9d
2 files changed
Lines changed: 103 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
12 | 20 | | |
13 | 21 | | |
14 | 22 | | |
15 | 23 | | |
16 | 24 | | |
| 25 | + | |
| 26 | + | |
17 | 27 | | |
18 | 28 | | |
19 | 29 | | |
| |||
42 | 52 | | |
43 | 53 | | |
44 | 54 | | |
45 | | - | |
46 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
47 | 64 | | |
48 | 65 | | |
49 | 66 | | |
| |||
134 | 151 | | |
135 | 152 | | |
136 | 153 | | |
137 | | - | |
138 | | - | |
| 154 | + | |
| 155 | + | |
139 | 156 | | |
140 | 157 | | |
141 | 158 | | |
| |||
269 | 286 | | |
270 | 287 | | |
271 | 288 | | |
272 | | - | |
273 | | - | |
| 289 | + | |
| 290 | + | |
274 | 291 | | |
275 | 292 | | |
276 | 293 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | 7 | | |
5 | 8 | | |
6 | 9 | | |
| 10 | + | |
7 | 11 | | |
| 12 | + | |
8 | 13 | | |
9 | 14 | | |
10 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
11 | 23 | | |
12 | 24 | | |
13 | 25 | | |
| |||
66 | 78 | | |
67 | 79 | | |
68 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
69 | 114 | | |
70 | 115 | | |
71 | 116 | | |
| |||
126 | 171 | | |
127 | 172 | | |
128 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
0 commit comments