1- // Copyright (c) 2024 Files Community
1+ // Copyright (c) 2024 Files Community
22// Licensed under the MIT License. See the LICENSE.
33
44using System . IO ;
@@ -56,13 +56,6 @@ public static extern int RmGetList(
5656 ref uint lpdwRebootReasons
5757 ) ;
5858
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-
6659 [ DllImport ( "kernel32.dll" , CharSet = CharSet . Unicode ) ]
6760 public static extern IntPtr CreateEvent (
6861 IntPtr lpEventAttributes ,
@@ -102,39 +95,12 @@ public static extern bool CloseHandle(
10295 IntPtr hObject
10396 ) ;
10497
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-
11898 [ DllImport ( "api-ms-win-core-io-l1-1-1.dll" ) ]
11999 public static extern bool CancelIoEx (
120100 IntPtr hFile ,
121101 IntPtr lpOverlapped
122102 ) ;
123103
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-
138104 [ DllImport ( "api-ms-win-core-synch-l1-2-0.dll" , SetLastError = true ) ]
139105 public static extern uint WaitForSingleObjectEx (
140106 IntPtr hHandle ,
@@ -202,16 +168,6 @@ public static extern bool DeviceIoControl(
202168 out uint lpBytesReturned ,
203169 IntPtr lpOverlapped ) ;
204170
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-
215171 [ DllImport ( "user32.dll" , CharSet = CharSet . Auto ) ]
216172 public static extern int ToUnicodeEx (
217173 uint virtualKeyCode ,
@@ -223,11 +179,6 @@ public static extern int ToUnicodeEx(
223179 IntPtr keyboardLayout
224180 ) ;
225181
226- [ DllImport ( "user32.dll" ) ]
227- public static extern bool TranslateMessage (
228- ref MSG lpMsg
229- ) ;
230-
231182 [ DllImport ( "api-ms-win-core-file-fromapp-l1-1-0.dll" , CharSet = CharSet . Auto , CallingConvention = CallingConvention . StdCall , SetLastError = true ) ]
232183 public static extern IntPtr CreateFileFromApp (
233184 string lpFileName ,
@@ -252,14 +203,6 @@ public static extern bool SetFileAttributesFromApp(
252203 string lpFileName ,
253204 FileAttributes dwFileAttributes ) ;
254205
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-
263206 [ DllImport ( "api-ms-win-core-file-l1-2-1.dll" , CharSet = CharSet . Auto , CallingConvention = CallingConvention . StdCall , SetLastError = true ) ]
264207 public unsafe static extern bool ReadFile (
265208 IntPtr hFile ,
@@ -310,14 +253,6 @@ public static extern bool GetFileInformationByHandleEx(
310253 uint dwBufferSize
311254 ) ;
312255
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-
321256 [ DllImport ( "kernel32.dll" , ExactSpelling = true , CharSet = CharSet . Auto , SetLastError = true ) ]
322257 public static extern IntPtr FindFirstStreamW (
323258 string lpFileName ,
@@ -333,49 +268,6 @@ public static extern bool FindNextStreamW(
333268 [ In , Out , MarshalAs ( UnmanagedType . LPStruct ) ] WIN32_FIND_STREAM_DATA lpFindStreamData
334269 ) ;
335270
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-
379271 [ DllImport ( "api-ms-win-core-wow64-l1-1-1.dll" , SetLastError = true ) ]
380272 public static extern bool IsWow64Process2 (
381273 IntPtr process ,
@@ -410,19 +302,6 @@ public static extern IntPtr FindFirstFileExFromApp(
410302 int dwAdditionalFlags
411303 ) ;
412304
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-
426305 [ LibraryImport ( "shell32.dll" , EntryPoint = "#865" , SetLastError = true ) ]
427306 [ return : MarshalAs ( UnmanagedType . Bool ) ]
428307 public static partial bool IsElevationRequired (
0 commit comments