J
JLW
I'm having alot of difficulty with this one. I have seen no less than 20
different ways to use this function with a named pipe. I'm trying to use
\\.\TAPE0 (TapeDrive).
Here's my decleration:
[DllImport(
"kernel32.dll",
SetLastError=true,
EntryPoint="CreateFileA"
)]
internal static extern IntPtr CreateFile(
String filename,
UInt32 desiredAccess,
UInt32 shareMode,
IntPtr attributes, // Really, this is the SECURITY_ATTRIBUTES pointer
UInt32 creationDisposition,
UInt32 flagsAndAttributes,
IntPtr templateFile
);
And here's my call:
_Handle = CreateFile(
@"\\.\TAPE0",
GENERIC_READ | GENERIC_WRITE,
0,
IntPtr.Zero,
CREATE_NEW,
0,
IntPtr.Zero
);
It returns -1, so it's not working.
Thanks
JLW
different ways to use this function with a named pipe. I'm trying to use
\\.\TAPE0 (TapeDrive).
Here's my decleration:
[DllImport(
"kernel32.dll",
SetLastError=true,
EntryPoint="CreateFileA"
)]
internal static extern IntPtr CreateFile(
String filename,
UInt32 desiredAccess,
UInt32 shareMode,
IntPtr attributes, // Really, this is the SECURITY_ATTRIBUTES pointer
UInt32 creationDisposition,
UInt32 flagsAndAttributes,
IntPtr templateFile
);
And here's my call:
_Handle = CreateFile(
@"\\.\TAPE0",
GENERIC_READ | GENERIC_WRITE,
0,
IntPtr.Zero,
CREATE_NEW,
0,
IntPtr.Zero
);
It returns -1, so it's not working.
Thanks
JLW