Пример #1
0
 internal static extern unsafe uint HttpCreateRequestQueue(HTTPAPI_VERSION version, string pName,
                                                           Interop.Kernel32.SECURITY_ATTRIBUTES *pSecurityAttributes, uint flags, out HttpRequestQueueV2Handle pReqQueueHandle);
            static unsafe SafeFileHandle CreateFileHandleInternal(string fullPath, FileMode mode, FileSystemRights rights, FileShare share, int flagsAndAttributes, Interop.Kernel32.SECURITY_ATTRIBUTES *secAttrs)
            {
                SafeFileHandle handle;

                using (DisableMediaInsertionPrompt.Create())
                {
                    // The Inheritable bit is only set in the SECURITY_ATTRIBUTES struct,
                    // and should not be passed to the CreateFile P/Invoke.
                    handle = Interop.Kernel32.CreateFile(fullPath, (int)rights, (share & ~FileShare.Inheritable), secAttrs, mode, flagsAndAttributes, IntPtr.Zero);
                    ValidateFileHandle(handle, fullPath);
                }
                return(handle);
            }