Пример #1
0
 public static extern unsafe SafeObjectHandle CreateThread(
     SECURITY_ATTRIBUTES *lpThreadAttributes,
     SIZE_T dwStackSize,
     THREAD_START_ROUTINE lpStartAddress,
     IntPtr lpParameter,
     CreateProcessFlags dwCreationFlags,
     int *lpThreadId);
Пример #2
0
        internal static unsafe bool CreateDirectory(string path, SECURITY_ATTRIBUTES *lpSecurityAttributes)
        {
            // We always want to add for CreateDirectory to get around the legacy 248 character limitation
            path = PathInternal.EnsureExtendedPrefix(path);

            return(CreateDirectoryPrivate(path, lpSecurityAttributes));
        }
Пример #3
0
 private static extern unsafe SafeFileHandle CreateFilePrivate(
     string lpFileName,
     int dwDesiredAccess,
     FileShare dwShareMode,
     SECURITY_ATTRIBUTES *lpSecurityAttributes,
     FileMode dwCreationDisposition,
     int dwFlagsAndAttributes,
     IntPtr hTemplateFile);
Пример #4
0
 public unsafe static extern SafeFileHandle CreateFileW(
     string lpFileName,
     DesiredAccess dwDesiredAccess,
     ShareModes dwShareMode,
     SECURITY_ATTRIBUTES *lpSecurityAttributes,
     CreationDisposition dwCreationDisposition,
     uint dwFlagsAndAttributes,
     IntPtr hTemplateFile);
 private static unsafe partial IntPtr CreateFilePrivate_IntPtr(
     string lpFileName,
     int dwDesiredAccess,
     FileShare dwShareMode,
     SECURITY_ATTRIBUTES *lpSecurityAttributes,
     FileMode dwCreationDisposition,
     int dwFlagsAndAttributes,
     IntPtr hTemplateFile);
Пример #6
0
 public unsafe static extern PipeHandle CreateNamedPipeW(
     string lpName,
     uint dwOpenMode,
     uint dwPipeMode,
     uint nMaxInstances,
     uint nOutBufferSize,
     uint nInBufferSize,
     uint nDefaultTimeOut,
     SECURITY_ATTRIBUTES *lpSecurityAttributes);
Пример #7
0
 unsafe static extern System.Int32 FilterConnectCommunicationPort
 (
     [MarshalAs(UnmanagedType.LPWStr)] System.String lpPortName,
     System.UInt32 dwOptions,
     System.IntPtr lpContext,
     System.UInt16 dwSizeOfContext,
     SECURITY_ATTRIBUTES *lpSecurityAttributes,
     System.IntPtr *hPort
 );
Пример #8
0
 unsafe static extern bool CreateProcessAsUser(
     IntPtr hToken,
     string lpApplicationName,
     string lpCommandLine,
     SECURITY_ATTRIBUTES *lpProcessAttributes,
     SECURITY_ATTRIBUTES *lpThreadAttributes,
     bool bInheritHandles,
     uint dwCreationFlags,
     IntPtr lpEnvironment,
     string lpCurrentDirectory,
     ref STARTUPINFO lpStartupInfo,
     out PROCESS_INFORMATION lpProcessInformation);
Пример #9
0
 internal static unsafe SafeFileHandle CreateFile(
     string lpFileName,
     int dwDesiredAccess,
     FileShare dwShareMode,
     SECURITY_ATTRIBUTES *lpSecurityAttributes,
     FileMode dwCreationDisposition,
     int dwFlagsAndAttributes,
     IntPtr hTemplateFile)
 {
     lpFileName = PathInternal.EnsureExtendedPrefixIfNeeded(lpFileName);
     return(CreateFilePrivate(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile));
 }
Пример #10
0
 /// <inheritdoc cref="CreateFile(char*, ACCESS_MASK, FileShare, SECURITY_ATTRIBUTES*, CreationDisposition, CreateFileFlags, SafeObjectHandle)"/>
 /// <devremarks>
 /// This should be removed as part of delivering <see href="https://github.com/dotnet/pinvoke/issues/286">the string-overload codegen feature</see>.
 /// </devremarks>
 public static unsafe SafeObjectHandle CreateFile(
     string filename,
     ACCESS_MASK access,
     FileShare share,
     [Friendly(FriendlyFlags.In | FriendlyFlags.Optional)] SECURITY_ATTRIBUTES *securityAttributes,
     CreationDisposition creationDisposition,
     CreateFileFlags flagsAndAttributes,
     SafeObjectHandle templateFile)
 {
     fixed(char *pFileName = filename)
     {
         return(CreateFile(pFileName, access, share, securityAttributes, creationDisposition, flagsAndAttributes, templateFile));
     }
 }
        private static unsafe IntPtr CreateFile(
            string lpFileName,
            int dwDesiredAccess,
            FileShare dwShareMode,
            SECURITY_ATTRIBUTES *securityAttrs,
            FileMode dwCreationDisposition,
            int dwFlagsAndAttributes,
            IntPtr hTemplateFile)
        {
            CREATEFILE2_EXTENDED_PARAMETERS parameters;

            parameters.dwSize = (uint)Marshal.SizeOf <CREATEFILE2_EXTENDED_PARAMETERS>();

            parameters.dwFileAttributes   = (uint)dwFlagsAndAttributes & 0x0000FFFF;
            parameters.dwSecurityQosFlags = (uint)dwFlagsAndAttributes & 0x000F0000;
            parameters.dwFileFlags        = (uint)dwFlagsAndAttributes & 0xFFF00000;

            parameters.hTemplateFile        = hTemplateFile;
            parameters.lpSecurityAttributes = securityAttrs;

            return(CreateFile2(lpFileName, dwDesiredAccess, dwShareMode, dwCreationDisposition, ref parameters));
        }
Пример #12
0
 public int CreateSharedHandle([NativeTypeName("IInspectable *")] IInspectable *pObject, [NativeTypeName("const SECURITY_ATTRIBUTES *")] SECURITY_ATTRIBUTES *pSecurityAttributes, [NativeTypeName("DWORD")] uint Access, [NativeTypeName("HSTRING")] IntPtr Name, [NativeTypeName("HANDLE *")] IntPtr *pHandle)
 {
     return(((delegate * unmanaged <IDisplayDeviceInterop *, IInspectable *, SECURITY_ATTRIBUTES *, uint, IntPtr, IntPtr *, int>)(lpVtbl[3]))((IDisplayDeviceInterop *)Unsafe.AsPointer(ref this), pObject, pSecurityAttributes, Access, Name, pHandle));
 }
Пример #13
0
 public static extern HANDLE CreateTransaction([NativeTypeName("LPSECURITY_ATTRIBUTES")] SECURITY_ATTRIBUTES *lpTransactionAttributes, [NativeTypeName("LPGUID")] Guid *UOW, [NativeTypeName("DWORD")] uint CreateOptions, [NativeTypeName("DWORD")] uint IsolationLevel, [NativeTypeName("DWORD")] uint IsolationFlags, [NativeTypeName("DWORD")] uint Timeout, [NativeTypeName("LPWSTR")] ushort *Description);
Пример #14
0
 public static extern HRESULT DCompositionCreateSurfaceHandle([NativeTypeName("DWORD")] uint desiredAccess, SECURITY_ATTRIBUTES *securityAttributes, HANDLE *surfaceHandle);
Пример #15
0
 public static extern unsafe SafeObjectHandle CreateMutex(
     [Friendly(FriendlyFlags.Optional | FriendlyFlags.In)] SECURITY_ATTRIBUTES *lpMutexAttributes,
     [MarshalAs(UnmanagedType.Bool)] bool bInitialOwner,
     string lpName);
Пример #16
0
 public static extern HANDLE CreateFileMappingW(HANDLE hFile, [NativeTypeName("LPSECURITY_ATTRIBUTES")] SECURITY_ATTRIBUTES* lpFileMappingAttributes, [NativeTypeName("DWORD")] uint flProtect, [NativeTypeName("DWORD")] uint dwMaximumSizeHigh, [NativeTypeName("DWORD")] uint dwMaximumSizeLow, [NativeTypeName("LPCWSTR")] ushort* lpName);
Пример #17
0
 public unsafe static extern SafeMailslotHandle CreateMailslotW(
     string lpName,
     uint nMaxMessageSize,
     uint lReadTimeout,
     SECURITY_ATTRIBUTES *lpSecurityAttributes);
Пример #18
0
 public static extern HANDLE CreateFileMappingFromApp(HANDLE hFile, [NativeTypeName("PSECURITY_ATTRIBUTES")] SECURITY_ATTRIBUTES* SecurityAttributes, [NativeTypeName("ULONG")] uint PageProtection, [NativeTypeName("ULONG64")] ulong MaximumSize, [NativeTypeName("PCWSTR")] ushort* Name);
Пример #19
0
 public static unsafe extern EventHandle CreateEventW(
     SECURITY_ATTRIBUTES *lpEventAttributes,
     bool bManualReset,
     bool bInitialState,
     string lpName);
Пример #20
0
 public static extern int CreateDirectoryW([NativeTypeName("LPCWSTR")] ushort *lpPathName, [NativeTypeName("LPSECURITY_ATTRIBUTES")] SECURITY_ATTRIBUTES *lpSecurityAttributes);
 public static extern IntPtr CreatePrivateNamespaceW([NativeTypeName("LPSECURITY_ATTRIBUTES")] SECURITY_ATTRIBUTES *lpPrivateNamespaceAttributes, [NativeTypeName("LPVOID")] void *lpBoundaryDescriptor, [NativeTypeName("LPCWSTR")] ushort *lpAliasPrefix);
Пример #22
0
 public static extern IntPtr CreateFileW([NativeTypeName("LPCWSTR")] ushort *lpFileName, [NativeTypeName("DWORD")] uint dwDesiredAccess, [NativeTypeName("DWORD")] uint dwShareMode, [NativeTypeName("LPSECURITY_ATTRIBUTES")] SECURITY_ATTRIBUTES *lpSecurityAttributes, [NativeTypeName("DWORD")] uint dwCreationDisposition, [NativeTypeName("DWORD")] uint dwFlagsAndAttributes, [NativeTypeName("HANDLE")] IntPtr hTemplateFile);
Пример #23
0
 public static extern int DCompositionCreateSurfaceHandle([NativeTypeName("DWORD")] uint desiredAccess, [NativeTypeName("SECURITY_ATTRIBUTES *")] SECURITY_ATTRIBUTES *securityAttributes, [NativeTypeName("HANDLE *")] IntPtr *surfaceHandle);
Пример #24
0
 public unsafe static extern bool CreatePipe(
     out SafeFileHandle hReadPipe,
     out SafeFileHandle hWritePipe,
     SECURITY_ATTRIBUTES *lpPipeAttributes,
     uint nSize);
Пример #25
0
 public int CreateSharedHandle([NativeTypeName("const SECURITY_ATTRIBUTES *")] SECURITY_ATTRIBUTES *pAttributes, [NativeTypeName("DWORD")] uint dwAccess, [NativeTypeName("LPCWSTR")] ushort *lpName, [NativeTypeName("HANDLE *")] IntPtr *pHandle)
 {
     return(((delegate * unmanaged <IDXGIResource1 *, SECURITY_ATTRIBUTES *, uint, ushort *, IntPtr *, int>)(lpVtbl[13]))((IDXGIResource1 *)Unsafe.AsPointer(ref this), pAttributes, dwAccess, lpName, pHandle));
 }
Пример #26
0
 public static extern HANDLE CreateFileMapping2(HANDLE File, SECURITY_ATTRIBUTES* SecurityAttributes, [NativeTypeName("ULONG")] uint DesiredAccess, [NativeTypeName("ULONG")] uint PageProtection, [NativeTypeName("ULONG")] uint AllocationAttributes, [NativeTypeName("ULONG64")] ulong MaximumSize, [NativeTypeName("PCWSTR")] ushort* Name, MEM_EXTENDED_PARAMETER* ExtendedParameters, [NativeTypeName("ULONG")] uint ParameterCount);
Пример #27
0
 public int CreateSharedHandle([NativeTypeName("ID3D12DeviceChild *")] ID3D12DeviceChild *pObject, [NativeTypeName("const SECURITY_ATTRIBUTES *")] SECURITY_ATTRIBUTES *pAttributes, [NativeTypeName("DWORD")] uint Access, [NativeTypeName("LPCWSTR")] ushort *Name, [NativeTypeName("HANDLE *")] IntPtr *pHandle)
 {
     return(((delegate * unmanaged <ID3D12Device *, ID3D12DeviceChild *, SECURITY_ATTRIBUTES *, uint, ushort *, IntPtr *, int>)(lpVtbl[31]))((ID3D12Device *)Unsafe.AsPointer(ref this), pObject, pAttributes, Access, Name, pHandle));
 }
Пример #28
0
 public static extern IntPtr CreateJobObjectW([NativeTypeName("LPSECURITY_ATTRIBUTES")] SECURITY_ATTRIBUTES *lpJobAttributes, [NativeTypeName("LPCWSTR")] ushort *lpName);
Пример #29
0
 public static extern IntPtr CreateConsoleScreenBuffer([NativeTypeName("DWORD")] uint dwDesiredAccess, [NativeTypeName("DWORD")] uint dwShareMode, [NativeTypeName("const SECURITY_ATTRIBUTES *")] SECURITY_ATTRIBUTES *lpSecurityAttributes, [NativeTypeName("DWORD")] uint dwFlags, [NativeTypeName("LPVOID")] void *lpScreenBufferData);
Пример #30
0
 public static extern HANDLE CreateTransactionManager([NativeTypeName("LPSECURITY_ATTRIBUTES")] SECURITY_ATTRIBUTES *lpTransactionAttributes, [NativeTypeName("LPWSTR")] ushort *LogFileName, [NativeTypeName("ULONG")] uint CreateOptions, [NativeTypeName("ULONG")] uint CommitStrength);