This compiles without error but when I run this code section some strange error appears:
FatalExecutionEngineError was detected
Message: The runtime has encountered a fatal error. The address of the error was at 0x792062fb, on thread 0xd7c. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
I try something like follows:
Public Enum PipePolicyType
SHORT_PACKET_TERMINATE = 1
AUTO_CLEAR_STALL = 2
PIPE_TRANSFER_TIMEOUT = 3
IGNORE_SHORT_PACKETS = 4
ALLOW_PARTIAL_READS = 5
AUTO_FLUSH = 6
RAW_IO = 7
RESET_PIPE_ON_RESUME = 9
End Enum
...
...
Dim a As UInt32 = 3000
SetPolicy(1, PIPE_TRANSFER_TIMEOUT, a)
...
...
Public Sub SetPolicy(ByVal ep As Integer, ByVal PolicyType As PipePolicyType, ByVal PolicyValue As UInt32)
end sub
what is wrong ?
You need to call it using PipePolicyType.PIPE_TRANSFER_TIMEOUT