Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is a version for C#</p> <pre><code>using System.Runtime.InteropServices; class Program { static void Main(string[] args) { var mainStream = NativeMethods.CreateFileW( "testfile", NativeConstants.GENERIC_WRITE, NativeConstants.FILE_SHARE_WRITE, IntPtr.Zero, NativeConstants.OPEN_ALWAYS, 0, IntPtr.Zero); var stream = NativeMethods.CreateFileW( "testfile:stream", NativeConstants.GENERIC_WRITE, NativeConstants.FILE_SHARE_WRITE, IntPtr.Zero, NativeConstants.OPEN_ALWAYS, 0, IntPtr.Zero); } } public partial class NativeMethods { /// Return Type: HANDLE-&gt;void* ///lpFileName: LPCWSTR-&gt;WCHAR* ///dwDesiredAccess: DWORD-&gt;unsigned int ///dwShareMode: DWORD-&gt;unsigned int ///lpSecurityAttributes: LPSECURITY_ATTRIBUTES-&gt;_SECURITY_ATTRIBUTES* ///dwCreationDisposition: DWORD-&gt;unsigned int ///dwFlagsAndAttributes: DWORD-&gt;unsigned int ///hTemplateFile: HANDLE-&gt;void* [DllImportAttribute("kernel32.dll", EntryPoint = "CreateFileW")] public static extern System.IntPtr CreateFileW( [InAttribute()] [MarshalAsAttribute(UnmanagedType.LPWStr)] string lpFileName, uint dwDesiredAccess, uint dwShareMode, [InAttribute()] System.IntPtr lpSecurityAttributes, uint dwCreationDisposition, uint dwFlagsAndAttributes, [InAttribute()] System.IntPtr hTemplateFile ); } public partial class NativeConstants { /// GENERIC_WRITE -&gt; (0x40000000L) public const int GENERIC_WRITE = 1073741824; /// FILE_SHARE_DELETE -&gt; 0x00000004 public const int FILE_SHARE_DELETE = 4; /// FILE_SHARE_WRITE -&gt; 0x00000002 public const int FILE_SHARE_WRITE = 2; /// FILE_SHARE_READ -&gt; 0x00000001 public const int FILE_SHARE_READ = 1; /// OPEN_ALWAYS -&gt; 4 public const int OPEN_ALWAYS = 4; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload