Delete unused multibyte methods from PAL (#42157)
[platform/upstream/dotnet/runtime.git] / src / libraries / System.Data.OleDb / src / NativeMethods.cs
1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3
4 using System.Runtime.InteropServices;
5
6 namespace System.Data.Common
7 {
8     internal static class NativeMethods
9     {
10         [Guid("0c733a1e-2a1c-11ce-ade5-00aa0044773d"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), ComImport]
11         internal interface ISourcesRowset
12         {
13             [PreserveSig]
14             System.Data.OleDb.OleDbHResult GetSourcesRowset(
15                 [In] IntPtr pUnkOuter,
16                 [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid,
17                 [In] int cPropertySets,
18                 [In] IntPtr rgProperties,
19                 [Out, MarshalAs(UnmanagedType.Interface)] out object ppRowset);
20         }
21
22         [Guid("0C733A5E-2A1C-11CE-ADE5-00AA0044773D"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), ComImport]
23         internal interface ITransactionJoin
24         {
25             [Obsolete("not used", true)]
26             [PreserveSig]
27             int GetOptionsObject(IntPtr ppOptions);
28
29             void JoinTransaction(
30                 [In, MarshalAs(UnmanagedType.Interface)] object? punkTransactionCoord,
31                 [In] int isoLevel,
32                 [In] int isoFlags,
33                 [In] IntPtr pOtherOptions);
34         }
35
36         [DllImport(Interop.Libraries.Kernel32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto)]
37         internal static extern IntPtr MapViewOfFile(IntPtr hFileMappingObject, int dwDesiredAccess, int dwFileOffsetHigh, int dwFileOffsetLow, IntPtr dwNumberOfBytesToMap);
38
39         [DllImport(Interop.Libraries.Kernel32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto)]
40         internal static extern bool UnmapViewOfFile(IntPtr lpBaseAddress);
41
42         [DllImport(Interop.Libraries.Kernel32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)]
43         internal static extern bool CloseHandle(IntPtr handle);
44
45         [DllImport(Interop.Libraries.Advapi32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)]
46         internal static extern bool AllocateAndInitializeSid(
47             IntPtr pIdentifierAuthority, // authority
48             byte nSubAuthorityCount,                        // count of subauthorities
49             int dwSubAuthority0,                          // subauthority 0
50             int dwSubAuthority1,                          // subauthority 1
51             int dwSubAuthority2,                          // subauthority 2
52             int dwSubAuthority3,                          // subauthority 3
53             int dwSubAuthority4,                          // subauthority 4
54             int dwSubAuthority5,                          // subauthority 5
55             int dwSubAuthority6,                          // subauthority 6
56             int dwSubAuthority7,                          // subauthority 7
57             ref IntPtr pSid);                                   // SID
58
59         [DllImport(Interop.Libraries.Advapi32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)]
60         internal static extern int GetLengthSid(
61                     IntPtr pSid);   // SID to query
62
63         [DllImport(Interop.Libraries.Advapi32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)]
64         internal static extern bool InitializeAcl(
65             IntPtr pAcl,            // ACL
66             int nAclLength,     // size of ACL
67             int dwAclRevision);  // revision level of ACL
68
69         [DllImport(Interop.Libraries.Advapi32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)]
70         internal static extern bool AddAccessDeniedAce(
71             IntPtr pAcl,            // access control list
72             int dwAceRevision,  // ACL revision level
73             int AccessMask,     // access mask
74             IntPtr pSid);           // security identifier
75
76         [DllImport(Interop.Libraries.Advapi32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)]
77         internal static extern bool AddAccessAllowedAce(
78             IntPtr pAcl,            // access control list
79             int dwAceRevision,  // ACL revision level
80             uint AccessMask,     // access mask
81             IntPtr pSid);           // security identifier
82
83         [DllImport(Interop.Libraries.Advapi32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)]
84         internal static extern bool InitializeSecurityDescriptor(
85             IntPtr pSecurityDescriptor, // SD
86             int dwRevision);                         // revision level
87         [DllImport(Interop.Libraries.Advapi32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)]
88         internal static extern bool SetSecurityDescriptorDacl(
89             IntPtr pSecurityDescriptor, // SD
90             bool bDaclPresent,                        // DACL presence
91             IntPtr pDacl,                               // DACL
92             bool bDaclDefaulted);                       // default DACL
93
94         [DllImport(Interop.Libraries.Advapi32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)]
95         internal static extern IntPtr FreeSid(
96             IntPtr pSid);   // SID to free
97     }
98 }