1
- // Copyright (c) 2024 Files Community
1
+ // Copyright (c) 2024 Files Community
2
2
// Licensed under the MIT License. See the LICENSE.
3
3
4
4
using System . IO ;
@@ -56,13 +56,6 @@ public static extern int RmGetList(
56
56
ref uint lpdwRebootReasons
57
57
) ;
58
58
59
- [ DllImport ( "user32.dll" , SetLastError = true , CharSet = CharSet . Unicode ) ]
60
- public static extern bool SetPropW (
61
- IntPtr hWnd ,
62
- string lpString ,
63
- IntPtr hData
64
- ) ;
65
-
66
59
[ DllImport ( "kernel32.dll" , CharSet = CharSet . Unicode ) ]
67
60
public static extern IntPtr CreateEvent (
68
61
IntPtr lpEventAttributes ,
@@ -102,39 +95,12 @@ public static extern bool CloseHandle(
102
95
IntPtr hObject
103
96
) ;
104
97
105
- [ DllImport ( "api-ms-win-core-io-l1-1-1.dll" ) ]
106
- public static extern bool GetOverlappedResult (
107
- IntPtr hFile ,
108
- OVERLAPPED lpOverlapped ,
109
- out int lpNumberOfBytesTransferred ,
110
- bool bWait
111
- ) ;
112
-
113
- [ DllImport ( "api-ms-win-core-io-l1-1-1.dll" ) ]
114
- public static extern bool CancelIo (
115
- IntPtr hFile
116
- ) ;
117
-
118
98
[ DllImport ( "api-ms-win-core-io-l1-1-1.dll" ) ]
119
99
public static extern bool CancelIoEx (
120
100
IntPtr hFile ,
121
101
IntPtr lpOverlapped
122
102
) ;
123
103
124
- [ DllImport ( "api-ms-win-core-synch-l1-2-0.dll" ) ]
125
- public static extern uint WaitForMultipleObjectsEx (
126
- uint nCount ,
127
- IntPtr [ ] lpHandles ,
128
- bool bWaitAll ,
129
- uint dwMilliseconds ,
130
- bool bAlertable
131
- ) ;
132
-
133
- [ DllImport ( "api-ms-win-core-synch-l1-2-0.dll" , SetLastError = true ) ]
134
- public static extern bool ResetEvent (
135
- IntPtr hEvent
136
- ) ;
137
-
138
104
[ DllImport ( "api-ms-win-core-synch-l1-2-0.dll" , SetLastError = true ) ]
139
105
public static extern uint WaitForSingleObjectEx (
140
106
IntPtr hHandle ,
@@ -202,16 +168,6 @@ public static extern bool DeviceIoControl(
202
168
out uint lpBytesReturned ,
203
169
IntPtr lpOverlapped ) ;
204
170
205
- [ DllImport ( "user32.dll" ) ]
206
- public static extern int ToUnicode (
207
- uint virtualKeyCode ,
208
- uint scanCode ,
209
- byte [ ] keyboardState ,
210
- [ Out , MarshalAs ( UnmanagedType . LPWStr , SizeConst = 64 ) ] StringBuilder receivingBuffer ,
211
- int bufferSize ,
212
- uint flags
213
- ) ;
214
-
215
171
[ DllImport ( "user32.dll" , CharSet = CharSet . Auto ) ]
216
172
public static extern int ToUnicodeEx (
217
173
uint virtualKeyCode ,
@@ -223,11 +179,6 @@ public static extern int ToUnicodeEx(
223
179
IntPtr keyboardLayout
224
180
) ;
225
181
226
- [ DllImport ( "user32.dll" ) ]
227
- public static extern bool TranslateMessage (
228
- ref MSG lpMsg
229
- ) ;
230
-
231
182
[ DllImport ( "api-ms-win-core-file-fromapp-l1-1-0.dll" , CharSet = CharSet . Auto , CallingConvention = CallingConvention . StdCall , SetLastError = true ) ]
232
183
public static extern IntPtr CreateFileFromApp (
233
184
string lpFileName ,
@@ -252,14 +203,6 @@ public static extern bool SetFileAttributesFromApp(
252
203
string lpFileName ,
253
204
FileAttributes dwFileAttributes ) ;
254
205
255
- [ DllImport ( "api-ms-win-core-file-l1-2-1.dll" , ExactSpelling = true , CallingConvention = CallingConvention . StdCall , SetLastError = true ) ]
256
- public static extern uint SetFilePointer (
257
- IntPtr hFile ,
258
- long lDistanceToMove ,
259
- IntPtr lpDistanceToMoveHigh ,
260
- uint dwMoveMethod
261
- ) ;
262
-
263
206
[ DllImport ( "api-ms-win-core-file-l1-2-1.dll" , CharSet = CharSet . Auto , CallingConvention = CallingConvention . StdCall , SetLastError = true ) ]
264
207
public unsafe static extern bool ReadFile (
265
208
IntPtr hFile ,
@@ -310,14 +253,6 @@ public static extern bool GetFileInformationByHandleEx(
310
253
uint dwBufferSize
311
254
) ;
312
255
313
- [ DllImport ( "api-ms-win-core-file-l2-1-1.dll" , CharSet = CharSet . Auto , CallingConvention = CallingConvention . StdCall , SetLastError = true ) ]
314
- public static extern bool GetFileInformationByHandleEx (
315
- IntPtr hFile ,
316
- FILE_INFO_BY_HANDLE_CLASS infoClass ,
317
- IntPtr dirInfo ,
318
- uint dwBufferSize
319
- ) ;
320
-
321
256
[ DllImport ( "kernel32.dll" , ExactSpelling = true , CharSet = CharSet . Auto , SetLastError = true ) ]
322
257
public static extern IntPtr FindFirstStreamW (
323
258
string lpFileName ,
@@ -333,49 +268,6 @@ public static extern bool FindNextStreamW(
333
268
[ In , Out , MarshalAs ( UnmanagedType . LPStruct ) ] WIN32_FIND_STREAM_DATA lpFindStreamData
334
269
) ;
335
270
336
- [ DllImport ( "Shcore.dll" , SetLastError = true ) ]
337
- public static extern int GetDpiForMonitor (
338
- IntPtr hmonitor ,
339
- uint dpiType ,
340
- out uint dpiX ,
341
- out uint dpiY
342
- ) ;
343
-
344
- [ DllImport ( "api-ms-win-core-processthreads-l1-1-0.dll" , SetLastError = true , ExactSpelling = true ) ]
345
- [ return : MarshalAs ( UnmanagedType . Bool ) ]
346
- public static extern bool OpenProcessToken (
347
- [ In ] IntPtr ProcessHandle , TokenAccess DesiredAccess , out IntPtr TokenHandle ) ;
348
-
349
- [ DllImport ( "api-ms-win-core-processthreads-l1-1-2.dll" , SetLastError = true , ExactSpelling = true ) ]
350
- public static extern IntPtr GetCurrentProcess ( ) ;
351
-
352
- [ DllImport ( "api-ms-win-security-base-l1-1-0.dll" , SetLastError = true , ExactSpelling = true ) ]
353
- [ return : MarshalAs ( UnmanagedType . Bool ) ]
354
- public static extern bool GetTokenInformation (
355
- IntPtr hObject ,
356
- TOKEN_INFORMATION_CLASS tokenInfoClass ,
357
- IntPtr pTokenInfo ,
358
- int tokenInfoLength ,
359
- out int returnLength
360
- ) ;
361
-
362
- [ DllImport ( "api-ms-win-security-base-l1-1-0.dll" , ExactSpelling = true , SetLastError = true ) ]
363
- public static extern int GetLengthSid (
364
- IntPtr pSid
365
- ) ;
366
-
367
- [ DllImport ( "crypt32.dll" , SetLastError = true , CharSet = CharSet . Auto ) ]
368
- [ return : MarshalAs ( UnmanagedType . Bool ) ]
369
- public static extern bool CryptUnprotectData (
370
- in CRYPTOAPI_BLOB pDataIn ,
371
- StringBuilder szDataDescr ,
372
- in CRYPTOAPI_BLOB pOptionalEntropy ,
373
- IntPtr pvReserved ,
374
- IntPtr pPromptStruct ,
375
- CryptProtectFlags dwFlags ,
376
- out CRYPTOAPI_BLOB pDataOut
377
- ) ;
378
-
379
271
[ DllImport ( "api-ms-win-core-wow64-l1-1-1.dll" , SetLastError = true ) ]
380
272
public static extern bool IsWow64Process2 (
381
273
IntPtr process ,
@@ -410,19 +302,6 @@ public static extern IntPtr FindFirstFileExFromApp(
410
302
int dwAdditionalFlags
411
303
) ;
412
304
413
- [ DllImport ( "api-ms-win-core-string-l1-1-0.dll" , CharSet = CharSet . Unicode ) ]
414
- public static extern int CompareStringEx (
415
- string localeName ,
416
- int flags ,
417
- string str1 ,
418
- int count1 ,
419
- string str2 ,
420
- int count2 ,
421
- IntPtr versionInformation ,
422
- IntPtr reserved ,
423
- int param
424
- ) ;
425
-
426
305
[ LibraryImport ( "shell32.dll" , EntryPoint = "#865" , SetLastError = true ) ]
427
306
[ return : MarshalAs ( UnmanagedType . Bool ) ]
428
307
public static partial bool IsElevationRequired (
0 commit comments