KernelBase Class

Platform Invocation methods (P/Invoke), access unmanaged code.

KernelBase.dll.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[HideModuleNameAttribute]
public sealed class KernelBase
Inheritance
Object    KernelBase

Methods

CompareObjectHandles Compares two object handles to determine if they refer to the same underlying kernel object.
Equals Determines whether the specified object is equal to the current object.
(Inherited from Object)
GetHashCode Serves as the default hash function.
(Inherited from Object)
GetType Gets the Type of the current instance.
(Inherited from Object)
PathCchAddBackslash Adds a backslash to the end of a string to create the correct syntax for a path. If the source path already has a trailing backslash, no backslash will be added.

This function differs from PathCchAddBackslash(StringBuilder, UInt32) in that you are restricted to a final path of length MAX_PATH.

This function differs from PathAddBackslash(StringBuilder) in that it accepts paths with "\", "\?" and "\?\UNC" prefixes.

Note: This function, or PathCchAddBackslashEx(StringBuilder, UInt32, IntPtr, UInt32), should be used in place of PathAddBackslash(StringBuilder) to prevent the possibility of a buffer overrun.

PathCchAddBackslashEx Adds a backslash to the end of a string to create the correct syntax for a path. If the source path already has a trailing backslash, no backslash will be added.

This function differs from PathCchAddBackslash(StringBuilder, UInt32) in that it can return a pointer to the new end of the string and report the number of unused characters remaining in the buffer.

This function differs from PathAddBackslash(StringBuilder) in that it accepts paths with "\", "\?" and "\?\UNC" prefixes.

Note: This function, or PathCchAddBackslashEx(StringBuilder, UInt32, IntPtr, UInt32), should be used in place of PathAddBackslash(StringBuilder) to prevent the possibility of a buffer overrun.

PathCchAddExtension Adds a file name extension to a path string.

This function differs from PathAddExtension(StringBuilder, String) in that it accepts paths with "\", "\?" and "\?\UNC" prefixes.

Note: This function should be used in place of PathAddExtension(StringBuilder, String) to prevent the possibility of a buffer overrun.

PathCchAppend Appends one path to the end of another.

This function differs from PathCchAppendEx(StringBuilder, UInt32, String, PathOptions) in that you are restricted to a final path of length MAX_PATH.

This function differs from PathAppend(StringBuilder, String) in that it accepts paths with "\", "\?" and "\?\UNC" prefixes.

Note: This function, or PathCchAppendEx(StringBuilder, UInt32, String, PathOptions), should be used in place of PathAppend(StringBuilder, String) to prevent the possibility of a buffer overrun.

PathCchAppendEx Appends one path to the end of another.

This function differs from PathCchAppend(StringBuilder, UInt32, String) in that it allows for a longer final path to be constructed.

This function differs from PathAppend(StringBuilder, String) in that it accepts paths with "\", "\?" and "\?\UNC" prefixes.

Note: This function, or PathCchAppend(StringBuilder, UInt32, String), should be used in place of PathAppend(StringBuilder, String) to prevent the possibility of a buffer overrun.

PathCchCanonicalize Converts a path string into a canonical form.

This function differs from PathCchCanonicalizeEx(StringBuilder, UInt32, String, PathOptions) in that you are restricted to a final path of length MAX_PATH.

This function differs from PathAllocCanonicalize in that the caller must declare the size of the returned string, which is stored on the stack.

This function differs from PathCanonicalize(StringBuilder, String) in that it accepts paths with "\", "\?" and "\?\UNC" prefixes.

Note: This function, PathCchCanonicalizeEx(StringBuilder, UInt32, String, PathOptions), or PathAllocCanonicalize should be used in place of PathCanonicalize(StringBuilder, String) to prevent the possibility of a buffer overrun.

PathCchCanonicalizeEx Simplifies a path by removing navigation elements such as "." and ".." to produce a direct, well-formed path.

This function differs from PathCchCanonicalize(StringBuilder, UInt32, String) in that it allows for a longer final path to be constructed.

This function differs from PathAllocCanonicalize in that the caller must declare the size of the returned string, which is stored on the stack.

This function differs from PathCanonicalize(StringBuilder, String) in that it accepts paths with "\", "\?" and "\?\UNC" prefixes.

Note: This function, PathCchCanonicalize(StringBuilder, UInt32, String), or PathAllocCanonicalize should be used in place of PathCanonicalize(StringBuilder, String) to prevent the possibility of a buffer overrun.

PathCchCombine Combines two path fragments into a single path. This function also canonicalizes any relative path elements, removing "." and ".." elements to simplify the final path.

This function differs from PathCchCombineEx(StringBuilder, UInt32, String, String, PathOptions) in that you are restricted to a final path of length MAX_PATH.

This function differs from PathAllocCombine in that the caller must declare the size of the returned string, which is stored on the stack.

This function differs from PathCombine(StringBuilder, String, String) in that it accepts paths with "\", "\?" and "\?\UNC" prefixes.

Note: This function, PathCchCombineEx(StringBuilder, UInt32, String, String, PathOptions), or PathAllocCombine should be used in place of PathCombine(StringBuilder, String, String) to prevent the possibility of a buffer overrun.

PathCchCombineEx Combines two path fragments into a single path. This function also canonicalizes any relative path elements, removing "." and ".." elements to simplify the final path.

This function differs from PathCchCombine(StringBuilder, UInt32, String, String) in that it allows for a longer final path to be constructed.

This function differs from PathAllocCombine in that the caller must declare the size of the returned string, which is stored on the stack.

This function differs from PathCombine(StringBuilder, String, String) in that it accepts paths with "\", "\?" and "\?\UNC" prefixes.

Note: This function, PathCchCombine(StringBuilder, UInt32, String, String), or PathAllocCombine should be used in place of PathCombine(StringBuilder, String, String) to prevent the possibility of a buffer overrun.

PathCchIsRoot Determines whether a path string refers to the root of a volume.

This function differs from PathIsRoot(String) in that it accepts paths with "\", "\?" and "\?\UNC" prefixes.

PathCchRemoveBackslash Removes the trailing backslash from the end of a path string.

This function differs from PathRemoveBackslash in that it accepts paths with "\", "\?" and "\?\UNC" prefixes.

PathCchRemoveBackslashEx Removes the trailing backslash from the end of a path string.

This function differs from PathCchRemoveBackslash(StringBuilder, UInt32) in that it can return a pointer to the new end of the string and report the number of unused characters remaining in the buffer.

This function differs from PathRemoveBackslash(StringBuilder) in that it accepts paths with "\", "\?" and "\?\UNC" prefixes.

Note This function, or PathCchRemoveBackslash(StringBuilder, UInt32), should be used in place of PathRemoveBackslash(StringBuilder) to prevent the possibility of a buffer overrun.

PathCchRemoveExtension Removes the file name extension from a path, if one is present..

This function differs from PathRemoveExtension(StringBuilder) in that it accepts paths with "\", "\?" and "\?\UNC" prefixes.

PathCchRemoveFileSpec Removes the last element in a path string, whether that element is a file name or a directory name. The element's leading backslash is also removed.

This function differs from PathRemoveFileSpec(StringBuilder) in that it accepts paths with "\", "\?" and "\?\UNC" prefixes.

Note: This function should be used in place of PathRemoveFileSpec(StringBuilder) to prevent the possibility of a buffer overrun.

PathCchRenameExtension Replaces a file name's extension at the end of a path string with a new extension.

If the path string does not end with an extension, the new extension is added.

This function differs from PathRenameExtension(StringBuilder, String) in that it accepts paths with "\", "\?" and "\?\UNC" prefixes.

PathCchStripPrefix Removes the "\?" prefix, if present, from a file path.
PathCchStripToRoot Removes all file and directory elements in a path except for the root information.

This function differs from PathStripToRoot(StringBuilder) in that it accepts paths with "\", "\?" and "\?\UNC" prefixes.

Note: This function should be used in place of PathStripToRoot(StringBuilder) to prevent the possibility of a buffer overrun.

PathIsUNCEx Determines if a path string is a valid Universal Naming Convention (UNC) path, as opposed to a path based on a drive letter.

This function differs from PathIsUNC(String) in that it also allows you to extract the name of the server from the path.

ToString Returns a string that represents the current object.
(Inherited from Object)

Extension Methods

CanConvertTo Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions)
CanConvertToT Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions)
ConvertToT Converts an object to the specified target type.

If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions)

ConvertToT Converts an object to the specified target type.

If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions)

IsDisposable Determines whether the specified object is a disposable type (i.e., it implements IDisposable interface).
(Defined by ObjectExtensions)
Speak Speaks the string representation of the source object by using the operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions)
Speak Speaks the string representation of the source object by using the operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions)
ThrowIfNullTException Throws the specified exception if the source object is null.
(Defined by ObjectExtensions)

See Also