System.Data.SqlClient
represents the application workload type when connecting to a server
Extension methods on the DiagnosticListener class to log SqlCommand data
SqlServer only supports CatalogLocation.Start
SqlServer only supports '.'
SqlServer only supports '.'
Assert that the supplied object is an instance of a SQL User-Defined Type (UDT).
Object instance to be tested.
Failed assert message
This method is only compiled with debug builds, and it a helper method for the GetComValueFromSqlVariant method defined in this class.
The presence of the SqlUserDefinedTypeAttribute on the object's type
is used to determine if the object is a UDT instance (if present it is a UDT, else it is not).
If sqlValue is null. Callers must ensure the object is non-null.
Represents the method that will handle the event of a .
Validate the enlisted transaction state, taking into consideration the ambient transaction and transaction unbinding mode.
If there is no enlisted transaction, this method is a nop.
This method must be called while holding a lock on the SqlInternalConnection instance,
to ensure we don't accidentally execute after the transaction has completed on a different thread,
causing us to unwittingly execute in auto-commit mode.
When using Explicit transaction unbinding,
verify that the enlisted transaction is active and equal to the current ambient transaction.
When using Implicit transaction unbinding,
verify that the enlisted transaction is active.
If it is not active, and the transaction object has been disposed, unbind from the transaction.
If it is not active and not disposed, throw an exception.
Forces the stream to act as if it was closed (i.e. CanRead=false and Read() throws)
This does not actually close the stream, read off the rest of the data or dispose this
Checks the parameters passed into a Read() method are valid
Forces the TextReader to act as if it was closed
This does not actually close the stream, read off the rest of the data or dispose this
Performs the actual reading and converting
NOTE: This assumes that buffer, index and count are all valid, we're not closed (!IsClosed) and that there is data left (IsDataLeft())
Creates a byte array large enough to store all bytes for the characters in the current encoding, then fills it with any leftover bytes
Number of characters that are to be read
Number of bytes pre-filled by the leftover bytes
A byte array of the correct size, pre-filled with leftover bytes
Decodes the given bytes into characters, and stores the leftover bytes for later use
Buffer of bytes to decode
Number of bytes to decode from the inBuffer
Buffer to write the characters to
Offset to start writing to outBuffer at
Maximum number of characters to decode
The actual number of characters decoded
True if this TextReader is supposed to be closed
True if there is a peeked character available
Checks the parameters passed into a Read() method are valid
used to block two scenarios if MultiSubnetFailover is true:
* server-provided failover partner - raising SqlException in this case
* connection string with failover partner and MultiSubnetFailover=true - raising argument one in this case with the same message
gets a message for SNI error (sniError must be valid, non-zero error code)
This class holds helper methods to escape Microsoft SQL Server identifiers, such as table, schema, database or other names
Escapes the identifier with square brackets. The input has to be in unescaped form, like the parts received from MultipartIdentifier.ParseMultipartIdentifier.
name of the identifier, in unescaped form
escapes the name with [], also escapes the last close bracket with double-bracket
Same as above EscapeIdentifier, except that output is written into StringBuilder
Escape a string to be used inside TSQL literal, such as N'somename' or 'somename'
Escape a string as a TSQL literal, wrapping it around with single quotes.
Use this method to escape input strings to prevent SQL injection
and to get correct behavior for embedded quotes.
unescaped string
escaped and quoted literal string
This class holds methods invoked on System.Transactions through reflection for Global Transactions
Enlists the given IPromotableSinglePhaseNotification and Non-MSDTC Promoter type into a transaction
The MethodInfo instance to be invoked. Null if the method doesn't exist
Sets the given DistributedTransactionIdentifier for a Transaction instance.
Needs to be invoked when using a Non-MSDTC Promoter type
The MethodInfo instance to be invoked. Null if the method doesn't exist
Gets the Promoted Token for a Transaction
The MethodInfo instance to be invoked. Null if the method doesn't exist
Class of variables for the Tds connection.
Checks if the given token is a valid TDS token
Token to check
True if the token is a valid TDS token, otherwise false
This method skips bytes of a single column value from the media. It supports NBCROW and handles all types of values, including PLP and long
Struct encapsulating the data to be sent to the server as part of Federated Authentication Feature Extension.
contains binary data, before using this field check newBinRented to see if you can take the field array or whether you should allocate and copy
contains binary data, before using this field check newBinRented to see if you can take the field array or whether you should allocate and copy
If this method returns true, the value is guaranteed to be null. This is not true vice versa:
if the bitmap value is false (if this method returns false), the value can be either null or non-null - no guarantee in this case.
To determine whether it is null or not, read it from the TDS (per NBCROW design spec, for IMAGE/TEXT/NTEXT columns server might send
bitmap = 0, when the actual value is null).
attempts to change the timout state from the expected state to the target state and if it succeeds
will setup the the stateobject into the timeout expired state
the state that is the expected current state, state will change only if this is correct
the state that will be changed to if the expected state is correct
any close action to be taken by an async task to avoid deadlock.
boolean value indicating whether the call changed the timeout state
Checks to see if the underlying connection is still alive (used by connection pool resiliency)
NOTE: This is not safe to do on a connection that is currently in use
NOTE: This will mark the connection as broken if it is found to be dead
If true then an exception will be thrown if the connection is found to be dead, otherwise no exception will be thrown
True if the connection is still alive, otherwise false
Checks to see if the underlying connection is still valid (used by idle connection resiliency - for active connections)
NOTE: This is not safe to do on a connection that is currently in use
NOTE: This will mark the connection as broken if it is found to be dead
True if the connection is still alive, otherwise false
True if there is at least one error or warning (not counting the pre-attention errors\warnings)
Adds an error to the error collection
Gets the number of errors currently in the error collection
Adds an warning to the warning collection
Gets the number of warnings currently in the warning collection
Gets the full list of errors and warnings (including the pre-attention ones), then wipes all error and warning lists
If true, the connection should be broken
An array containing all of the errors and warnings
Stores away current errors and warnings so that an attention can be processed
Restores errors and warnings that were stored in order to process an attention
Checks if an error is stored in _error and, if so, throws an error
Debug Only: Ensures that the TdsParserStateObject has no lingering state and can safely be re-used
SNI error
SNI connection handle
Dispose class
Set async callbacks
Receive callback
Send callback
Set buffer size
Buffer size
Send a packet synchronously
SNI packet
SNI error code
Send a packet asynchronously
SNI packet
Whether to dispose package after sending async
Completion callback
SNI error code
Receive a packet synchronously
SNI packet
Timeout in Milliseconds
SNI error code
Receive a packet asynchronously
SNI packet
SNI error code
Enable SSL
Disable SSL
Check connection status
SNI error code
Last handle status
Connection ID
Test handle for killing underlying connection
Global SNI settings and status
Last SNI error
SNI library status
Encryption options setting
SNI MARS connection. Multiple MARS streams will be overlaid on this connection.
Connection ID
Constructor
Lower handle
Start receiving
Send a packet synchronously
SNI packet
SNI error code
Send a packet asynchronously
SNI packet
Completion callback
SNI error code
Receive a packet asynchronously
SNI packet
SNI error code
Check SNI handle connection
SNI error status
Process a receive error
Process a send completion
SNI packet
SNI error code
Process a receive completion
SNI packet
SNI error code
Enable SSL
Disable SSL
Test handle for killing underlying connection
MARS handle
Dispose object
Constructor
MARS connection
MARS session ID
Callback object
true if connection is asynchronous
Send control packet
SMUX header flags
Generate a packet with SMUX header
SNI packet
The packet with the SMUx header set.
Send a packet synchronously
SNI packet
SNI error code
Send packet asynchronously
SNI packet
Completion callback
SNI error code
Send pending packets
SNI error code
Send a packet asynchronously
SNI packet
Whether to dispose packet after sending async
Completion callback
SNI error code
Receive a packet asynchronously
SNI packet
SNI error code
Handle receive error
Handle send completion
SNI packet
SNI error code
Handle SMUX acknowledgement
Send highwater mark
Handle receive completion
SNI packet
SMUX header
Send ACK if we've hit highwater threshold
Receive a packet synchronously
SNI packet
Timeout in Milliseconds
SNI error code
Check SNI handle connection
SNI error status
Set async callbacks
Receive callback
Send callback
Set buffer size
Buffer size
Enable SSL
Disable SSL
Test handle for killing underlying connection
Mars queued packet
Constructor
SNI packet
Completion callback
SNI packet
Completion callback
Named Pipe connection handle
Validate server certificate
Sender object
X.509 certificate
X.509 chain
Policy errors
true if valid
Set buffer size
Buffer size
Test handle for killing underlying connection
Dispose Packet data
Length of data left to process
Length of data
Packet validity
Set async completion callback
Completion callback
Invoke the completion callback
SNI error
Allocate space for data
Length of header
Length of byte array to be allocated
Read packet data into a buffer without removing it from the packet
Buffer
Number of bytes read from the packet into the buffer
Take data from another packet
Packet
Data to take
Amount of data taken
Append data
Data
Size
Read data from the packet into the buffer at dataOffset for zize and then remove that data from the packet
Buffer
Data offset to write data at
Number of bytes to read from the packet into the buffer
Release packet
Read data from a stream asynchronously
Stream to read from
Completion callback
Read data from a stream synchronously
Stream to read from
Write data to a stream asynchronously
Stream to write to
SNI Asynchronous Callback
SNI provider identifier
Bool flag to decide whether or not to dispose after Write Async operation
Write data to a stream synchronously
Stream to write to
Managed SNI proxy implementation. Contains many SNI entry points used by SqlClient.
Terminate SNI
Enable SSL on a connection
Connection handle
SSL options
SNI error code
Disable SSL on a connection
Connection handle
SNI error code
Generate SSPI context
SSPI client context status
Receive buffer
Send buffer
Service Principal Name buffer
SNI error code
Initialize SSPI
Max length of SSPI packet
SNI error code
Set connection buffer size
SNI handle
Buffer size
SNI error code
Copies data in SNIPacket to given byte array parameter
SNIPacket object containing data packets
Destination byte array where data packets are copied to
Length of data packets
SNI error status
Read synchronously
SNI handle
SNI packet
Timeout
SNI error status
Get SNI connection ID
SNI handle
Client connection ID
SNI error status
Send a packet
SNI handle
SNI packet
true if synchronous, false if asynchronous
SNI error status
Create a SNI connection handle
Asynchronous I/O callback object
Full server name from connection string
Ignore open timeout
Timer expiration
Instance name
SPN
Flush packet cache
Asynchronous connection
Attempt parallel connects
Whether integrated security is enabled
SNI handle
Creates an SNITCPHandle object
Data source
Timer expiration
Asynchronous I/O callback object
Should MultiSubnetFailover be used
SNITCPHandle
Creates an SNINpHandle object
Data source
Timer expiration
Asynchronous I/O callback object
Should MultiSubnetFailover be used. Only returns an error for named pipes.
SNINpHandle
Read packet asynchronously
SNI handle
Packet
SNI error status
Set packet data
SNI packet
Data
Length
Release packet
SNI packet
Check SNI handle connection
SNI error status
Get last SNI error on this thread
Gets the Local db Named pipe data source if the input is a localDB server.
The data source
Set true when an error occurred while getting LocalDB up
Provides the HostName of the server to connect to for TCP protocol.
This information is also used for finding the SPN of SqlServer
Provides the port on which the TCP connection should be made if one was specified in Data Source
Provides the inferred Instance Name from Server Data Source
Provides the pipe name in case of Named Pipes
Provides the HostName to connect to in case of Named pipes Data Source
TCP connection handle
Dispose object
Connection ID
Connection status
Constructor
Server name
TCP port number
Connection timer expiration
Callback object
Open in parallel
Enable SSL
Disable SSL
Validate server certificate callback
Sender object
X.509 certificate
X.509 chain
Policy errors
True if certificate is valid
Set buffer size
Buffer size
Send a packet synchronously
SNI packet
SNI error code
Receive a packet synchronously
SNI packet
Timeout in Milliseconds
SNI error code
Set async callbacks
Receive callback
Send callback
Send a packet asynchronously
SNI packet
Whether to dispose packet after sending async
Completion callback
SNI error code
Receive a packet asynchronously
SNI packet
SNI error code
Check SNI handle connection
SNI error status
Test handle for killing underlying connection
SSL encapsulated over TDS transport. During SSL handshake, SSL packets are
transported in TDS packet type 0x12. Once SSL handshake has completed, SSL
packets are sent transparently.
Constructor
Underlying stream
Finish SSL handshake. Stop encapsulating in TDS.
Read buffer
Buffer
Offset
Byte count
Bytes read
Write Buffer
Write Buffer Asynchronosly
Read Buffer Asynchronosly
Read Internal is called synchronosly when async is false
The internal write method calls Sync APIs when Async flag is false
Set stream length.
Length
Flush stream
Get/set stream position
Seek in stream
Offset
Origin
Position
Check if stream can be read from
Check if stream can be written to
Check if stream can be seeked
Get stream length
SNI Asynchronous callback
SNI packet
SNI error code
SNI provider identifiers
SMUX packet header
SMUX packet flags
Validate server certificate callback for SSL
Server that client is expecting to connect to
Sender object
X.509 certificate
X.509 chain
Policy errors
True if certificate is valid
Sets last error encountered for SNI
SNI provider
Native error code
SNI error code
Error message
Sets last error encountered for SNI
SNI provider
SNI error code
SNI Exception
Sets last error encountered for SNI
SNI error
Finds instance port number for given instance name.
SQL Sever Browser hostname
instance name to find port number
port number for given instance name
Creates instance port lookup request (CLNT_UCAST_INST) for given instance name.
instance name to lookup port
Byte array of instance port lookup request (CLNT_UCAST_INST)
Finds DAC port for given instance name.
SQL Sever Browser hostname
instance name to lookup DAC port
DAC port for given instance name
Creates DAC port lookup request (CLNT_UCAST_DAC) for given instance name.
instance name to lookup DAC port
Byte array of DAC port lookup request (CLNT_UCAST_DAC)
Sends request to server, and receives response from server by UDP.
UDP server hostname
UDP server port
request packet
response packet from UDP server
Loads the User Instance dll.
Retrieves the part of the sqlUserInstance.dll from the registry
In case the dll path is not found, the error is set here.
This class defines the data structure for ActivityId used for correlated tracing between client (bid trace event) and server (XEvent).
It also includes all the APIs used to access the ActivityId. Note: ActivityId is thread based which is stored in TLS.
Get the current ActivityId
Increment the sequence number and generate the new ActivityId
ActivityId
This method attempts to convert the given value tp ApplicationIntent enum. The algorithm is:
* if the value is from type string, it will be matched against ApplicationIntent enum names only, using ordinal, case-insensitive comparer
* if the value is from type ApplicationIntent, it will be used as is
* if the value is from integral type (SByte, Int16, Int32, Int64, Byte, UInt16, UInt32, or UInt64), it will be converted to enum
* if the value is another enum or any other type, it will be blocked with an appropriate ArgumentException
in any case above, if the converted value is out of valid range, the method raises ArgumentOutOfRangeException.
application intent value in the valid range
This method attempts to convert the given value to a PoolBlockingPeriod enum. The algorithm is:
* if the value is from type string, it will be matched against PoolBlockingPeriod enum names only, using ordinal, case-insensitive comparer
* if the value is from type PoolBlockingPeriod, it will be used as is
* if the value is from integral type (SByte, Int16, Int32, Int64, Byte, UInt16, UInt32, or UInt64), it will be converted to enum
* if the value is another enum or any other type, it will be blocked with an appropriate ArgumentException
in any case above, if the conerted value is out of valid range, the method raises ArgumentOutOfRangeException.
PoolBlockingPeriod value in the valid range
Ensure that this connection cannot be put back into the pool.
The default implementation is for the open connection objects, and
it simply throws. Our private closed-state connection objects
override this and do the correct thing.
When overridden in a derived class, will check if the underlying connection is still actually alive
If true an exception will be thrown if the connection is dead instead of returning true\false
(this allows the caller to have the real reason that the connection is not alive (e.g. network error, etc))
True if the connection is still alive, otherwise false (If not overridden, then always true)
Get boolean value that indicates whether the enlisted transaction has been disposed.
True if there is an enlisted transaction, and it has been disposed.
False if there is an enlisted transaction that has not been disposed, or if the transaction reference is null.
This method must be called while holding a lock on the DbConnectionInternal instance.
Creates a new connection to replace an existing connection
Outer connection that currently owns
Options used to create the new connection
Inner connection that will be replaced
A new inner connection that is attached to the
This type provides workarounds for the separation between System.Data.Common
and System.Data.SqlClient. The latter wants to access internal members of the former, and
this class provides ways to do that. We must review and update this implementation any time the
implementation of the corresponding types in System.Data.Common change.
Constructs a SqlMoney from a long value without scaling. The ignored parameter exists
only to distinguish this constructor from the constructor that takes a long.
Used only internally.
Invalid index {0} for this {1} with Count={2}.
An {0} with {1} '{2}' is not contained by this {3}.
The {0} only accepts non-null {1} type objects, not {2} objects.
The {0} is already contained by another {1}.
The {0} only accepts non-null {1} type objects.
Attempted to remove an {0} that is not contained by this {1}.
The connection was not closed. {0}
The connection's current state is closed.
The connection's current state is connecting.
The connection's current state is open.
The connection's current state is executing.
The connection's current state is fetching.
The connection's current state: {0}.
Format of the initialization string does not conform to specification starting at index {0}.
Invalid attempt to call {0} when reader is closed.
Internal DbConnection Error: {0}
The {0} enumeration value, {1}, is invalid.
The {0} enumeration value, {1}, is not supported by the {2} method.
Invalid parameter Offset value '{0}'. The value must be greater than or equal to 0.
Connection currently has transaction enlisted. Finish current transaction and retry.
Cannot enlist in the transaction because a local transaction is in progress on the connection. Finish local transaction and retry.
The ConnectionString property has not been initialized.
Not allowed to change the '{0}' property. {1}
Can not start another operation while there is an asynchronous operation pending.
Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
Timeout attempting to open the connection. The time period elapsed prior to attempting to open the connection has been exceeded. This may have occurred because of too many simultaneous non-pooled connection attempts.
The only acceptable value for the property '{0}' is '{1}'.
The acceptable values for the property '{0}' are '{1}' or '{2}'.
Specified QuotePrefix and QuoteSuffix values do not match.
Destination array is not long enough to copy all the items in the collection. Check array index and length.
Only single dimensional arrays are supported for the requested action.
Cannot remove the specified item because it was not found in the specified Collection.
Non-negative number required.
Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
Cannot convert object of type '{0}' to object of type '{1}'.
Expecting argument of type {1}, but received type {0}.
{0} DeriveParameters only supports CommandType.StoredProcedure, not CommandType. {1}.
The stored procedure '{0}' doesn't exist.
Invalid value for key '{0}'.
Use of key '{0}' requires the key '{1}' to be present.
The value's length for key '{0}' exceeds it's limit of '{1}'.
Keyword not supported: '{0}'.
Internal .NET Framework Data Provider error {0}.
{0} '{1}'.
{0} '{1}', incorrect usage of quotes.
{0} '{1}', the current limit of '{2}' is insufficient.
SqlCommand.DeriveParameters failed because the SqlCommand.CommandText property value is an invalid multipart name
Batching updates is not supported on the context connection.
SqlBulkCopy.WriteToServer failed because the SqlBulkCopy.DestinationTableName is an invalid multipart name
Processing of results from SQL Server failed because of an invalid multipart name
SqlParameter.TypeName is an invalid multipart name
Connecting to a mirrored SQL Server instance using the MultiSubnetFailover connection option is not supported.
The {0} enumeration value, {1}, is not supported by the .NET Framework SqlClient Data Provider.
{0}: CommandText property has not been initialized
{0}: Connection property has not been initialized.
{0} requires an open and available Connection. {1}
The transaction is either not associated with the current connection or has been completed.
{0} requires the command to have a transaction when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized.
There is already an open DataReader associated with this Command which must be closed first.
The method '{0}' cannot be called more than once for the same execution.
Invalid CommandTimeout value {0}; the value must be >= 0.
{1}[{0}]: the Size property has an invalid size of 0.
{0}.Prepare method requires all parameters to have an explicitly set type.
{0}.Prepare method requires all variable length parameters to have an explicitly set non-zero Size.
{0}.Prepare method requires parameters of type '{1}' have an explicitly set Precision and Scale.
Mismatched end method call for asyncResult. Expected call to {0} but {1} was called instead.
Invalid operation. The connection is closed.
The connection has been disabled.
Database cannot be null, the empty string, or string of only whitespace.
Invalid source buffer (size of {0}) offset: {1}
Invalid destination buffer (size of {0}) offset: {1}
Invalid attempt to {0} when stream is closed.
Specified SeekOrigin value is invalid.
Invalid attempt to read from column ordinal '{0}'. With CommandBehavior.SequentialAccess, you may only read from column ordinal '{1}' or greater.
The parameter data type of {0} is invalid.
No mapping exists from object type {0} to a known managed provider native type.
Unable to handle an unknown TypeCode {0} returned by Type {1}.
No mapping exists from DbType {0} to a known {1}.
The version of SQL Server in use does not support datatype '{0}'.
Parameter value '{0}' is out of range.
Specified parameter name '{0}' is not valid.
Invalid parameter Size value '{0}'. The value must be greater than or equal to 0.
Invalid value for argument '{0}'. The value must be greater than or equal to 0.
Invalid value for this metadata.
Failed to convert parameter value from a {0} to a {1}.
{0} does not support parallel transactions.
This {0} has completed; it is no longer usable.
Specified length '{0}' is out of range.
Invalid {2} attempt at dataIndex '{0}'. With CommandBehavior.SequentialAccess, you may only read from dataIndex '{1}' or greater.
Invalid min or max pool size values, min pool size cannot be greater than the max pool size.
Invalid 'Packet Size'. The value must be an integer >= 512 and <= 32768.
Invalid transaction or invalid name for a point at which to save within the transaction.
User Instance and Failover are not compatible options. Please choose only one of the two in the connection string.
The instance of SQL Server you attempted to connect to requires encryption but this machine does not support it.
The instance of SQL Server you attempted to connect to does not support encryption.
Unsupported SQL Server version. The .NET Framework SqlClient Data Provider can only be used with SQL Server versions 7.0 and later.
Cannot create normalizer for '{0}'.
{0} cannot be changed while async operation is in progress.
Instance failure.
Server {0}, database {1} is not configured for database mirroring.
The connection does not support MultipleActiveResultSets.
SSE Instance re-direction is not supported for non-local user instances.
The command execution cannot proceed due to a pending asynchronous operation already in progress.
Invalid command sent to ExecuteXmlReader. The command must return an Xml result.
Invalid 3 part name format for TypeName.
The length of the parameter '{0}' exceeds the limit of 128 characters.
Precision value '{0}' is either less than 0 or greater than the maximum allowed precision of 38.
Scale value '{0}' is either less than 0 or greater than the maximum allowed scale of 38.
Scale value '{0}' is either less than 0 or greater than the maximum allowed scale of 7.
Parameter '{0}' exceeds the size limit for the sql_variant datatype.
The {0} type parameter '{1}' must have a valid type name.
Invalid internal packet size:
The SQL Server instance returned an invalid or unsupported protocol version during login negotiation.
Invalid Packet Size.
Internal connection fatal error.
The connection cannot be used because there is an ongoing operation that must be finished.
Memory allocation for internal connection failed.
SqlDbType.SmallDateTime overflow. Value '{0}' is out of range. Must be between 1/1/1900 12:00:00 AM and 6/6/2079 11:59:59 PM.
SqlDbType.Time overflow. Value '{0}' is out of range. Must be between 00:00:00.0000000 and 23:59:59.9999999.
SqlDbType.SmallMoney overflow. Value '{0}' is out of range. Must be between -214,748.3648 and 214,748.3647.
The Collation specified by SQL Server is not supported.
Operation cancelled by user.
A severe error occurred on the current command. The results, if any, should be discarded.
Failed to generate SSPI context.
Cannot authenticate using Kerberos. Ensure Kerberos has been initialized on the client with 'kinit' and a Service Principal Name has been registered for the SQL Server to allow Kerberos authentication.
Cannot connect to SQL Server Browser. Ensure SQL Server Browser has been started.
Invalid SSPI packet size.
Cannot initialize SSPI package.
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Connection Timeout Expired. The timeout period elapsed at the start of the pre-login phase. This could be because of insufficient time provided for connection timeout.
Connection Timeout Expired. The timeout period elapsed while attempting to create and initialize a socket to the server. This could be either because the server was unreachable or unable to respond back in time.
Connection Timeout Expired. The timeout period elapsed while making a pre-login handshake request. This could be because the server was unable to respond back in time.
Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time.
Connection Timeout Expired. The timeout period elapsed at the start of the login phase. This could be because of insufficient time provided for connection timeout.
Connection Timeout Expired. The timeout period elapsed while attempting to authenticate the login. This could be because the server failed to authenticate the user or the server was unable to respond back in time.
Connection Timeout Expired. The timeout period elapsed during the post-login phase. The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed out while attempting to create multiple act ...
This failure occurred while attempting to connect to the {0} server.
This failure occurred while attempting to connect to the routing destination. The duration spent while attempting to connect to the original server was - [Pre-Login] initialization={0}; handshake={1}; [Login] initialization={2}; authentication={3}; [Post-L ...
The duration spent while attempting to connect to this server was - [Pre-Login] initialization={0};
The duration spent while attempting to connect to this server was - [Pre-Login] initialization={0}; handshake={1};
The duration spent while attempting to connect to this server was - [Pre-Login] initialization={0}; handshake={1}; [Login] initialization={2};
The duration spent while attempting to connect to this server was - [Pre-Login] initialization={0}; handshake={1}; [Login] initialization={2}; authentication={3};
The duration spent while attempting to connect to this server was - [Pre-Login] initialization={0}; handshake={1}; [Login] initialization={2}; authentication={3}; [Post-Login] complete={4};
A user instance was requested in the connection string but the server specified does not support this option.
Invalid attempt to read when no data is present.
Invalid attempt to GetBytes on column '{0}'. The GetBytes function can only be used on columns of type Text, NText, or Image.
Invalid attempt to GetChars on column '{0}'. The GetChars function can only be used on columns of type Text, NText, Xml, VarChar or NVarChar.
Invalid attempt to GetStream on column '{0}'. The GetStream function can only be used on columns of type Binary, Image, Udt or VarBinary.
Invalid attempt to GetTextReader on column '{0}'. The GetTextReader function can only be used on columns of type Char, NChar, NText, NVarChar, Text or VarChar.
Invalid attempt to GetXmlReader on column '{0}'. The GetXmlReader function can only be used on columns of type Xml.
Failure while attempting to promote transaction.
Buffer offset '{1}' plus the bytes available '{0}' is greater than the length of the passed in buffer.
Data length '{0}' is less than 0.
The mapped collection is in use and cannot be accessed at this time;
Mappings must be either all name or all ordinal based.
The given value of type {0} from the data source cannot be converted to type {1} of the specified target column.
The given ColumnMapping does not match up with any column in the source or destination.
The given ColumnName '{0}' does not match up with any column in data source.
String or binary data would be truncated.
Timeout Value '{0}' is less than 0.
Value cannot be converted to SqlVariant.
Unexpected existing transaction.
Failed to obtain column collation information for the destination table. If the table is not in the current database the name must be qualified using the database name (e.g. [mydb]..[mytable](e.g. [mydb]..[mytable]); this also applies to temporary-tables ( ...
Must not specify SqlBulkCopyOption.UseInternalTransaction and pass an external Transaction at the same time.
Function must not be called during event.
The DestinationTableName property must be set before calling this method.
Cannot access destination table '{0}'.
Column '{0}' does not allow DBNull.Value.
The locale id '{0}' of the source column '{1}' and the locale id '{2}' of the destination column '{3}' do not match.
Attempt to invoke bulk copy on an object that has a pending operation.
Unable to get the address of the distributed transaction coordinator for the server, from the server. Is DTC enabled on the server?
The requested operation cannot be completed because the connection has been broken.
Open result count exceeded.
The Stream does not support writing.
The Stream does not support reading.
The Stream does not support seeking.
ClientConnectionId:{0}
Error Number:{0},State:{1},Class:{2}
ClientConnectionId before routing:{0}
Routing Destination:{0}
The currently loaded System.Transactions.dll does not support Global Transactions.
Null
Message
Arithmetic Overflow.
Divide by zero error encountered.
Data is Null. This method or property cannot be called on Null values.
Numeric arithmetic causes truncation.
SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
Two strings to be concatenated have different collation.
Two strings to be compared have different collation.
Invalid flag value.
Conversion from SqlDecimal to Decimal overflows.
Conversion overflows.
Invalid SqlDateTime.
A time zone was specified. SqlDateTime does not support time zones.
Invalid array size.
Invalid numeric precision/scale.
The input wasn't in a correct format.
An error occurred while reading.
Data returned is larger than 2Gb in size. Use SequentialAccess command behavior in order to get all of the data.
SQL Type has not been loaded with data.
SQL Type has already been loaded with data.
Invalid attempt to access a closed XmlReader.
Invalid attempt to call {0} when the stream is closed.
Invalid attempt to call {0} when the stream non-writable.
Invalid attempt to call {0} when the stream non-readable.
Invalid attempt to call {0} when the stream is non-seekable.
Subclass did not override a required method.
no UDT attribute
Specified type is not registered on the target server. {0}.
Internal Error
Operation aborted.
Operation aborted due to an exception (see InnerException for details).
The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements.
ParameterDirection '{0}' specified for parameter '{1}' is not supported. Table-valued parameters only support ParameterDirection.Input.
DBNull value for parameter '{0}' is not supported. Table-valued parameters cannot be DBNull.
TypeName specified for parameter '{0}'. TypeName must only be set for Structured parameters.
DateType column for field '{0}' in schema table is null. DataType must be non-null.
Invalid column ordinals in schema table. ColumnOrdinals, if present, must not have duplicates or gaps.
Metadata for field '{0}' of record '{1}' did not match the original record's metadata.
Number of fields in record '{0}' does not match the number in the original record.
Global Transactions are not enabled for this Azure SQL Database. Please contact Azure SQL Database support for assistance.
Unrecognized System.Transactions.IsolationLevel enumeration value: {0}.
This SqlCommand object is already associated with another SqlDependency object.
The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported. Please enable the Service Broker for this database if you wish to use notifications.
When using SqlDependency without providing an options value, SqlDependency.Start() must be called prior to execution of a command added to the SqlDependency instance.
When using SqlDependency without providing an options value, SqlDependency.Start() must be called for each server that is being executed against.
SqlDependency.Start has been called for the server the command is executing against more than once, but there is no matching server/user/database Start() call for current command.
SqlDependency.OnChange does not support multiple event registrations for the same delegate.
No SqlDependency exists for the key.
Timeout specified is invalid. Timeout cannot be < 0.
SqlDependency does not support calling Start() with different connection strings having the same server, user, and database in the same app domain.
The dbType {0} is invalid for this constructor.
The name is too long.
The sort order and ordinal must either both be specified, or neither should be specified (SortOrder.Unspecified and -1). The values given were: order = {0}, ordinal = {1}.
The type of column '{0}' is not supported. The type is '{1}'
There are not enough fields in the Structured type. Structured types must have at least one field.
The sort ordinal {0} was specified twice.
The sort ordinal {0} was not specified.
The sort ordinal {0} on field {1} exceeds the total number of fields.
range: 0-8000
unexpected error encountered in SqlClient data provider. {0}
UdtTypeName property must be set only for UDT parameters.
UdtTypeName property must be set for UDT parameters.
'{0}' is an invalid user defined type, reason: {1}.
SqlParameter.UdtTypeName is an invalid multipart name
Invalid 3 part name format for UdtTypeName.
There are no records in the SqlDataRecord enumeration. To send a table-valued parameter with no rows, use a null reference for the value instead.
I/O Error detected in read/write operation
Connection was terminated
Asynchronous operations not supported
Invalid parameter(s) found
Unsupported protocol specified
Invalid connection found when setting up new session protocol
Protocol not supported
Associating port with I/O completion mechanism failed
Timeout error
No server name supplied
TerminateListener() has been called
Win9x not supported
Function not supported
Shared-Memory heap error
Cannot find an ip/ipv6 type address to connect
Connection has been closed by peer
Physical connection is not usable
Connection has been closed
Encryption is enforced but there is no valid certificate
Couldn't load library
Cannot open a new thread in server process
Cannot post event to completion port
Connection string is not valid
Error Locating Server/Instance Specified
Error getting enabled protocols list from registry
Server doesn't support requested protocol
Shared Memory is not supported for clustered server connectivity
Invalid attempt bind to shared memory segment
Encryption(ssl/tls) handshake failed
Packet size too large for SSL Encrypt/Decrypt operations
SSRP error
Could not connect to the Shared Memory pipe
An internal exception was caught
The Shared Memory dll used to connect to SQL Server 2000 was not found
The SQL Server 2000 Shared Memory client dll appears to be invalid/corrupted
Cannot open a Shared Memory connection to SQL Server 2000
Shared memory connectivity to SQL Server 2000 is either disabled or not available on this machine
Could not open a connection to SQL Server
Cannot open a Shared Memory connection to a remote SQL server
Could not establish dedicated administrator connection (DAC) on default port. Make sure that DAC is enabled
An error occurred while obtaining the dedicated administrator connection (DAC) port. Make sure that SQL Browser is running, or check the error log for the port number
Could not compose Service Principal Name (SPN) for Windows Integrated Authentication. Possible causes are server(s) incorrectly specified to connection API calls, Domain Name System (DNS) lookup failure or memory shortage
Connecting with the MultiSubnetFailover connection option to a SQL Server instance configured with more than 64 IP addresses is not supported.
Connecting to a named SQL Server instance using the MultiSubnetFailover connection option is not supported.
Connecting to a SQL Server instance using the MultiSubnetFailover connection option is only supported when using the TCP protocol.
Local Database Runtime error occurred.
An instance name was not specified while connecting to a Local Database Runtime. Specify an instance name in the format (localdb)\instance_name.
Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.
Invalid Local Database Runtime registry configuration found. Verify that SQL Server Express is properly installed.
Unable to locate the registry entry for SQLUserInstance.dll file path. Verify that the Local Database Runtime feature of SQL Server Express is properly installed.
Registry value contains an invalid SQLUserInstance.dll file path. Verify that the Local Database Runtime feature of SQL Server Express is properly installed.
Unable to load the SQLUserInstance.dll from the location specified in the registry. Verify that the Local Database Runtime feature of SQL Server Express is properly installed.
Invalid SQLUserInstance.dll found at the location specified in the registry. Verify that the Local Database Runtime feature of SQL Server Express is properly installed.
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
The client was unable to establish a connection because of an error during connection initialization process before login. Possible causes include the following: the client tried to connect to an unsupported version of SQL Server; the server was too busy ...
A connection was successfully established with the server, but then an error occurred during the pre-login handshake.
A connection was successfully established with the server, but then an error occurred when obtaining the security/SSPI context information for integrated security login.
A connection was successfully established with the server, but then an error occurred during the login process.
Connection open and login was successful, but then an error occurred while enabling MARS for this connection.
Connection open and login was successful, but then an error occurred while enlisting the connection into the current distributed transaction.
Failed to establish a MARS session in preparation to send the request to the server.
A transport-level error has occurred when sending the request to the server.
A transport-level error has occurred when receiving results from the server.
A transport-level error has occurred during connection clean-up.
A transport-level error has occurred while sending information to the server.
A transport-level error has occurred during SSPI handshake.
Local Database Runtime: Cannot load SQLUserInstance.dll.
Invalid SQLUserInstance.dll found at the location specified in the registry. Verify that the Local Database Runtime feature of SQL Server Express is properly installed.
Cannot obtain Local Database Runtime error message
Two or more redirections have occurred. Only one redirection per login is allowed.
Connecting to a mirrored SQL Server instance using the ApplicationIntent ReadOnly connection option is not supported.
Unexpected routing information received.
Invalid routing information received.
Server provided routing information, but timeout already expired.
Invalid ConnectRetryCount value (should be 0-255).
Invalid ConnectRetryInterval value (should be 1-60).
Next reconnection attempt will exceed query timeout. Reconnection was terminated.
The server did not preserve SSL encryption during a recovery attempt, connection recovery is not possible.
The server did not preserve the exact client TDS version requested during a recovery attempt, connection recovery is not possible.
The connection is broken and recovery is not possible. The client driver attempted to recover the connection one or more times and all attempts failed. Increase the value of ConnectRetryCount to increase the number of recovery attempts.
The connection is broken and recovery is not possible. The connection is marked by the server as unrecoverable. No attempt was made to restore the connection.
The connection is broken and recovery is not possible. The connection is marked by the client driver as unrecoverable. No attempt was made to restore the connection.
The server did not acknowledge a recovery attempt, connection recovery is not possible.
The keyword '{0}' is not supported on this platform.
The server is attempting to use a feature that is not supported on this platform.
Received an unsupported token '{0}' while reading data from the server.
Type {0} is not supported on this platform.
The keyword 'Network Library' is not supported on this platform, prefix the 'Data Source' with the protocol desired instead ('tcp:' for a TCP connection, or 'np:' for a Named Pipe connection).
HTTP Provider
Named Pipes Provider
Session Provider
Sign Provider
Shared Memory Provider
SMux Provider
SSL Provider
TCP Provider
SQL Network Interfaces
.database.windows.net
.database.cloudapi.de
.database.usgovcloudapi.net
.database.chinacloudapi.cn
GSSAPI operation failed with error - {0} ({1}).
GSSAPI operation failed with status: {0} (Minor status: {1}).
GSSAPI operation failed with error - {0}.
GSSAPI operation failed with status: {0}.
NTLM authentication requires the GSSAPI plugin 'gss-ntlmssp'.
NTLM authentication is not possible with default credentials on this platform.
Target name should be non empty if default credentials are passed.
Server implementation is not supported
Requested protection level is not supported with the GSSAPI implementation currently installed.
Insufficient buffer space. Required: {0} Actual: {1}.
Protocol error: A received message contains a valid signature but it was not encrypted as required by the effective Protection Level.
The requested security package is not supported.
{0} failed with error {1}.
This method is not implemented by this class.
{0} returned {1}.
The specified value is not valid in the '{0}' enumeration.
'{0}' is not a supported handle type.
LocalDB is not supported on this platform.
System.Data.SqlClient is not supported on this platform.
Precision '{0}' required to send all values in column '{1}' exceeds the maximum supported precision '{2}'. The values must all fit in a single precision.
The size of column '{0}' is not supported. The size is {1}.
The metadata XML is invalid. The {1} column of the {0} collection must contain a non-empty string.
There are multiple collections named '{0}'.
The metadata XML is invalid. The {0} collection must contain a {1} column and it must be a string column.
The metadata XML is invalid.
The schema table contains no columns.
Unable to build the '{0}' collection because execution of the SQL query failed. See the inner exception for details.
More restrictions were provided than the requested schema ('{0}') supports.
The collection '{0}' is missing from the metadata XML.
The requested collection ({0}) is not defined.
The requested collection ({0}) is not supported by this version of the provider.
One or more of the required columns of the restrictions collection is missing.
A restriction exists for which there is no matching row in the restrictions collection.
The DataSourceInformation table must contain exactly one row.
One of the required DataSourceInformation tables columns is missing.
The collection name '{0}' matches at least two collections with the same name but with different case, but does not match any of them exactly.
Unable to build schema collection '{0}';
The length of argument '{0}' exceeds its limit of '{1}'.
{0} must be marked as read only.
Cannot use Credential with UserID, UID, Password, or PWD connection string keywords.
Cannot use Credential with Integrated Security connection string keyword.
The '{0}' argument must not be null or empty.
ChangePassword can only be used with SQL authentication, not with integrated security.
ChangePassword requires SQL Server 9.0 or later.
The keyword '{0}' must not be specified in the connectionString argument to ChangePassword.
Internal connection fatal error. Error state: {0}.
Internal connection fatal error. Error state: {0}, Value: {1}.
Cannot set the AccessToken property if the 'Integrated Security' connection string keyword has been set to 'true' or 'SSPI'.
Cannot set the AccessToken property if 'UserID', 'UID', 'Password', or 'PWD' has been specified in connection string.
Cannot set the Credential property if the AccessToken property is already set.
Internal connection fatal error. Error state: {0}, Feature Id: {1}.
Internal connection fatal error. Error state: {0}, Authentication Library Type: {1}.
The path name is not valid.
The path name is invalid or does not point to a disk file.
The process cannot access the file specified because it has been opened in another transaction.
An invalid parameter was passed to the function.
SqlFileStream is not supported on this platform.
Provides support for efficiently using Tasks to implement the APM (Begin/End) pattern.
Marshals the Task as an IAsyncResult, using the supplied callback and state
to implement the APM pattern.
The Task to be marshaled.
The callback to be invoked upon completion.
The state to be stored in the IAsyncResult.
An IAsyncResult to represent the task's asynchronous operation.
Processes an IAsyncResult returned by Begin.
The IAsyncResult to unwrap.
Processes an IAsyncResult returned by Begin.
The IAsyncResult to unwrap.
Invokes the callback asynchronously when the task has completed.
The Task to await.
The callback to invoke when the Task completes.
The Task used as the IAsyncResult.
Provides a simple IAsyncResult that wraps a Task. This, in effect, allows
for overriding what's seen for the CompletedSynchronously and AsyncState values.
The wrapped Task.
The new AsyncState value.
The new CompletedSynchronously value.
Initializes the IAsyncResult with the Task to wrap and the overriding AsyncState and CompletedSynchronously values.
The Task to wrap.
The new AsyncState value
The new CompletedSynchronously value.
Contains internal path helpers that are shared between many projects.
Returns true if the given character is a valid drive letter
Adds the extended path prefix (\\?\) if not already a device path, IF the path is not relative,
AND the path is more than 259 characters. (> MAX_PATH + null). This will also insert the extended
prefix if the path ends with a period or a space. Trailing periods and spaces are normally eaten
away from paths during normalization, but if we see such a path at this point it should be
normalized and has retained the final characters. (Typically from one of the *Info classes)
Adds the extended path prefix (\\?\) if not relative or already a device path.
Returns true if the path uses any of the DOS device path syntaxes. ("\\.\", "\\?\", or "\??\")
Returns true if the path is a device UNC (\\?\UNC\, \\.\UNC\)
Returns true if the path uses the canonical form of extended syntax ("\\?\" or "\??\"). If the
path matches exactly (cannot use alternate directory separators) Windows will skip normalization
and path length checks.
Check for known wildcard characters. '*' and '?' are the most common ones.
Gets the length of the root of the path (drive, share, etc.).
Returns true if the path specified is relative to the current drive or working directory.
Returns false if the path is fixed to a specific drive or UNC path. This method does no
validation of the path (URIs will be returned as relative as a result).
Handles paths that use the alternate directory separator. It is a frequent mistake to
assume that rooted paths (Path.IsPathRooted) are not relative. This isn't the case.
"C:a" is drive relative- meaning that it will be resolved against the current directory
for C: (rooted, but relative). "C:\a" is rooted and not relative (the current directory
will not be used to modify the path).
True if the given character is a directory separator.
Normalize separators in the given path. Converts forward slashes into back slashes and compresses slash runs, keeping initial 2 if present.
Also trims initial whitespace in front of "rooted" paths (see PathStartSkip).
This effectively replicates the behavior of the legacy NormalizePath when it was called with fullCheck=false and expandShortpaths=false.
The current NormalizePath gets directory separator normalization from Win32's GetFullPathName(), which will resolve relative paths and as
such can't be used here (and is overkill for our uses).
Like the current NormalizePath this will not try and analyze periods/spaces within directory segments.
The only callers that used to use Path.Normalize(fullCheck=false) were Path.GetDirectoryName() and Path.GetPathRoot(). Both usages do
not need trimming of trailing whitespace here.
GetPathRoot() could technically skip normalizing separators after the second segment- consider as a future optimization.
For legacy desktop behavior with ExpandShortPaths:
- It has no impact on GetPathRoot() so doesn't need consideration.
- It could impact GetDirectoryName(), but only if the path isn't relative (C:\ or \\Server\Share).
In the case of GetDirectoryName() the ExpandShortPaths behavior was undocumented and provided inconsistent results if the path was
fixed/relative. For example: "C:\PROGRA~1\A.TXT" would return "C:\Program Files" while ".\PROGRA~1\A.TXT" would return ".\PROGRA~1". If you
ultimately call GetFullPath() this doesn't matter, but if you don't or have any intermediate string handling could easily be tripped up by
this undocumented behavior.
We won't match this old behavior because:
1. It was undocumented
2. It was costly (extremely so if it actually contained '~')
3. Doesn't play nice with string logic
4. Isn't a cross-plat friendly concept/behavior
Returns true if the path is effectively empty for the current OS.
For unix, this is empty or null. For Windows, this is empty, null, or
just spaces ((char)32).
Get a pinnable reference to the builder.
Does not ensure there is a null char after
This overload is pattern matched in the C# 7.3+ compiler so you can omit
the explicit method call, and write eg "fixed (char* c = builder)"
Get a pinnable reference to the builder.
Ensures that the builder has a null char after
Returns the underlying storage of the builder.
Returns a span around the contents of the builder.
Ensures that the builder has a null char after
Resize the internal buffer either by doubling current buffer size or
by adding to
whichever is greater.
Number of chars requested beyond current position.
Provides logging facilities for System.Net libraries.
The single event source instance to use for all logging.
Logs entrance to a method.
`this`, or another object that serves to provide context for the operation.
A description of the entrance, including any arguments to the call.
The calling member.
Logs entrance to a method.
`this`, or another object that serves to provide context for the operation.
The object to log.
The calling member.
Logs entrance to a method.
`this`, or another object that serves to provide context for the operation.
The first object to log.
The second object to log.
The calling member.
Logs entrance to a method.
`this`, or another object that serves to provide context for the operation.
The first object to log.
The second object to log.
The third object to log.
The calling member.
Logs exit from a method.
`this`, or another object that serves to provide context for the operation.
A description of the exit operation, including any return values.
The calling member.
Logs exit from a method.
`this`, or another object that serves to provide context for the operation.
A return value from the member.
The calling member.
Logs exit from a method.
`this`, or another object that serves to provide context for the operation.
A return value from the member.
A second return value from the member.
The calling member.
Logs an information message.
`this`, or another object that serves to provide context for the operation.
The message to be logged.
The calling member.
Logs an information message.
`this`, or another object that serves to provide context for the operation.
The message to be logged.
The calling member.
Logs an error message.
`this`, or another object that serves to provide context for the operation.
The message to be logged.
The calling member.
Logs an error message.
`this`, or another object that serves to provide context for the operation.
The message to be logged.
The calling member.
Logs a fatal error and raises an assert.
`this`, or another object that serves to provide context for the operation.
The message to be logged.
The calling member.
Logs a fatal error and raises an assert.
`this`, or another object that serves to provide context for the operation.
The message to be logged.
The calling member.
Logs the contents of a buffer.
`this`, or another object that serves to provide context for the operation.
The buffer to be logged.
The calling member.
Logs the contents of a buffer.
`this`, or another object that serves to provide context for the operation.
The buffer to be logged.
The starting offset from which to log.
The number of bytes to log.
The calling member.
Logs the contents of a buffer.
`this`, or another object that serves to provide context for the operation.
The starting location of the buffer to be logged.
The number of bytes to log.
The calling member.
Logs a relationship between two objects.
The first object.
The second object.
The calling member.
Logs a relationship between two objects.
`this`, or another object that serves to provide context for the operation.
The first object.
The second object.
The calling member.
Is this a fixed size field?
The maximum size of the field (in bytes or characters depending on the field type)
or -1 if the size can be unlimited.
Precision, only valid for numeric types.
Scale, only valid for numeric types.
Is this field nullable?
RequiredAccess.
Indicates the type of access that a caller must request when opening the file object that represents the device (see IRP_MJ_CREATE).
The I/O manager sends the IRP for any caller that has a handle to the file object that represents the target device object.
The I/O manager sends the IRP only for a caller with read access rights, allowing the underlying device driver to transfer
data from the device to system memory.
The I/O manager sends the IRP only for a caller with write access rights, allowing the underlying device driver to transfer
data from system memory to its device.
CTL_CODE method.
Identifies the device type. This value must match the value that is set in the DeviceType member of the driver's DEVICE_OBJECT structure.
Identifies the function to be performed by the driver. Values of less than 0x800 are reserved for Microsoft. Values of 0x800 and higher can be used by vendors.
Indicates how the system will pass data between the caller of DeviceIoControl (or IoBuildDeviceIoControlRequest) and the driver that handles the IRP.
Indicates the type of access that a caller must request when opening the file object that represents the device (see IRP_MJ_CREATE).
TransferType.
Indicates how the system will pass data between the caller of DeviceIoControl (or IoBuildDeviceIoControlRequest) and the driver that handles the IRP.
Specifies the buffered I/O method, which is typically used for transferring small amounts of data per request.
Most I/O control codes for device and intermediate drivers use this TransferType value.
Specifies the direct I/O method, which is typically used for reading or writing large amounts of data, using DMA or PIO, that must be transferred quickly.
Specify METHOD_IN_DIRECT if the caller of DeviceIoControl or IoBuildDeviceIoControlRequest will pass data to the driver.
Specifies the direct I/O method, which is typically used for reading or writing large amounts of data, using DMA or PIO, that must be transferred quickly.
Specify METHOD_OUT_DIRECT if the caller of DeviceIoControl or IoBuildDeviceIoControlRequest will receive data from the driver.
Specifies neither buffered nor direct I/O. The I/O manager does not provide any system buffers or MDLs. The IRP supplies the user-mode virtual addresses
of the input and output buffers that were specified to DeviceIoControl or IoBuildDeviceIoControlRequest, without validating or mapping them.
Length in bytes, not including the null terminator, if any.
Max size of the buffer in bytes
OBJECT_ATTRIBUTES structure.
The OBJECT_ATTRIBUTES structure specifies attributes that can be applied to objects or object handles by routines
that create objects and/or return handles to objects.
Optional handle to root object directory for the given ObjectName.
Can be a file system directory or object manager directory.
Name of the object. Must be fully qualified if RootDirectory isn't set.
Otherwise is relative to RootDirectory.
If null, object will receive default security settings.
Optional quality of service to be applied to the object. Used to indicate
security impersonation level and context tracking mode (dynamic or static).
Equivalent of InitializeObjectAttributes macro with the exception that you can directly set SQOS.
This handle can be inherited by child processes of the current process.
This flag only applies to objects that are named within the object manager.
By default, such objects are deleted when all open handles to them are closed.
If this flag is specified, the object is not deleted when all open handles are closed.
Only a single handle can be open for this object.
Lookups for this object should be case insensitive.
Create on existing object should open, not fail with STATUS_OBJECT_NAME_COLLISION.
Open the symbolic link, not its target.
FILE_FULL_EA_INFORMATION structure.
Provides extended attribute (EA) information. This structure is used primarily by network drivers.
The offset of the next FILE_FULL_EA_INFORMATION-type entry. This member is zero if no other entries follow this one.
Can be zero or can be set with FILE_NEED_EA, indicating that the file to which the EA belongs cannot be interpreted without understanding the associated extended attributes.
The length in bytes of the EaName array. This value does not include a null-terminator to EaName.
The length in bytes of each EA value in the array.
Status
Request dependent value.
The completion status, either STATUS_SUCCESS if the operation was completed successfully or
some other informational, warning, or error status.
Reserved for internal use.
File creation disposition when calling directly to NT APIs.
Default. Replace or create. Deletes existing file instead of overwriting.
As this potentially deletes it requires that DesiredAccess must include Delete.
This has no equivalent in CreateFile.
Open if exists or fail if doesn't exist. Equivalent to OPEN_EXISTING or
.
TruncateExisting also uses Open and then manually truncates the file
by calling NtSetInformationFile with FileAllocationInformation and an
allocation size of 0.
Create if doesn't exist or fail if does exist. Equivalent to CREATE_NEW
or .
Open if exists or create if doesn't exist. Equivalent to OPEN_ALWAYS or
.
Open and overwrite if exists or fail if doesn't exist. Equivalent to
TRUNCATE_EXISTING or .
Open and overwrite if exists or create if doesn't exist. Equivalent to
CREATE_ALWAYS or .
Options for creating/opening files with NtCreateFile.
File being created or opened must be a directory file. Disposition must be FILE_CREATE, FILE_OPEN,
or FILE_OPEN_IF.
Can only be used with FILE_SYNCHRONOUS_IO_ALERT/NONALERT, FILE_WRITE_THROUGH, FILE_OPEN_FOR_BACKUP_INTENT,
and FILE_OPEN_BY_FILE_ID flags.
Applications that write data to the file must actually transfer the data into
the file before any requested write operation is considered complete. This flag
is set automatically if FILE_NO_INTERMEDIATE_BUFFERING is set.
All accesses to the file are sequential.
File cannot be cached in driver buffers. Cannot use with AppendData desired access.
All operations are performed synchronously. Any wait on behalf of the caller is
subject to premature termination from alerts.
Cannot be used with FILE_SYNCHRONOUS_IO_NONALERT.
Synchronous DesiredAccess flag is required. I/O system will maintain file position context.
All operations are performed synchronously. Waits in the system to synchronize I/O queuing
and completion are not subject to alerts.
Cannot be used with FILE_SYNCHRONOUS_IO_ALERT.
Synchronous DesiredAccess flag is required. I/O system will maintain file position context.
File being created or opened must not be a directory file. Can be a data file, device,
or volume.
Create a tree connection for this file in order to open it over the network.
Not used by device and intermediate drivers.
Complete the operation immediately with a success code of STATUS_OPLOCK_BREAK_IN_PROGRESS if
the target file is oplocked.
Not compatible with ReserveOpfilter or OpenRequiringOplock.
Not used by device and intermediate drivers.
If the extended attributes on an existing file being opened indicate that the caller must
understand extended attributes to properly interpret the file, fail the request.
Not used by device and intermediate drivers.
Accesses to the file can be random, so no sequential read-ahead operations should be performed
on the file by FSDs or the system.
Delete the file when the last handle to it is passed to NtClose. Requires Delete flag in
DesiredAccess parameter.
Open the file by reference number or object ID. The file name that is specified by the ObjectAttributes
name parameter includes the 8 or 16 byte file reference number or ID for the file in the ObjectAttributes
name field. The device name can optionally be prefixed.
NTFS supports both reference numbers and object IDs. 16 byte reference numbers are 8 byte numbers padded
with zeros. ReFS only supports reference numbers (not object IDs). 8 byte and 16 byte reference numbers
are not related. Note that as the UNICODE_STRING will contain raw byte data, it may not be a "valid" string.
Not used by device and intermediate drivers.
\??\C:\{8 bytes of binary FileID}
\device\HardDiskVolume1\{16 bytes of binary ObjectID}
{8 bytes of binary FileID}
The file is being opened for backup intent. Therefore, the system should check for certain access rights
and grant the caller the appropriate access to the file before checking the DesiredAccess parameter
against the file's security descriptor.
Not used by device and intermediate drivers.
When creating a file, specifies that it should not inherit the compression bit from the parent directory.
The file is being opened and an opportunistic lock (oplock) on the file is being requested as a single atomic
operation.
The file system checks for oplocks before it performs the create operation and will fail the create with a
return code of STATUS_CANNOT_BREAK_OPLOCK if the result would be to break an existing oplock.
Not compatible with CompleteIfOplocked or ReserveOpFilter. Windows 7 and up.
CreateFile2 uses this flag to prevent opening a file that you don't have access to without specifying
FILE_SHARE_READ. (Preventing users that can only read a file from denying access to other readers.)
Windows 7 and up.
The client opening the file or device is session aware and per session access is validated if necessary.
Windows 8 and up.
This flag allows an application to request a filter opportunistic lock (oplock) to prevent other applications
from getting share violations.
Not compatible with CompleteIfOplocked or OpenRequiringOplock.
If there are already open handles, the create request will fail with STATUS_OPLOCK_NOT_GRANTED.
Open a file with a reparse point attribute, bypassing the normal reparse point processing.
Causes files that are marked with the Offline attribute not to be recalled from remote storage.
More details can be found in Remote Storage documentation (see Basic Concepts).
https://technet.microsoft.com/en-us/library/cc938459.aspx
System.IO.FileAccess looks up these values when creating handles
File Security and Access Rights
https://msdn.microsoft.com/en-us/library/windows/desktop/aa364399.aspx
For a file, the right to read data from the file.
Directory version of this flag is .
For a directory, the right to list the contents.
File version of this flag is .
For a file, the right to write data to the file.
Directory version of this flag is .
For a directory, the right to create a file in a directory.
File version of this flag is .
For a file, the right to append data to a file. is needed
to overwrite existing data.
Directory version of this flag is .
For a directory, the right to create a subdirectory.
File version of this flag is .
For a named pipe, the right to create a pipe instance.
The right to read extended attributes.
The right to write extended attributes.
The right to execute the file.
Directory version of this flag is .
For a directory, the right to traverse the directory.
File version of this flag is .
For a directory, the right to delete a directory and all
the files it contains, including read-only files.
The right to read attributes.
The right to write attributes.
All standard and specific rights. [FILE_ALL_ACCESS]
The right to delete the object.
The right to read the information in the object's security descriptor.
Doesn't include system access control list info (SACL).
The right to modify the discretionary access control list (DACL) in the
object's security descriptor.
The right to change the owner in the object's security descriptor.
The right to use the object for synchronization. Enables a thread to wait until the object
is in the signaled state. This is required if opening a synchronous handle.
Same as READ_CONTROL.
Same as READ_CONTROL.
Same as READ_CONTROL.
Maps internally to | |
| | .
(For directories, | |
| | .)
Maps internally to | |
| | | .
(For directories, | | AddFile
| | | .)
Maps internally to | |
| .
(For directories, | |
| .)