Logo Search packages:      
Sourcecode: virtualbox-ose version File versions

RTDECL ( int   ) 

Create a event semaphore.

Returns:
iprt status code.
Parameters:
pEventSem Where to store the event semaphore handle.
Destroy an event semaphore.

Returns:
iprt status code.
Parameters:
EventSem Handle of the
Signal an event semaphore.

The event semaphore will be signaled and automatically reset after exactly one thread have successfully returned from RTSemEventWait() after waiting/polling on that semaphore.

Returns:
iprt status code.
Parameters:
EventSem The event semaphore to signal.
Wait for the event semaphore to be signaled, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
EventSem The event semaphore to wait on.
cMillies Number of milliseconds to wait.
Wait for the event semaphore to be signaled, return on interruption.

This function will not resume the wait if interrupted.

Returns:
iprt status code.
Parameters:
EventSem The event semaphore to wait on.
cMillies Number of milliseconds to wait.
Create a event multi semaphore.

Returns:
iprt status code.
Parameters:
pEventMultiSem Where to store the event multi semaphore handle.
Destroy an event multi semaphore.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi sempahore to destroy.
Signal an event multi semaphore.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to signal.
Resets an event multi semaphore to non-signaled state.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to reset.
Wait for the event multi semaphore to be signaled, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
EventMultiSem The event multi semaphore to wait on.
cMillies Number of milliseconds to wait.
Wait for the event multi semaphore to be signaled, return on interruption.

This function will not resume the wait if interrupted.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to wait on.
cMillies Number of milliseconds to wait.
Create a mutex semaphore.

Returns:
iprt status code.
Parameters:
pMutexSem Where to store the mutex semaphore handle.
Destroy a mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to destroy.
Request ownership of a mutex semaphore, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
MutexSem The mutex semaphore to request ownership over.
cMillies The number of milliseconds to wait.
Request ownership of a mutex semaphore, return on interruption.

This function will not resume the wait if interrupted.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to request ownership over.
cMillies The number of milliseconds to wait.
Release the ownership of a mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex to release the ownership of. It goes without saying the the calling thread must own it.
Create a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
pMutexSem Where to store the mutex semaphore handle.
Destroy a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to destroy.
Request ownership of a fast mutex semaphore.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to request ownership over.
Release the ownership of a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex to release the ownership of. It goes without saying the the calling thread must own it.
Creates a read/write semaphore.

Returns:
iprt status code.
Parameters:
pRWSem Where to store the handle to the created RW semaphore.
Destroys a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to destroy.
Request read access to a read/write semaphore, resume on interruption

Read requests cannot be nested. A deadlock error will be returned on such attempts.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
RWSem The Read/Write semaphore to request read access to.
cMillies The number of milliseconds to wait.
Request read access to a read/write semaphore, return on interruption

Read requests cannot be nested. A deadlock error will be returned on such attempts.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to request read access to.
cMillies The number of milliseconds to wait.
Release read access to a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write sempahore to release read access to. Goes without saying that caller must have read access to the sem.
Request write access to a read/write semaphore, resume on interruption.

Write requests cannot be nested. If called by the thread currently owning the write lock the function returns an error code indicating deadlock.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
RWSem The Read/Write semaphore to request write access to.
cMillies The number of milliseconds to wait.
Request write access to a read/write semaphore, return on interruption.

Write requests cannot be nested. If called by the thread currently owning the write lock the function returns an error code indicating deadlock.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to request write access to.
cMillies The number of milliseconds to wait.
Release write access to a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write sempahore to release read access to. Goes without saying that caller must have write access to the sem.
Init a Ping-Pong construct.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure which needs initialization.
Destroys a Ping-Pong construct.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure which is to be destroyed. (I.e. put into uninitialized state.)
Signals the pong thread in a ping-pong construct. (I.e. sends ping.) This is called by the ping thread.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure to ping.
Signals the ping thread in a ping-pong construct. (I.e. sends pong.) This is called by the pong thread.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure to pong.
Wait function for the ping thread.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
pPP Pointer to the ping-pong structure to wait on.
cMillies Number of milliseconds to wait.
Wait function for the pong thread.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
pPP Pointer to the ping-pong structure to wait on.
cMillies Number of milliseconds to wait.
Converts a Darwin IOReturn error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts a Darwin kern_return_t error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts errno to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode errno code.
Converts a L4 errno to a iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode l4 errno.
Remarks:
L4 only.
Converts NT status code to iprt status code.

Needless to say, this is only available on NT and winXX targets.

Returns:
iprt status code.
Parameters:
lNativeCode NT status code.
Remarks:
Windows only.
Converts OS/2 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode OS/2 error code.
Remarks:
OS/2 only.
Converts Win32 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode Win32 error code.
Remarks:
Windows only.
Merge two simple heaps into one.

The requiremet is of course that they next two each other memory wise.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the handle to the merged heap on success.
Heap1 Handle to the first heap.
Heap2 Handle to the second heap.
Remarks:
This API isn't implemented yet.
Open a binary image file.

Returns:
iprt status code.
Parameters:
pszFilename Image filename.
phLdrMod Where to store the handle to the loader module.
Opens a binary image file using kLdr.

Returns:
iprt status code.
Parameters:
pszFilename Image filename.
phLdrMod Where to store the handle to the loaded module.
Remarks:
Primarily for testing the loader.
Open a binary image from in-memory bits.

Returns:
iprt status code.
Parameters:
pvBits The start of the raw-image.
cbBits The size of the raw-image.
enmBits What to expect from the pvBits.
pszLogName What to call the raw-image when logging. For RTLdrLoad and RTLdrOpen the filename is used for this.
phLdrMod Where to store the handle to the loader module.
Closes a loader module handle.

The handle can be obtained using any of the RTLdrLoad(), RTLdrOpen() and RTLdrOpenBits() functions.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
Gets the address of a named exported symbol.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pszSymbol Symbol name.
ppvValue Where to store the symbol value. Note that this is restricted to the pointer size used on the host!
Gets the address of a named exported symbol.

This function differs from the plain one in that it can deal with both GC and HC address sizes, and that it can calculate the symbol value relative to any given base address.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pvBits Optional pointer to the loaded image. Set this to NULL if no RTLdrGetBits() processed image bits are available. Not supported for RTLdrLoad() images.
BaseAddress Image load address. Not supported for RTLdrLoad() images.
pszSymbol Symbol name.
pValue Where to store the symbol value.
Loads the image into a buffer provided by the user and applies fixups for the given base address.

Returns:
iprt status code.
Parameters:
hLdrMod The load module handle.
pvBits Where to put the bits. Must be as large as RTLdrSize() suggests.
BaseAddress The base address.
pfnGetImport Callback function for resolving imports one by one.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Relocates bits after getting them. Useful for code which moves around a bit.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pvBits Where the image bits are. Must've been passed to RTLdrGetBits().
NewBaseAddress The new base address.
OldBaseAddress The old base address.
pfnGetImport Callback function for resolving imports one by one.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Enumerates all symbols in a module.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
fFlags Flags indicating what to return and such.
pvBits Optional pointer to the loaded image. (RTLDR_ENUM_SYMBOL_FLAGS_*) Set this to NULL if no RTLdrGetBits() processed image bits are available.
BaseAddress Image load address.
pfnCallback Callback function.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
args Format arguments.
Create a logger instance for singled threaded ring-0 usage.

Returns:
iprt status code.
Parameters:
pLogger Where to create the logger instance.
cbLogger The amount of memory available for the logger instance.
pfnLogger Pointer to logger wrapper function for the clone.
pfnFlush Pointer to flush function for the clone.
fFlags Logger instance flags for the clone, a combination of the RTLOGFLAGS_* values.
fDestFlags The destination flags.
Destroys a logger instance.

The instance is flushed and all output destinations closed (where applicable).

Returns:
iprt status code.
Parameters:
pLogger The logger instance which close destroyed.
Create a logger instance clone for GC usage.

Returns:
iprt status code.
Parameters:
pLogger The logger instance to be cloned.
pLoggerGC Where to create the GC logger instance.
cbLoggerGC Amount of memory allocated to for the GC logger instance clone.
pfnLoggerGCPtr Pointer to logger wrapper function for this instance (GC Ptr).
pfnFlushGCPtr Pointer to flush function (GC Ptr).
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
Copies the group settings and flags from logger instance to another.

Returns:
IPRT status code.
Parameters:
pDstLogger The destination logger instance.
pSrcLogger The source logger instance. If NULL the default one is used.
fFlagsOr OR mask for the flags.
fFlagsAnd AND mask for the flags.
Updates the group settings for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Updates the flags for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Get the absolute path (no symlinks, no . or .. components), doesn't have to exist.

Returns:
iprt status code.
Parameters:
pszPath The path to resolve.
pszAbsPath Where to store the absolute path.
cchAbsPath Size of the buffer.
Get the absolute path (no symlinks, no . or .. components), assuming the given base path as the current directory. The resulting path doesn't have to exist.

Returns:
iprt status code.
Parameters:
pszBase The base path to act like a current directory. When NULL, the actual cwd is used (i.e. the call is equivalent to RTPathAbs(pszPath, ...).
pszPath The path to resolve.
pszAbsPath Where to store the absolute path.
cchAbsPath Size of the buffer.
Compares two paths.

The comparison takes platform-dependent details into account, such as:

  • On DOS-like platforms, both |\| and |/| separator chars are considered to be equal.
  • On platforms with case-insensitive file systems, mismatching characters are uppercased and compared again.

File system details are currently ignored. This means that you won't get case-insentive compares on unix systems when a path goes into a case-insensitive filesystem like FAT, HPFS, HFS, NTFS, JFS, or similar. For NT, OS/2 and similar you'll won't get case-sensitve compares on a case-sensitive file system.

Parameters:
pszPath1 Path to compare (must be an absolute path).
pszPath2 Path to compare (must be an absolute path).
Returns:
< 0 if the first path less than the second path.

0 if the first path identical to the second path.

> 0 if the first path greater than the second path.

Destroy an event semaphore.

Returns:
iprt status code.
Parameters:
EventSem Handle of the
Signal an event semaphore.

The event semaphore will be signaled and automatically reset after exactly one thread have successfully returned from RTSemEventWait() after waiting/polling on that semaphore.

Returns:
iprt status code.
Parameters:
EventSem The event semaphore to signal.
Wait for the event semaphore to be signaled, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
EventSem The event semaphore to wait on.
cMillies Number of milliseconds to wait.
Wait for the event semaphore to be signaled, return on interruption.

This function will not resume the wait if interrupted.

Returns:
iprt status code.
Parameters:
EventSem The event semaphore to wait on.
cMillies Number of milliseconds to wait.
Create a event multi semaphore.

Returns:
iprt status code.
Parameters:
pEventMultiSem Where to store the event multi semaphore handle.
Destroy an event multi semaphore.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi sempahore to destroy.
Signal an event multi semaphore.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to signal.
Resets an event multi semaphore to non-signaled state.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to reset.
Wait for the event multi semaphore to be signaled, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
EventMultiSem The event multi semaphore to wait on.
cMillies Number of milliseconds to wait.
Wait for the event multi semaphore to be signaled, return on interruption.

This function will not resume the wait if interrupted.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to wait on.
cMillies Number of milliseconds to wait.
Create a mutex semaphore.

Returns:
iprt status code.
Parameters:
pMutexSem Where to store the mutex semaphore handle.
Destroy a mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to destroy.
Request ownership of a mutex semaphore, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
MutexSem The mutex semaphore to request ownership over.
cMillies The number of milliseconds to wait.
Request ownership of a mutex semaphore, return on interruption.

This function will not resume the wait if interrupted.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to request ownership over.
cMillies The number of milliseconds to wait.
Release the ownership of a mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex to release the ownership of. It goes without saying the the calling thread must own it.
Create a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
pMutexSem Where to store the mutex semaphore handle.
Destroy a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to destroy.
Request ownership of a fast mutex semaphore.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to request ownership over.
Release the ownership of a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex to release the ownership of. It goes without saying the the calling thread must own it.
Creates a read/write semaphore.

Returns:
iprt status code.
Parameters:
pRWSem Where to store the handle to the created RW semaphore.
Destroys a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to destroy.
Request read access to a read/write semaphore, resume on interruption

Read requests cannot be nested. A deadlock error will be returned on such attempts.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
RWSem The Read/Write semaphore to request read access to.
cMillies The number of milliseconds to wait.
Request read access to a read/write semaphore, return on interruption

Read requests cannot be nested. A deadlock error will be returned on such attempts.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to request read access to.
cMillies The number of milliseconds to wait.
Release read access to a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write sempahore to release read access to. Goes without saying that caller must have read access to the sem.
Request write access to a read/write semaphore, resume on interruption.

Write requests cannot be nested. If called by the thread currently owning the write lock the function returns an error code indicating deadlock.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
RWSem The Read/Write semaphore to request write access to.
cMillies The number of milliseconds to wait.
Request write access to a read/write semaphore, return on interruption.

Write requests cannot be nested. If called by the thread currently owning the write lock the function returns an error code indicating deadlock.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to request write access to.
cMillies The number of milliseconds to wait.
Release write access to a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write sempahore to release read access to. Goes without saying that caller must have write access to the sem.
Init a Ping-Pong construct.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure which needs initialization.
Destroys a Ping-Pong construct.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure which is to be destroyed. (I.e. put into uninitialized state.)
Signals the pong thread in a ping-pong construct. (I.e. sends ping.) This is called by the ping thread.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure to ping.
Signals the ping thread in a ping-pong construct. (I.e. sends pong.) This is called by the pong thread.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure to pong.
Wait function for the ping thread.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
pPP Pointer to the ping-pong structure to wait on.
cMillies Number of milliseconds to wait.
Wait function for the pong thread.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
pPP Pointer to the ping-pong structure to wait on.
cMillies Number of milliseconds to wait.
Destroys a spinlock created by RTSpinlockCreate().

Returns:
iprt status code.
Parameters:
Spinlock Spinlock returned by RTSpinlockCreate().
Gets the number of code points the string is made up of, excluding the terminator.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcuc Where to store the code point count. This is undefined on failure.
Translate a UTF-8 string into an unicode string (i.e. RTUNICPs), allocating the string buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppUniString Receives pointer to the allocated unicode string. The returned string must be freed using RTUniFree().
Translates pszString from UTF-8 to an array of code points, allocating the result array if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppaCps If cCps is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppusz is NULL or cCps is zero a buffer of at least cCps items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cCps The number of code points in the unicode string. This includes the terminator.
pcCps Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Calculates the length of the string in RTUTF16 items.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcwc Where to store the string length. Optional. This is undefined on failure.
Translate a UTF-8 string into a UTF-16 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppwszString Receives pointer to the allocated UTF-16 string. The returned string must be freed using RTUtf16Free().
Translates pszString from UTF-8 to UTF-16, allocating the result buffer if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppwsz If cwc is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppwsz is NULL or cwc is zero a buffer of at least cwc items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cwc The buffer size in RTUTF16s. This includes the terminator.
pcwc Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
unicode code point.

RTUNICP_INVALID if the encoding is invalid.

Parameters:
ppsz The string.
pCp Where to store the unicode code point.
Formats an integer number according to the parameters.

Returns:
Length of the formatted number.
Parameters:
psz Pointer to output string buffer of sufficient size.
u64Value Value to format.
uiBase Number representation base.
cchWidth Width.
cchPrecision Precision.
fFlags Flags (NTFS_*).
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
args The format argument.
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
... The format argument.
Converts a string representation of a number to a 64-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu8 Where to store the converted number. (optional)
Converts a string representation of a number to a 64-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi8 Where to store the converted number. (optional)
Performs a case insensitive string compare between two UTF-8 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
psz1 First UTF-8 string.
psz2 Second UTF-8 string.
Destroys the string space. The caller supplies a callback which will be called for each of the string nodes in for freeing their memory and other resources.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Enumerates the string space. The caller supplies a callback which will be called for each of the string nodes.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Allocates a new copy of the specified UTF-16 string.

Returns:
iprt status code.
Parameters:
ppwszString Receives pointer of the allocated UTF-16 string. The returned pointer must be freed using RTUtf16Free().
pwszString UTF-16 string to duplicate.
cwcExtra Number of extra RTUTF16 items to allocate.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case sensitive string compare between two UTF-16 strings.

Returns:
< 0 if the first string less than the second string.s

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case insensitive string compare between two UTF-16 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Performs a case insensitive string compare between two UTF-16 strings using the current locale of the process (if applicable).

This differs from RTUtf16ICmp() in that it will try, if a locale with the required data is available, to do a correct case-insensitive compare. It follows that it is more complex and thereby likely to be more expensive.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Translate a UTF-16 string into a UTF-8 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pwszString UTF-16 string to convert.
ppszString Receives pointer of allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
Translates UTF-16 to UTF-8 using buffer provided by the caller or a fittingly sized buffer allocated by the function.

Returns:
iprt status code.
Parameters:
pwszString The UTF-16 string to convert.
cwcString The number of RTUTF16 items to translation from pwszString. The translate will stop when reaching cwcString or the terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppsz If cch is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppsz is NULL or cch is zero a buffer of at least cch chars will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cch The buffer size in chars (the type). This includes the terminator.
pcch Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
iprt status code.
Parameters:
ppwsz Pointer to the string pointer. This will be updated to point to the char following the current code point.
pCp Where to store the code point. RTUNICP_INVALID is stored here on failure.
Remarks:
This is an internal worker for RTUtf16GetCpEx().
Create a new thread.

Returns:
iprt status code.
Parameters:
pThread Where to store the thread handle to the new thread. (optional)
pfnThread The thread function.
pvUser User argument.
cbStack The size of the stack for the new thread. Use 0 for the default stack size.
enmType The thread type. Used for deciding scheduling attributes of the thread.
fFlags Flags of the RTTHREADFLAGS type (ORed together).
pszName Thread name.
Remarks:
When called in Ring-0, this API will create a new kernel thread and not a thread in the context of the calling process.
Changes the type of the specified thread.

Returns:
iprt status code.
Parameters:
Thread The thread which type should be changed.
enmType The new thread type.
Remarks:
In Ring-0 it only works if Thread == RTThreadSelf().
Wait for the thread to terminate, resume on interruption.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
prc Where to store the return code of the thread. Optional.
Wait for the thread to terminate, return on interruption.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
prc Where to store the return code of the thread. Optional.
Sets the name of a thread.

Returns:
iprt status code.
Parameters:
Thread Thread handle of the thread to query the name of.
pszName The thread name.
Signal the user event.

Returns:
iprt status code.
Wait for the user event.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
Wait for the user event, return on interruption.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
Reset the user event.

Returns:
iprt status code.
Parameters:
Thread The thread to reset.
Create a suspended timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
u64NanoInterval The interval between timer ticks specified in nanoseconds if it's a recurring timer. This is rounded to the fit the system timer granularity. For one shot timers, pass 0.
fFlags Timer flags.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerStart, RTTimerStop, RTTimerDestroy, RTTimerGetSystemGranularity
Stops and destroys a running timer.

Returns:
iprt status code.
Parameters:
pTimer Timer to stop and destroy. NULL is ok.
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_ACTIVE if the timer isn't suspended.
Parameters:
pTimer The timer to activate.
u64First The RTTimeSystemNanoTS() for when the timer should start firing. If 0 is specified, the timer will fire ASAP.
See also:
RTTimerStop
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_SUSPENDED if the timer isn't active.
VERR_NOT_SUPPORTED if the IPRT implementation doesn't support stopping a timer.
Parameters:
pTimer The timer to suspend.
See also:
RTTimerStart
Requests a specific system timer granularity.

Successfull calls to this API must be coupled with the exact same number of calls to RTTimerReleaseSystemGranularity() in order to undo any changes made.

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the requested value isn't supported by the host platform or if the host platform doesn't support modifying the system timer granularity.
VERR_PERMISSION_DENIED if the caller doesn't have the necessary privilege to modify the system timer granularity.
Parameters:
u32Request The requested system timer granularity in nanoseconds.
pu32Granted Where to store the granted system granularity. This is the value that should be passed to RTTimerReleaseSystemGranularity(). It is what RTTimerGetSystemGranularity() would return immediately after the change was made.
The value differ from the request in two ways; rounding and scale. Meaning if your request is for 10.000.000 you might be granted 10.000.055 or 1.000.000.
See also:
RTTimerReleaseSystemGranularity, RTTimerGetSystemGranularity
Releases a system timer granularity grant acquired by RTTimerRequestSystemGranularity().

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the host platform doesn't have any way of modifying the system timer granularity.
VERR_WRONG_ORDER if nobody call RTTimerRequestSystemGranularity() with the given grant value.
Parameters:
u32Granted The granted system granularity.
See also:
RTTimerRequestSystemGranularity
Makes null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Checks if UUID is null.

Returns:
true if UUID is null.
Parameters:
pUuid uuid to check.
Compares two UUID values.

Returns:
0 if eq, < 0 or > 0.
Parameters:
pUuid1 First value to compare.
pUuid2 Second value to compare.
Converts binary UUID to its string representation.

Returns:
iprt status code.
Parameters:
pUuid Uuid to convert.
pszString Where to store result string.
cchString pszString buffer length, must be >= RTUUID_STR_LENGTH.
Converts UUID from its string representation to binary format.

Returns:
iprt status code.
Parameters:
pUuid Where to store result Uuid.
pszString String with UUID text data.
Compresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
pvBuf Pointer to buffer containing the bits to compress.
cbBuf Number of bytes to compress.
Finishes the compression. This will flush all data and terminate the compression data stream.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Destroys the compressor instance.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Create a decompressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnIn Callback for producing input for decompression.
Decompresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
pvBuf Where to store the decompressed data.
cbBuf Number of bytes to produce. If pcbWritten is set any number of bytes up to cbBuf might be returned.
pcbWritten Number of bytes actually written to the buffer. If NULL cbBuf number of bytes must be written.
Destroys the decompressor instance.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
Initialize a critical section.

Returns:
iprt status code.
Parameters:
pCritSect Pointer to the critical section structure.
fFlags Flags, any combination of the RTCRITSECT_FLAGS #defines.
Destroys an environment block.

Returns:
IPRT status code.
Parameters:
Env Handle of the environment block.
Creates an environment block and fill it with variables from the given environment array.

Returns:
IPRT status code. Typical error is VERR_NO_MEMORY.
Parameters:
pEnv Where to store the handle of the environment block.
apszEnv Pointer to the NULL-terminated array of environment variables. If NULL, the current process' environment will be cloned.
Makes a null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Destroy a request packet queueu

Returns:
iprt status code.
Parameters:
pReqQueue The request queue.
Process one or more request packets

Returns:
iprt status code.

VERR_TIMEOUT if cMillies was reached without the packet being added.

Parameters:
pReqQueue The request queue.
cMillies Number of milliseconds to wait for a pending request. Use RT_INDEFINITE_WAIT to only wait till one is added.
Initializes the heap.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the heap anchor block on success.
pvMemory Pointer to the heap memory.
cbMemory The size of the heap memory.
Merge two simple heaps into one.

The requiremet is of course that they next two each other memory wise.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the handle to the merged heap on success.
Heap1 Handle to the first heap.
Heap2 Handle to the second heap.
Remarks:
This API isn't implemented yet.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
args Format arguments.
Create a logger instance for singled threaded ring-0 usage.

Returns:
iprt status code.
Parameters:
pLogger Where to create the logger instance.
cbLogger The amount of memory available for the logger instance.
pfnLogger Pointer to logger wrapper function for the clone.
pfnFlush Pointer to flush function for the clone.
fFlags Logger instance flags for the clone, a combination of the RTLOGFLAGS_* values.
fDestFlags The destination flags.
Destroys a logger instance.

The instance is flushed and all output destinations closed (where applicable).

Returns:
iprt status code.
Parameters:
pLogger The logger instance which close destroyed.
Create a logger instance clone for GC usage.

Returns:
iprt status code.
Parameters:
pLogger The logger instance to be cloned.
pLoggerGC Where to create the GC logger instance.
cbLoggerGC Amount of memory allocated to for the GC logger instance clone.
pfnLoggerGCPtr Pointer to logger wrapper function for this instance (GC Ptr).
pfnFlushGCPtr Pointer to flush function (GC Ptr).
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
Copies the group settings and flags from logger instance to another.

Returns:
IPRT status code.
Parameters:
pDstLogger The destination logger instance.
pSrcLogger The source logger instance. If NULL the default one is used.
fFlagsOr OR mask for the flags.
fFlagsAnd AND mask for the flags.
Updates the group settings for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Updates the flags for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Change the page level protection of a memory region.

Returns:
iprt status code.
Parameters:
pv Start of the region. Will be rounded down to nearest page boundary.
cb Size of the region. Will be rounded up to the nearest page boundary.
fProtect The new protection, a combination of the RTMEM_PROT_* defines.
Allocates a new copy of the given UTF-8 string.

Returns:
iprt status code.
Parameters:
ppszString Receives pointer of the allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
pszString UTF-8 string to duplicate.
Gets the number of code points the string is made up of, excluding the terminator.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcuc Where to store the code point count. This is undefined on failure.
Translate a UTF-8 string into an unicode string (i.e. RTUNICPs), allocating the string buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppUniString Receives pointer to the allocated unicode string. The returned string must be freed using RTUniFree().
Translates pszString from UTF-8 to an array of code points, allocating the result array if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppaCps If cCps is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppusz is NULL or cCps is zero a buffer of at least cCps items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cCps The number of code points in the unicode string. This includes the terminator.
pcCps Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Calculates the length of the string in RTUTF16 items.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcwc Where to store the string length. Optional. This is undefined on failure.
Translate a UTF-8 string into a UTF-16 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppwszString Receives pointer to the allocated UTF-16 string. The returned string must be freed using RTUtf16Free().
Translates pszString from UTF-8 to UTF-16, allocating the result buffer if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppwsz If cwc is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppwsz is NULL or cwc is zero a buffer of at least cwc items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cwc The buffer size in RTUTF16s. This includes the terminator.
pcwc Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
unicode code point.

RTUNICP_INVALID if the encoding is invalid.

Parameters:
ppsz The string.
pCp Where to store the unicode code point.
Formats an integer number according to the parameters.

Returns:
Length of the formatted number.
Parameters:
psz Pointer to output string buffer of sufficient size.
u64Value Value to format.
uiBase Number representation base.
cchWidth Width.
cchPrecision Precision.
fFlags Flags (NTFS_*).
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
args The format argument.
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
... The format argument.
Converts a string representation of a number to a 64-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu8 Where to store the converted number. (optional)
Converts a string representation of a number to a 64-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi8 Where to store the converted number. (optional)
Performs a case insensitive string compare between two UTF-8 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
psz1 First UTF-8 string.
psz2 Second UTF-8 string.
Destroys the string space. The caller supplies a callback which will be called for each of the string nodes in for freeing their memory and other resources.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Enumerates the string space. The caller supplies a callback which will be called for each of the string nodes.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Allocates a new copy of the specified UTF-16 string.

Returns:
iprt status code.
Parameters:
ppwszString Receives pointer of the allocated UTF-16 string. The returned pointer must be freed using RTUtf16Free().
pwszString UTF-16 string to duplicate.
cwcExtra Number of extra RTUTF16 items to allocate.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case sensitive string compare between two UTF-16 strings.

Returns:
< 0 if the first string less than the second string.s

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case insensitive string compare between two UTF-16 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Performs a case insensitive string compare between two UTF-16 strings using the current locale of the process (if applicable).

This differs from RTUtf16ICmp() in that it will try, if a locale with the required data is available, to do a correct case-insensitive compare. It follows that it is more complex and thereby likely to be more expensive.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Translate a UTF-16 string into a UTF-8 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pwszString UTF-16 string to convert.
ppszString Receives pointer of allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
Translates UTF-16 to UTF-8 using buffer provided by the caller or a fittingly sized buffer allocated by the function.

Returns:
iprt status code.
Parameters:
pwszString The UTF-16 string to convert.
cwcString The number of RTUTF16 items to translation from pwszString. The translate will stop when reaching cwcString or the terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppsz If cch is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppsz is NULL or cch is zero a buffer of at least cch chars will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cch The buffer size in chars (the type). This includes the terminator.
pcch Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
iprt status code.
Parameters:
ppwsz Pointer to the string pointer. This will be updated to point to the char following the current code point.
pCp Where to store the code point. RTUNICP_INVALID is stored here on failure.
Remarks:
This is an internal worker for RTUtf16GetCpEx().
Create a recurring timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
uMilliesInterval Milliseconds between the timer ticks. This is rounded up to the system granularity.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerDestroy, RTTimerStop
Create a suspended timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
u64NanoInterval The interval between timer ticks specified in nanoseconds if it's a recurring timer. This is rounded to the fit the system timer granularity. For one shot timers, pass 0.
fFlags Timer flags.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerStart, RTTimerStop, RTTimerDestroy, RTTimerGetSystemGranularity
Stops and destroys a running timer.

Returns:
iprt status code.
Parameters:
pTimer Timer to stop and destroy. NULL is ok.
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_ACTIVE if the timer isn't suspended.
Parameters:
pTimer The timer to activate.
u64First The RTTimeSystemNanoTS() for when the timer should start firing. If 0 is specified, the timer will fire ASAP.
See also:
RTTimerStop
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_SUSPENDED if the timer isn't active.
VERR_NOT_SUPPORTED if the IPRT implementation doesn't support stopping a timer.
Parameters:
pTimer The timer to suspend.
See also:
RTTimerStart
Requests a specific system timer granularity.

Successfull calls to this API must be coupled with the exact same number of calls to RTTimerReleaseSystemGranularity() in order to undo any changes made.

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the requested value isn't supported by the host platform or if the host platform doesn't support modifying the system timer granularity.
VERR_PERMISSION_DENIED if the caller doesn't have the necessary privilege to modify the system timer granularity.
Parameters:
u32Request The requested system timer granularity in nanoseconds.
pu32Granted Where to store the granted system granularity. This is the value that should be passed to RTTimerReleaseSystemGranularity(). It is what RTTimerGetSystemGranularity() would return immediately after the change was made.
The value differ from the request in two ways; rounding and scale. Meaning if your request is for 10.000.000 you might be granted 10.000.055 or 1.000.000.
See also:
RTTimerReleaseSystemGranularity, RTTimerGetSystemGranularity
Releases a system timer granularity grant acquired by RTTimerRequestSystemGranularity().

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the host platform doesn't have any way of modifying the system timer granularity.
VERR_WRONG_ORDER if nobody call RTTimerRequestSystemGranularity() with the given grant value.
Parameters:
u32Granted The granted system granularity.
See also:
RTTimerRequestSystemGranularity
Create a compressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnOut Callback for consuming output of compression.
enmType Type of compressor to create.
enmLevel Compression level.
Compresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
pvBuf Pointer to buffer containing the bits to compress.
cbBuf Number of bytes to compress.
Finishes the compression. This will flush all data and terminate the compression data stream.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Destroys the compressor instance.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Create a decompressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnIn Callback for producing input for decompression.
Decompresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
pvBuf Where to store the decompressed data.
cbBuf Number of bytes to produce. If pcbWritten is set any number of bytes up to cbBuf might be returned.
pcbWritten Number of bytes actually written to the buffer. If NULL cbBuf number of bytes must be written.
Destroys the decompressor instance.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
Converts a Darwin HRESULT error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts a Darwin IOReturn error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts a Darwin kern_return_t error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts errno to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode errno code.
Converts a L4 errno to a iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode l4 errno.
Remarks:
L4 only.
Converts NT status code to iprt status code.

Needless to say, this is only available on NT and winXX targets.

Returns:
iprt status code.
Parameters:
lNativeCode NT status code.
Remarks:
Windows only.
Converts OS/2 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode OS/2 error code.
Remarks:
OS/2 only.
Converts Win32 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode Win32 error code.
Remarks:
Windows only.
Converts a Darwin IOReturn error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts a Darwin kern_return_t error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts errno to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode errno code.
Converts a L4 errno to a iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode l4 errno.
Remarks:
L4 only.
Converts NT status code to iprt status code.

Needless to say, this is only available on NT and winXX targets.

Returns:
iprt status code.
Parameters:
lNativeCode NT status code.
Remarks:
Windows only.
Converts OS/2 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode OS/2 error code.
Remarks:
OS/2 only.
Converts Win32 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode Win32 error code.
Remarks:
Windows only.
Merge two simple heaps into one.

The requiremet is of course that they next two each other memory wise.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the handle to the merged heap on success.
Heap1 Handle to the first heap.
Heap2 Handle to the second heap.
Remarks:
This API isn't implemented yet.
Open a binary image file.

Returns:
iprt status code.
Parameters:
pszFilename Image filename.
phLdrMod Where to store the handle to the loader module.
Opens a binary image file using kLdr.

Returns:
iprt status code.
Parameters:
pszFilename Image filename.
phLdrMod Where to store the handle to the loaded module.
Remarks:
Primarily for testing the loader.
Open a binary image from in-memory bits.

Returns:
iprt status code.
Parameters:
pvBits The start of the raw-image.
cbBits The size of the raw-image.
enmBits What to expect from the pvBits.
pszLogName What to call the raw-image when logging. For RTLdrLoad and RTLdrOpen the filename is used for this.
phLdrMod Where to store the handle to the loader module.
Closes a loader module handle.

The handle can be obtained using any of the RTLdrLoad(), RTLdrOpen() and RTLdrOpenBits() functions.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
Gets the address of a named exported symbol.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pszSymbol Symbol name.
ppvValue Where to store the symbol value. Note that this is restricted to the pointer size used on the host!
Gets the address of a named exported symbol.

This function differs from the plain one in that it can deal with both GC and HC address sizes, and that it can calculate the symbol value relative to any given base address.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pvBits Optional pointer to the loaded image. Set this to NULL if no RTLdrGetBits() processed image bits are available. Not supported for RTLdrLoad() images.
BaseAddress Image load address. Not supported for RTLdrLoad() images.
pszSymbol Symbol name.
pValue Where to store the symbol value.
Loads the image into a buffer provided by the user and applies fixups for the given base address.

Returns:
iprt status code.
Parameters:
hLdrMod The load module handle.
pvBits Where to put the bits. Must be as large as RTLdrSize() suggests.
BaseAddress The base address.
pfnGetImport Callback function for resolving imports one by one.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Relocates bits after getting them. Useful for code which moves around a bit.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pvBits Where the image bits are. Must've been passed to RTLdrGetBits().
NewBaseAddress The new base address.
OldBaseAddress The old base address.
pfnGetImport Callback function for resolving imports one by one.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Enumerates all symbols in a module.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
fFlags Flags indicating what to return and such.
pvBits Optional pointer to the loaded image. (RTLDR_ENUM_SYMBOL_FLAGS_*) Set this to NULL if no RTLdrGetBits() processed image bits are available.
BaseAddress Image load address.
pfnCallback Callback function.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
args Format arguments.
Create a logger instance for singled threaded ring-0 usage.

Returns:
iprt status code.
Parameters:
pLogger Where to create the logger instance.
cbLogger The amount of memory available for the logger instance.
pfnLogger Pointer to logger wrapper function for the clone.
pfnFlush Pointer to flush function for the clone.
fFlags Logger instance flags for the clone, a combination of the RTLOGFLAGS_* values.
fDestFlags The destination flags.
Destroys a logger instance.

The instance is flushed and all output destinations closed (where applicable).

Returns:
iprt status code.
Parameters:
pLogger The logger instance which close destroyed.
Create a logger instance clone for GC usage.

Returns:
iprt status code.
Parameters:
pLogger The logger instance to be cloned.
pLoggerGC Where to create the GC logger instance.
cbLoggerGC Amount of memory allocated to for the GC logger instance clone.
pfnLoggerGCPtr Pointer to logger wrapper function for this instance (GC Ptr).
pfnFlushGCPtr Pointer to flush function (GC Ptr).
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
Copies the group settings and flags from logger instance to another.

Returns:
IPRT status code.
Parameters:
pDstLogger The destination logger instance.
pSrcLogger The source logger instance. If NULL the default one is used.
fFlagsOr OR mask for the flags.
fFlagsAnd AND mask for the flags.
Updates the group settings for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Updates the flags for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Get the absolute path (no symlinks, no . or .. components), doesn't have to exist.

Returns:
iprt status code.
Parameters:
pszPath The path to resolve.
pszAbsPath Where to store the absolute path.
cchAbsPath Size of the buffer.
Get the absolute path (no symlinks, no . or .. components), assuming the given base path as the current directory. The resulting path doesn't have to exist.

Returns:
iprt status code.
Parameters:
pszBase The base path to act like a current directory. When NULL, the actual cwd is used (i.e. the call is equivalent to RTPathAbs(pszPath, ...).
pszPath The path to resolve.
pszAbsPath Where to store the absolute path.
cchAbsPath Size of the buffer.
Compares two paths.

The comparison takes platform-dependent details into account, such as:

  • On DOS-like platforms, both |\| and |/| separator chars are considered to be equal.
  • On platforms with case-insensitive file systems, mismatching characters are uppercased and compared again.

File system details are currently ignored. This means that you won't get case-insentive compares on unix systems when a path goes into a case-insensitive filesystem like FAT, HPFS, HFS, NTFS, JFS, or similar. For NT, OS/2 and similar you'll won't get case-sensitve compares on a case-sensitive file system.

Parameters:
pszPath1 Path to compare (must be an absolute path).
pszPath2 Path to compare (must be an absolute path).
Returns:
< 0 if the first path less than the second path.

0 if the first path identical to the second path.

> 0 if the first path greater than the second path.

Destroy an event semaphore.

Returns:
iprt status code.
Parameters:
EventSem Handle of the
Signal an event semaphore.

The event semaphore will be signaled and automatically reset after exactly one thread have successfully returned from RTSemEventWait() after waiting/polling on that semaphore.

Returns:
iprt status code.
Parameters:
EventSem The event semaphore to signal.
Wait for the event semaphore to be signaled, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
EventSem The event semaphore to wait on.
cMillies Number of milliseconds to wait.
Wait for the event semaphore to be signaled, return on interruption.

This function will not resume the wait if interrupted.

Returns:
iprt status code.
Parameters:
EventSem The event semaphore to wait on.
cMillies Number of milliseconds to wait.
Create a event multi semaphore.

Returns:
iprt status code.
Parameters:
pEventMultiSem Where to store the event multi semaphore handle.
Destroy an event multi semaphore.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi sempahore to destroy.
Signal an event multi semaphore.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to signal.
Resets an event multi semaphore to non-signaled state.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to reset.
Wait for the event multi semaphore to be signaled, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
EventMultiSem The event multi semaphore to wait on.
cMillies Number of milliseconds to wait.
Wait for the event multi semaphore to be signaled, return on interruption.

This function will not resume the wait if interrupted.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to wait on.
cMillies Number of milliseconds to wait.
Create a mutex semaphore.

Returns:
iprt status code.
Parameters:
pMutexSem Where to store the mutex semaphore handle.
Destroy a mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to destroy.
Request ownership of a mutex semaphore, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
MutexSem The mutex semaphore to request ownership over.
cMillies The number of milliseconds to wait.
Request ownership of a mutex semaphore, return on interruption.

This function will not resume the wait if interrupted.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to request ownership over.
cMillies The number of milliseconds to wait.
Release the ownership of a mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex to release the ownership of. It goes without saying the the calling thread must own it.
Create a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
pMutexSem Where to store the mutex semaphore handle.
Destroy a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to destroy.
Request ownership of a fast mutex semaphore.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to request ownership over.
Release the ownership of a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex to release the ownership of. It goes without saying the the calling thread must own it.
Creates a read/write semaphore.

Returns:
iprt status code.
Parameters:
pRWSem Where to store the handle to the created RW semaphore.
Destroys a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to destroy.
Request read access to a read/write semaphore, resume on interruption

Read requests cannot be nested. A deadlock error will be returned on such attempts.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
RWSem The Read/Write semaphore to request read access to.
cMillies The number of milliseconds to wait.
Request read access to a read/write semaphore, return on interruption

Read requests cannot be nested. A deadlock error will be returned on such attempts.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to request read access to.
cMillies The number of milliseconds to wait.
Release read access to a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write sempahore to release read access to. Goes without saying that caller must have read access to the sem.
Request write access to a read/write semaphore, resume on interruption.

Write requests cannot be nested. If called by the thread currently owning the write lock the function returns an error code indicating deadlock.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
RWSem The Read/Write semaphore to request write access to.
cMillies The number of milliseconds to wait.
Request write access to a read/write semaphore, return on interruption.

Write requests cannot be nested. If called by the thread currently owning the write lock the function returns an error code indicating deadlock.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to request write access to.
cMillies The number of milliseconds to wait.
Release write access to a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write sempahore to release read access to. Goes without saying that caller must have write access to the sem.
Init a Ping-Pong construct.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure which needs initialization.
Destroys a Ping-Pong construct.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure which is to be destroyed. (I.e. put into uninitialized state.)
Signals the pong thread in a ping-pong construct. (I.e. sends ping.) This is called by the ping thread.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure to ping.
Signals the ping thread in a ping-pong construct. (I.e. sends pong.) This is called by the pong thread.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure to pong.
Wait function for the ping thread.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
pPP Pointer to the ping-pong structure to wait on.
cMillies Number of milliseconds to wait.
Wait function for the pong thread.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
pPP Pointer to the ping-pong structure to wait on.
cMillies Number of milliseconds to wait.
Destroys a spinlock created by RTSpinlockCreate().

Returns:
iprt status code.
Parameters:
Spinlock Spinlock returned by RTSpinlockCreate().
Gets the number of code points the string is made up of, excluding the terminator.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcuc Where to store the code point count. This is undefined on failure.
Translate a UTF-8 string into an unicode string (i.e. RTUNICPs), allocating the string buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppUniString Receives pointer to the allocated unicode string. The returned string must be freed using RTUniFree().
Translates pszString from UTF-8 to an array of code points, allocating the result array if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppaCps If cCps is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppusz is NULL or cCps is zero a buffer of at least cCps items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cCps The number of code points in the unicode string. This includes the terminator.
pcCps Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Calculates the length of the string in RTUTF16 items.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcwc Where to store the string length. Optional. This is undefined on failure.
Translate a UTF-8 string into a UTF-16 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppwszString Receives pointer to the allocated UTF-16 string. The returned string must be freed using RTUtf16Free().
Translates pszString from UTF-8 to UTF-16, allocating the result buffer if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppwsz If cwc is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppwsz is NULL or cwc is zero a buffer of at least cwc items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cwc The buffer size in RTUTF16s. This includes the terminator.
pcwc Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
unicode code point.

RTUNICP_INVALID if the encoding is invalid.

Parameters:
ppsz The string.
pCp Where to store the unicode code point.
Formats an integer number according to the parameters.

Returns:
Length of the formatted number.
Parameters:
psz Pointer to output string buffer of sufficient size.
u64Value Value to format.
uiBase Number representation base.
cchWidth Width.
cchPrecision Precision.
fFlags Flags (NTFS_*).
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
args The format argument.
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
... The format argument.
Converts a string representation of a number to a 64-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu8 Where to store the converted number. (optional)
Converts a string representation of a number to a 64-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi8 Where to store the converted number. (optional)
Performs a case insensitive string compare between two UTF-8 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
psz1 First UTF-8 string.
psz2 Second UTF-8 string.
Destroys the string space. The caller supplies a callback which will be called for each of the string nodes in for freeing their memory and other resources.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Enumerates the string space. The caller supplies a callback which will be called for each of the string nodes.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Allocates a new copy of the specified UTF-16 string.

Returns:
iprt status code.
Parameters:
ppwszString Receives pointer of the allocated UTF-16 string. The returned pointer must be freed using RTUtf16Free().
pwszString UTF-16 string to duplicate.
cwcExtra Number of extra RTUTF16 items to allocate.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case sensitive string compare between two UTF-16 strings.

Returns:
< 0 if the first string less than the second string.s

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case insensitive string compare between two UTF-16 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Performs a case insensitive string compare between two UTF-16 strings using the current locale of the process (if applicable).

This differs from RTUtf16ICmp() in that it will try, if a locale with the required data is available, to do a correct case-insensitive compare. It follows that it is more complex and thereby likely to be more expensive.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Translate a UTF-16 string into a UTF-8 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pwszString UTF-16 string to convert.
ppszString Receives pointer of allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
Translates UTF-16 to UTF-8 using buffer provided by the caller or a fittingly sized buffer allocated by the function.

Returns:
iprt status code.
Parameters:
pwszString The UTF-16 string to convert.
cwcString The number of RTUTF16 items to translation from pwszString. The translate will stop when reaching cwcString or the terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppsz If cch is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppsz is NULL or cch is zero a buffer of at least cch chars will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cch The buffer size in chars (the type). This includes the terminator.
pcch Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
iprt status code.
Parameters:
ppwsz Pointer to the string pointer. This will be updated to point to the char following the current code point.
pCp Where to store the code point. RTUNICP_INVALID is stored here on failure.
Remarks:
This is an internal worker for RTUtf16GetCpEx().
Create a new thread.

Returns:
iprt status code.
Parameters:
pThread Where to store the thread handle to the new thread. (optional)
pfnThread The thread function.
pvUser User argument.
cbStack The size of the stack for the new thread. Use 0 for the default stack size.
enmType The thread type. Used for deciding scheduling attributes of the thread.
fFlags Flags of the RTTHREADFLAGS type (ORed together).
pszName Thread name.
Remarks:
When called in Ring-0, this API will create a new kernel thread and not a thread in the context of the calling process.
Changes the type of the specified thread.

Returns:
iprt status code.
Parameters:
Thread The thread which type should be changed.
enmType The new thread type.
Remarks:
In Ring-0 it only works if Thread == RTThreadSelf().
Wait for the thread to terminate, resume on interruption.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
prc Where to store the return code of the thread. Optional.
Wait for the thread to terminate, return on interruption.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
prc Where to store the return code of the thread. Optional.
Sets the name of a thread.

Returns:
iprt status code.
Parameters:
Thread Thread handle of the thread to query the name of.
pszName The thread name.
Signal the user event.

Returns:
iprt status code.
Wait for the user event.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
Wait for the user event, return on interruption.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
Reset the user event.

Returns:
iprt status code.
Parameters:
Thread The thread to reset.
Create a suspended timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
u64NanoInterval The interval between timer ticks specified in nanoseconds if it's a recurring timer. This is rounded to the fit the system timer granularity. For one shot timers, pass 0.
fFlags Timer flags.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerStart, RTTimerStop, RTTimerDestroy, RTTimerGetSystemGranularity
Stops and destroys a running timer.

Returns:
iprt status code.
Parameters:
pTimer Timer to stop and destroy. NULL is ok.
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_ACTIVE if the timer isn't suspended.
Parameters:
pTimer The timer to activate.
u64First The RTTimeSystemNanoTS() for when the timer should start firing. If 0 is specified, the timer will fire ASAP.
See also:
RTTimerStop
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_SUSPENDED if the timer isn't active.
VERR_NOT_SUPPORTED if the IPRT implementation doesn't support stopping a timer.
Parameters:
pTimer The timer to suspend.
See also:
RTTimerStart
Requests a specific system timer granularity.

Successfull calls to this API must be coupled with the exact same number of calls to RTTimerReleaseSystemGranularity() in order to undo any changes made.

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the requested value isn't supported by the host platform or if the host platform doesn't support modifying the system timer granularity.
VERR_PERMISSION_DENIED if the caller doesn't have the necessary privilege to modify the system timer granularity.
Parameters:
u32Request The requested system timer granularity in nanoseconds.
pu32Granted Where to store the granted system granularity. This is the value that should be passed to RTTimerReleaseSystemGranularity(). It is what RTTimerGetSystemGranularity() would return immediately after the change was made.
The value differ from the request in two ways; rounding and scale. Meaning if your request is for 10.000.000 you might be granted 10.000.055 or 1.000.000.
See also:
RTTimerReleaseSystemGranularity, RTTimerGetSystemGranularity
Releases a system timer granularity grant acquired by RTTimerRequestSystemGranularity().

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the host platform doesn't have any way of modifying the system timer granularity.
VERR_WRONG_ORDER if nobody call RTTimerRequestSystemGranularity() with the given grant value.
Parameters:
u32Granted The granted system granularity.
See also:
RTTimerRequestSystemGranularity
Makes null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Checks if UUID is null.

Returns:
true if UUID is null.
Parameters:
pUuid uuid to check.
Compares two UUID values.

Returns:
0 if eq, < 0 or > 0.
Parameters:
pUuid1 First value to compare.
pUuid2 Second value to compare.
Converts binary UUID to its string representation.

Returns:
iprt status code.
Parameters:
pUuid Uuid to convert.
pszString Where to store result string.
cchString pszString buffer length, must be >= RTUUID_STR_LENGTH.
Converts UUID from its string representation to binary format.

Returns:
iprt status code.
Parameters:
pUuid Where to store result Uuid.
pszString String with UUID text data.
Compresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
pvBuf Pointer to buffer containing the bits to compress.
cbBuf Number of bytes to compress.
Finishes the compression. This will flush all data and terminate the compression data stream.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Destroys the compressor instance.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Create a decompressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnIn Callback for producing input for decompression.
Decompresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
pvBuf Where to store the decompressed data.
cbBuf Number of bytes to produce. If pcbWritten is set any number of bytes up to cbBuf might be returned.
pcbWritten Number of bytes actually written to the buffer. If NULL cbBuf number of bytes must be written.
Destroys the decompressor instance.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
Initialize a critical section.

Returns:
iprt status code.
Parameters:
pCritSect Pointer to the critical section structure.
fFlags Flags, any combination of the RTCRITSECT_FLAGS #defines.
Destroys an environment block.

Returns:
IPRT status code.
Parameters:
Env Handle of the environment block.
Creates an environment block and fill it with variables from the given environment array.

Returns:
IPRT status code. Typical error is VERR_NO_MEMORY.
Parameters:
pEnv Where to store the handle of the environment block.
apszEnv Pointer to the NULL-terminated array of environment variables. If NULL, the current process' environment will be cloned.
Makes a null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Destroy a request packet queueu

Returns:
iprt status code.
Parameters:
pReqQueue The request queue.
Process one or more request packets

Returns:
iprt status code.

VERR_TIMEOUT if cMillies was reached without the packet being added.

Parameters:
pReqQueue The request queue.
cMillies Number of milliseconds to wait for a pending request. Use RT_INDEFINITE_WAIT to only wait till one is added.
Initializes the heap.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the heap anchor block on success.
pvMemory Pointer to the heap memory.
cbMemory The size of the heap memory.
Merge two simple heaps into one.

The requiremet is of course that they next two each other memory wise.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the handle to the merged heap on success.
Heap1 Handle to the first heap.
Heap2 Handle to the second heap.
Remarks:
This API isn't implemented yet.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
args Format arguments.
Create a logger instance for singled threaded ring-0 usage.

Returns:
iprt status code.
Parameters:
pLogger Where to create the logger instance.
cbLogger The amount of memory available for the logger instance.
pfnLogger Pointer to logger wrapper function for the clone.
pfnFlush Pointer to flush function for the clone.
fFlags Logger instance flags for the clone, a combination of the RTLOGFLAGS_* values.
fDestFlags The destination flags.
Destroys a logger instance.

The instance is flushed and all output destinations closed (where applicable).

Returns:
iprt status code.
Parameters:
pLogger The logger instance which close destroyed.
Create a logger instance clone for GC usage.

Returns:
iprt status code.
Parameters:
pLogger The logger instance to be cloned.
pLoggerGC Where to create the GC logger instance.
cbLoggerGC Amount of memory allocated to for the GC logger instance clone.
pfnLoggerGCPtr Pointer to logger wrapper function for this instance (GC Ptr).
pfnFlushGCPtr Pointer to flush function (GC Ptr).
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
Copies the group settings and flags from logger instance to another.

Returns:
IPRT status code.
Parameters:
pDstLogger The destination logger instance.
pSrcLogger The source logger instance. If NULL the default one is used.
fFlagsOr OR mask for the flags.
fFlagsAnd AND mask for the flags.
Updates the group settings for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Updates the flags for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Change the page level protection of a memory region.

Returns:
iprt status code.
Parameters:
pv Start of the region. Will be rounded down to nearest page boundary.
cb Size of the region. Will be rounded up to the nearest page boundary.
fProtect The new protection, a combination of the RTMEM_PROT_* defines.
Allocates a new copy of the given UTF-8 string.

Returns:
iprt status code.
Parameters:
ppszString Receives pointer of the allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
pszString UTF-8 string to duplicate.
Gets the number of code points the string is made up of, excluding the terminator.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcuc Where to store the code point count. This is undefined on failure.
Translate a UTF-8 string into an unicode string (i.e. RTUNICPs), allocating the string buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppUniString Receives pointer to the allocated unicode string. The returned string must be freed using RTUniFree().
Translates pszString from UTF-8 to an array of code points, allocating the result array if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppaCps If cCps is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppusz is NULL or cCps is zero a buffer of at least cCps items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cCps The number of code points in the unicode string. This includes the terminator.
pcCps Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Calculates the length of the string in RTUTF16 items.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcwc Where to store the string length. Optional. This is undefined on failure.
Translate a UTF-8 string into a UTF-16 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppwszString Receives pointer to the allocated UTF-16 string. The returned string must be freed using RTUtf16Free().
Translates pszString from UTF-8 to UTF-16, allocating the result buffer if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppwsz If cwc is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppwsz is NULL or cwc is zero a buffer of at least cwc items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cwc The buffer size in RTUTF16s. This includes the terminator.
pcwc Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
unicode code point.

RTUNICP_INVALID if the encoding is invalid.

Parameters:
ppsz The string.
pCp Where to store the unicode code point.
Formats an integer number according to the parameters.

Returns:
Length of the formatted number.
Parameters:
psz Pointer to output string buffer of sufficient size.
u64Value Value to format.
uiBase Number representation base.
cchWidth Width.
cchPrecision Precision.
fFlags Flags (NTFS_*).
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
args The format argument.
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
... The format argument.
Converts a string representation of a number to a 64-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu8 Where to store the converted number. (optional)
Converts a string representation of a number to a 64-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi8 Where to store the converted number. (optional)
Performs a case insensitive string compare between two UTF-8 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
psz1 First UTF-8 string.
psz2 Second UTF-8 string.
Destroys the string space. The caller supplies a callback which will be called for each of the string nodes in for freeing their memory and other resources.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Enumerates the string space. The caller supplies a callback which will be called for each of the string nodes.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Allocates a new copy of the specified UTF-16 string.

Returns:
iprt status code.
Parameters:
ppwszString Receives pointer of the allocated UTF-16 string. The returned pointer must be freed using RTUtf16Free().
pwszString UTF-16 string to duplicate.
cwcExtra Number of extra RTUTF16 items to allocate.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case sensitive string compare between two UTF-16 strings.

Returns:
< 0 if the first string less than the second string.s

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case insensitive string compare between two UTF-16 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Performs a case insensitive string compare between two UTF-16 strings using the current locale of the process (if applicable).

This differs from RTUtf16ICmp() in that it will try, if a locale with the required data is available, to do a correct case-insensitive compare. It follows that it is more complex and thereby likely to be more expensive.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Translate a UTF-16 string into a UTF-8 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pwszString UTF-16 string to convert.
ppszString Receives pointer of allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
Translates UTF-16 to UTF-8 using buffer provided by the caller or a fittingly sized buffer allocated by the function.

Returns:
iprt status code.
Parameters:
pwszString The UTF-16 string to convert.
cwcString The number of RTUTF16 items to translation from pwszString. The translate will stop when reaching cwcString or the terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppsz If cch is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppsz is NULL or cch is zero a buffer of at least cch chars will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cch The buffer size in chars (the type). This includes the terminator.
pcch Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
iprt status code.
Parameters:
ppwsz Pointer to the string pointer. This will be updated to point to the char following the current code point.
pCp Where to store the code point. RTUNICP_INVALID is stored here on failure.
Remarks:
This is an internal worker for RTUtf16GetCpEx().
Create a recurring timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
uMilliesInterval Milliseconds between the timer ticks. This is rounded up to the system granularity.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerDestroy, RTTimerStop
Create a suspended timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
u64NanoInterval The interval between timer ticks specified in nanoseconds if it's a recurring timer. This is rounded to the fit the system timer granularity. For one shot timers, pass 0.
fFlags Timer flags.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerStart, RTTimerStop, RTTimerDestroy, RTTimerGetSystemGranularity
Stops and destroys a running timer.

Returns:
iprt status code.
Parameters:
pTimer Timer to stop and destroy. NULL is ok.
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_ACTIVE if the timer isn't suspended.
Parameters:
pTimer The timer to activate.
u64First The RTTimeSystemNanoTS() for when the timer should start firing. If 0 is specified, the timer will fire ASAP.
See also:
RTTimerStop
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_SUSPENDED if the timer isn't active.
VERR_NOT_SUPPORTED if the IPRT implementation doesn't support stopping a timer.
Parameters:
pTimer The timer to suspend.
See also:
RTTimerStart
Requests a specific system timer granularity.

Successfull calls to this API must be coupled with the exact same number of calls to RTTimerReleaseSystemGranularity() in order to undo any changes made.

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the requested value isn't supported by the host platform or if the host platform doesn't support modifying the system timer granularity.
VERR_PERMISSION_DENIED if the caller doesn't have the necessary privilege to modify the system timer granularity.
Parameters:
u32Request The requested system timer granularity in nanoseconds.
pu32Granted Where to store the granted system granularity. This is the value that should be passed to RTTimerReleaseSystemGranularity(). It is what RTTimerGetSystemGranularity() would return immediately after the change was made.
The value differ from the request in two ways; rounding and scale. Meaning if your request is for 10.000.000 you might be granted 10.000.055 or 1.000.000.
See also:
RTTimerReleaseSystemGranularity, RTTimerGetSystemGranularity
Releases a system timer granularity grant acquired by RTTimerRequestSystemGranularity().

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the host platform doesn't have any way of modifying the system timer granularity.
VERR_WRONG_ORDER if nobody call RTTimerRequestSystemGranularity() with the given grant value.
Parameters:
u32Granted The granted system granularity.
See also:
RTTimerRequestSystemGranularity
Create a compressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnOut Callback for consuming output of compression.
enmType Type of compressor to create.
enmLevel Compression level.
Compresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
pvBuf Pointer to buffer containing the bits to compress.
cbBuf Number of bytes to compress.
Finishes the compression. This will flush all data and terminate the compression data stream.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Destroys the compressor instance.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Create a decompressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnIn Callback for producing input for decompression.
Decompresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
pvBuf Where to store the decompressed data.
cbBuf Number of bytes to produce. If pcbWritten is set any number of bytes up to cbBuf might be returned.
pcbWritten Number of bytes actually written to the buffer. If NULL cbBuf number of bytes must be written.
Destroys the decompressor instance.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
Stub function for non-debug builds.

Initializes the heap.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the heap anchor block on success.
pvMemory Pointer to the heap memory.
cbMemory The size of the heap memory.
Converts a Darwin HRESULT error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts a Darwin IOReturn error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts a Darwin kern_return_t error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts errno to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode errno code.
Converts a L4 errno to a iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode l4 errno.
Remarks:
L4 only.
Converts NT status code to iprt status code.

Needless to say, this is only available on NT and winXX targets.

Returns:
iprt status code.
Parameters:
lNativeCode NT status code.
Remarks:
Windows only.
Converts OS/2 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode OS/2 error code.
Remarks:
OS/2 only.
Converts Win32 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode Win32 error code.
Remarks:
Windows only.
Converts a Darwin IOReturn error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts a Darwin kern_return_t error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts errno to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode errno code.
Converts a L4 errno to a iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode l4 errno.
Remarks:
L4 only.
Converts NT status code to iprt status code.

Needless to say, this is only available on NT and winXX targets.

Returns:
iprt status code.
Parameters:
lNativeCode NT status code.
Remarks:
Windows only.
Converts OS/2 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode OS/2 error code.
Remarks:
OS/2 only.
Converts Win32 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode Win32 error code.
Remarks:
Windows only.
Merge two simple heaps into one.

The requiremet is of course that they next two each other memory wise.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the handle to the merged heap on success.
Heap1 Handle to the first heap.
Heap2 Handle to the second heap.
Remarks:
This API isn't implemented yet.
Open a binary image file.

Returns:
iprt status code.
Parameters:
pszFilename Image filename.
phLdrMod Where to store the handle to the loader module.
Opens a binary image file using kLdr.

Returns:
iprt status code.
Parameters:
pszFilename Image filename.
phLdrMod Where to store the handle to the loaded module.
Remarks:
Primarily for testing the loader.
Open a binary image from in-memory bits.

Returns:
iprt status code.
Parameters:
pvBits The start of the raw-image.
cbBits The size of the raw-image.
enmBits What to expect from the pvBits.
pszLogName What to call the raw-image when logging. For RTLdrLoad and RTLdrOpen the filename is used for this.
phLdrMod Where to store the handle to the loader module.
Closes a loader module handle.

The handle can be obtained using any of the RTLdrLoad(), RTLdrOpen() and RTLdrOpenBits() functions.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
Gets the address of a named exported symbol.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pszSymbol Symbol name.
ppvValue Where to store the symbol value. Note that this is restricted to the pointer size used on the host!
Gets the address of a named exported symbol.

This function differs from the plain one in that it can deal with both GC and HC address sizes, and that it can calculate the symbol value relative to any given base address.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pvBits Optional pointer to the loaded image. Set this to NULL if no RTLdrGetBits() processed image bits are available. Not supported for RTLdrLoad() images.
BaseAddress Image load address. Not supported for RTLdrLoad() images.
pszSymbol Symbol name.
pValue Where to store the symbol value.
Loads the image into a buffer provided by the user and applies fixups for the given base address.

Returns:
iprt status code.
Parameters:
hLdrMod The load module handle.
pvBits Where to put the bits. Must be as large as RTLdrSize() suggests.
BaseAddress The base address.
pfnGetImport Callback function for resolving imports one by one.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Relocates bits after getting them. Useful for code which moves around a bit.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pvBits Where the image bits are. Must've been passed to RTLdrGetBits().
NewBaseAddress The new base address.
OldBaseAddress The old base address.
pfnGetImport Callback function for resolving imports one by one.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Enumerates all symbols in a module.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
fFlags Flags indicating what to return and such.
pvBits Optional pointer to the loaded image. (RTLDR_ENUM_SYMBOL_FLAGS_*) Set this to NULL if no RTLdrGetBits() processed image bits are available.
BaseAddress Image load address.
pfnCallback Callback function.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
args Format arguments.
Create a logger instance for singled threaded ring-0 usage.

Returns:
iprt status code.
Parameters:
pLogger Where to create the logger instance.
cbLogger The amount of memory available for the logger instance.
pfnLogger Pointer to logger wrapper function for the clone.
pfnFlush Pointer to flush function for the clone.
fFlags Logger instance flags for the clone, a combination of the RTLOGFLAGS_* values.
fDestFlags The destination flags.
Destroys a logger instance.

The instance is flushed and all output destinations closed (where applicable).

Returns:
iprt status code.
Parameters:
pLogger The logger instance which close destroyed.
Create a logger instance clone for GC usage.

Returns:
iprt status code.
Parameters:
pLogger The logger instance to be cloned.
pLoggerGC Where to create the GC logger instance.
cbLoggerGC Amount of memory allocated to for the GC logger instance clone.
pfnLoggerGCPtr Pointer to logger wrapper function for this instance (GC Ptr).
pfnFlushGCPtr Pointer to flush function (GC Ptr).
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
Copies the group settings and flags from logger instance to another.

Returns:
IPRT status code.
Parameters:
pDstLogger The destination logger instance.
pSrcLogger The source logger instance. If NULL the default one is used.
fFlagsOr OR mask for the flags.
fFlagsAnd AND mask for the flags.
Updates the group settings for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Updates the flags for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Get the absolute path (no symlinks, no . or .. components), doesn't have to exist.

Returns:
iprt status code.
Parameters:
pszPath The path to resolve.
pszAbsPath Where to store the absolute path.
cchAbsPath Size of the buffer.
Get the absolute path (no symlinks, no . or .. components), assuming the given base path as the current directory. The resulting path doesn't have to exist.

Returns:
iprt status code.
Parameters:
pszBase The base path to act like a current directory. When NULL, the actual cwd is used (i.e. the call is equivalent to RTPathAbs(pszPath, ...).
pszPath The path to resolve.
pszAbsPath Where to store the absolute path.
cchAbsPath Size of the buffer.
Compares two paths.

The comparison takes platform-dependent details into account, such as:

  • On DOS-like platforms, both |\| and |/| separator chars are considered to be equal.
  • On platforms with case-insensitive file systems, mismatching characters are uppercased and compared again.

File system details are currently ignored. This means that you won't get case-insentive compares on unix systems when a path goes into a case-insensitive filesystem like FAT, HPFS, HFS, NTFS, JFS, or similar. For NT, OS/2 and similar you'll won't get case-sensitve compares on a case-sensitive file system.

Parameters:
pszPath1 Path to compare (must be an absolute path).
pszPath2 Path to compare (must be an absolute path).
Returns:
< 0 if the first path less than the second path.

0 if the first path identical to the second path.

> 0 if the first path greater than the second path.

Destroy an event semaphore.

Returns:
iprt status code.
Parameters:
EventSem Handle of the
Signal an event semaphore.

The event semaphore will be signaled and automatically reset after exactly one thread have successfully returned from RTSemEventWait() after waiting/polling on that semaphore.

Returns:
iprt status code.
Parameters:
EventSem The event semaphore to signal.
Wait for the event semaphore to be signaled, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
EventSem The event semaphore to wait on.
cMillies Number of milliseconds to wait.
Wait for the event semaphore to be signaled, return on interruption.

This function will not resume the wait if interrupted.

Returns:
iprt status code.
Parameters:
EventSem The event semaphore to wait on.
cMillies Number of milliseconds to wait.
Create a event multi semaphore.

Returns:
iprt status code.
Parameters:
pEventMultiSem Where to store the event multi semaphore handle.
Destroy an event multi semaphore.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi sempahore to destroy.
Signal an event multi semaphore.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to signal.
Resets an event multi semaphore to non-signaled state.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to reset.
Wait for the event multi semaphore to be signaled, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
EventMultiSem The event multi semaphore to wait on.
cMillies Number of milliseconds to wait.
Wait for the event multi semaphore to be signaled, return on interruption.

This function will not resume the wait if interrupted.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to wait on.
cMillies Number of milliseconds to wait.
Create a mutex semaphore.

Returns:
iprt status code.
Parameters:
pMutexSem Where to store the mutex semaphore handle.
Destroy a mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to destroy.
Request ownership of a mutex semaphore, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
MutexSem The mutex semaphore to request ownership over.
cMillies The number of milliseconds to wait.
Request ownership of a mutex semaphore, return on interruption.

This function will not resume the wait if interrupted.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to request ownership over.
cMillies The number of milliseconds to wait.
Release the ownership of a mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex to release the ownership of. It goes without saying the the calling thread must own it.
Create a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
pMutexSem Where to store the mutex semaphore handle.
Destroy a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to destroy.
Request ownership of a fast mutex semaphore.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to request ownership over.
Release the ownership of a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex to release the ownership of. It goes without saying the the calling thread must own it.
Creates a read/write semaphore.

Returns:
iprt status code.
Parameters:
pRWSem Where to store the handle to the created RW semaphore.
Destroys a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to destroy.
Request read access to a read/write semaphore, resume on interruption

Read requests cannot be nested. A deadlock error will be returned on such attempts.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
RWSem The Read/Write semaphore to request read access to.
cMillies The number of milliseconds to wait.
Request read access to a read/write semaphore, return on interruption

Read requests cannot be nested. A deadlock error will be returned on such attempts.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to request read access to.
cMillies The number of milliseconds to wait.
Release read access to a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write sempahore to release read access to. Goes without saying that caller must have read access to the sem.
Request write access to a read/write semaphore, resume on interruption.

Write requests cannot be nested. If called by the thread currently owning the write lock the function returns an error code indicating deadlock.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
RWSem The Read/Write semaphore to request write access to.
cMillies The number of milliseconds to wait.
Request write access to a read/write semaphore, return on interruption.

Write requests cannot be nested. If called by the thread currently owning the write lock the function returns an error code indicating deadlock.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to request write access to.
cMillies The number of milliseconds to wait.
Release write access to a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write sempahore to release read access to. Goes without saying that caller must have write access to the sem.
Init a Ping-Pong construct.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure which needs initialization.
Destroys a Ping-Pong construct.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure which is to be destroyed. (I.e. put into uninitialized state.)
Signals the pong thread in a ping-pong construct. (I.e. sends ping.) This is called by the ping thread.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure to ping.
Signals the ping thread in a ping-pong construct. (I.e. sends pong.) This is called by the pong thread.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure to pong.
Wait function for the ping thread.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
pPP Pointer to the ping-pong structure to wait on.
cMillies Number of milliseconds to wait.
Wait function for the pong thread.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
pPP Pointer to the ping-pong structure to wait on.
cMillies Number of milliseconds to wait.
Destroys a spinlock created by RTSpinlockCreate().

Returns:
iprt status code.
Parameters:
Spinlock Spinlock returned by RTSpinlockCreate().
Gets the number of code points the string is made up of, excluding the terminator.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcuc Where to store the code point count. This is undefined on failure.
Translate a UTF-8 string into an unicode string (i.e. RTUNICPs), allocating the string buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppUniString Receives pointer to the allocated unicode string. The returned string must be freed using RTUniFree().
Translates pszString from UTF-8 to an array of code points, allocating the result array if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppaCps If cCps is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppusz is NULL or cCps is zero a buffer of at least cCps items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cCps The number of code points in the unicode string. This includes the terminator.
pcCps Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Calculates the length of the string in RTUTF16 items.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcwc Where to store the string length. Optional. This is undefined on failure.
Translate a UTF-8 string into a UTF-16 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppwszString Receives pointer to the allocated UTF-16 string. The returned string must be freed using RTUtf16Free().
Translates pszString from UTF-8 to UTF-16, allocating the result buffer if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppwsz If cwc is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppwsz is NULL or cwc is zero a buffer of at least cwc items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cwc The buffer size in RTUTF16s. This includes the terminator.
pcwc Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
unicode code point.

RTUNICP_INVALID if the encoding is invalid.

Parameters:
ppsz The string.
pCp Where to store the unicode code point.
Formats an integer number according to the parameters.

Returns:
Length of the formatted number.
Parameters:
psz Pointer to output string buffer of sufficient size.
u64Value Value to format.
uiBase Number representation base.
cchWidth Width.
cchPrecision Precision.
fFlags Flags (NTFS_*).
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
args The format argument.
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
... The format argument.
Converts a string representation of a number to a 64-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu8 Where to store the converted number. (optional)
Converts a string representation of a number to a 64-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi8 Where to store the converted number. (optional)
Performs a case insensitive string compare between two UTF-8 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
psz1 First UTF-8 string.
psz2 Second UTF-8 string.
Destroys the string space. The caller supplies a callback which will be called for each of the string nodes in for freeing their memory and other resources.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Enumerates the string space. The caller supplies a callback which will be called for each of the string nodes.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Allocates a new copy of the specified UTF-16 string.

Returns:
iprt status code.
Parameters:
ppwszString Receives pointer of the allocated UTF-16 string. The returned pointer must be freed using RTUtf16Free().
pwszString UTF-16 string to duplicate.
cwcExtra Number of extra RTUTF16 items to allocate.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case sensitive string compare between two UTF-16 strings.

Returns:
< 0 if the first string less than the second string.s

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case insensitive string compare between two UTF-16 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Performs a case insensitive string compare between two UTF-16 strings using the current locale of the process (if applicable).

This differs from RTUtf16ICmp() in that it will try, if a locale with the required data is available, to do a correct case-insensitive compare. It follows that it is more complex and thereby likely to be more expensive.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Translate a UTF-16 string into a UTF-8 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pwszString UTF-16 string to convert.
ppszString Receives pointer of allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
Translates UTF-16 to UTF-8 using buffer provided by the caller or a fittingly sized buffer allocated by the function.

Returns:
iprt status code.
Parameters:
pwszString The UTF-16 string to convert.
cwcString The number of RTUTF16 items to translation from pwszString. The translate will stop when reaching cwcString or the terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppsz If cch is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppsz is NULL or cch is zero a buffer of at least cch chars will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cch The buffer size in chars (the type). This includes the terminator.
pcch Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
iprt status code.
Parameters:
ppwsz Pointer to the string pointer. This will be updated to point to the char following the current code point.
pCp Where to store the code point. RTUNICP_INVALID is stored here on failure.
Remarks:
This is an internal worker for RTUtf16GetCpEx().
Create a new thread.

Returns:
iprt status code.
Parameters:
pThread Where to store the thread handle to the new thread. (optional)
pfnThread The thread function.
pvUser User argument.
cbStack The size of the stack for the new thread. Use 0 for the default stack size.
enmType The thread type. Used for deciding scheduling attributes of the thread.
fFlags Flags of the RTTHREADFLAGS type (ORed together).
pszName Thread name.
Remarks:
When called in Ring-0, this API will create a new kernel thread and not a thread in the context of the calling process.
Changes the type of the specified thread.

Returns:
iprt status code.
Parameters:
Thread The thread which type should be changed.
enmType The new thread type.
Remarks:
In Ring-0 it only works if Thread == RTThreadSelf().
Wait for the thread to terminate, resume on interruption.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
prc Where to store the return code of the thread. Optional.
Wait for the thread to terminate, return on interruption.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
prc Where to store the return code of the thread. Optional.
Sets the name of a thread.

Returns:
iprt status code.
Parameters:
Thread Thread handle of the thread to query the name of.
pszName The thread name.
Signal the user event.

Returns:
iprt status code.
Wait for the user event.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
Wait for the user event, return on interruption.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
Reset the user event.

Returns:
iprt status code.
Parameters:
Thread The thread to reset.
Create a suspended timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
u64NanoInterval The interval between timer ticks specified in nanoseconds if it's a recurring timer. This is rounded to the fit the system timer granularity. For one shot timers, pass 0.
fFlags Timer flags.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerStart, RTTimerStop, RTTimerDestroy, RTTimerGetSystemGranularity
Stops and destroys a running timer.

Returns:
iprt status code.
Parameters:
pTimer Timer to stop and destroy. NULL is ok.
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_ACTIVE if the timer isn't suspended.
Parameters:
pTimer The timer to activate.
u64First The RTTimeSystemNanoTS() for when the timer should start firing. If 0 is specified, the timer will fire ASAP.
See also:
RTTimerStop
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_SUSPENDED if the timer isn't active.
VERR_NOT_SUPPORTED if the IPRT implementation doesn't support stopping a timer.
Parameters:
pTimer The timer to suspend.
See also:
RTTimerStart
Requests a specific system timer granularity.

Successfull calls to this API must be coupled with the exact same number of calls to RTTimerReleaseSystemGranularity() in order to undo any changes made.

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the requested value isn't supported by the host platform or if the host platform doesn't support modifying the system timer granularity.
VERR_PERMISSION_DENIED if the caller doesn't have the necessary privilege to modify the system timer granularity.
Parameters:
u32Request The requested system timer granularity in nanoseconds.
pu32Granted Where to store the granted system granularity. This is the value that should be passed to RTTimerReleaseSystemGranularity(). It is what RTTimerGetSystemGranularity() would return immediately after the change was made.
The value differ from the request in two ways; rounding and scale. Meaning if your request is for 10.000.000 you might be granted 10.000.055 or 1.000.000.
See also:
RTTimerReleaseSystemGranularity, RTTimerGetSystemGranularity
Releases a system timer granularity grant acquired by RTTimerRequestSystemGranularity().

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the host platform doesn't have any way of modifying the system timer granularity.
VERR_WRONG_ORDER if nobody call RTTimerRequestSystemGranularity() with the given grant value.
Parameters:
u32Granted The granted system granularity.
See also:
RTTimerRequestSystemGranularity
Makes null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Checks if UUID is null.

Returns:
true if UUID is null.
Parameters:
pUuid uuid to check.
Compares two UUID values.

Returns:
0 if eq, < 0 or > 0.
Parameters:
pUuid1 First value to compare.
pUuid2 Second value to compare.
Converts binary UUID to its string representation.

Returns:
iprt status code.
Parameters:
pUuid Uuid to convert.
pszString Where to store result string.
cchString pszString buffer length, must be >= RTUUID_STR_LENGTH.
Converts UUID from its string representation to binary format.

Returns:
iprt status code.
Parameters:
pUuid Where to store result Uuid.
pszString String with UUID text data.
Compresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
pvBuf Pointer to buffer containing the bits to compress.
cbBuf Number of bytes to compress.
Finishes the compression. This will flush all data and terminate the compression data stream.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Destroys the compressor instance.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Create a decompressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnIn Callback for producing input for decompression.
Decompresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
pvBuf Where to store the decompressed data.
cbBuf Number of bytes to produce. If pcbWritten is set any number of bytes up to cbBuf might be returned.
pcbWritten Number of bytes actually written to the buffer. If NULL cbBuf number of bytes must be written.
Destroys the decompressor instance.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
Initialize a critical section.

Returns:
iprt status code.
Parameters:
pCritSect Pointer to the critical section structure.
fFlags Flags, any combination of the RTCRITSECT_FLAGS #defines.
Destroys an environment block.

Returns:
IPRT status code.
Parameters:
Env Handle of the environment block.
Creates an environment block and fill it with variables from the given environment array.

Returns:
IPRT status code. Typical error is VERR_NO_MEMORY.
Parameters:
pEnv Where to store the handle of the environment block.
apszEnv Pointer to the NULL-terminated array of environment variables. If NULL, the current process' environment will be cloned.
Makes a null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Destroy a request packet queueu

Returns:
iprt status code.
Parameters:
pReqQueue The request queue.
Process one or more request packets

Returns:
iprt status code.

VERR_TIMEOUT if cMillies was reached without the packet being added.

Parameters:
pReqQueue The request queue.
cMillies Number of milliseconds to wait for a pending request. Use RT_INDEFINITE_WAIT to only wait till one is added.
Initializes the heap.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the heap anchor block on success.
pvMemory Pointer to the heap memory.
cbMemory The size of the heap memory.
Merge two simple heaps into one.

The requiremet is of course that they next two each other memory wise.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the handle to the merged heap on success.
Heap1 Handle to the first heap.
Heap2 Handle to the second heap.
Remarks:
This API isn't implemented yet.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
args Format arguments.
Create a logger instance for singled threaded ring-0 usage.

Returns:
iprt status code.
Parameters:
pLogger Where to create the logger instance.
cbLogger The amount of memory available for the logger instance.
pfnLogger Pointer to logger wrapper function for the clone.
pfnFlush Pointer to flush function for the clone.
fFlags Logger instance flags for the clone, a combination of the RTLOGFLAGS_* values.
fDestFlags The destination flags.
Destroys a logger instance.

The instance is flushed and all output destinations closed (where applicable).

Returns:
iprt status code.
Parameters:
pLogger The logger instance which close destroyed.
Create a logger instance clone for GC usage.

Returns:
iprt status code.
Parameters:
pLogger The logger instance to be cloned.
pLoggerGC Where to create the GC logger instance.
cbLoggerGC Amount of memory allocated to for the GC logger instance clone.
pfnLoggerGCPtr Pointer to logger wrapper function for this instance (GC Ptr).
pfnFlushGCPtr Pointer to flush function (GC Ptr).
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
Copies the group settings and flags from logger instance to another.

Returns:
IPRT status code.
Parameters:
pDstLogger The destination logger instance.
pSrcLogger The source logger instance. If NULL the default one is used.
fFlagsOr OR mask for the flags.
fFlagsAnd AND mask for the flags.
Updates the group settings for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Updates the flags for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Change the page level protection of a memory region.

Returns:
iprt status code.
Parameters:
pv Start of the region. Will be rounded down to nearest page boundary.
cb Size of the region. Will be rounded up to the nearest page boundary.
fProtect The new protection, a combination of the RTMEM_PROT_* defines.
Allocates a new copy of the given UTF-8 string.

Returns:
iprt status code.
Parameters:
ppszString Receives pointer of the allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
pszString UTF-8 string to duplicate.
Gets the number of code points the string is made up of, excluding the terminator.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcuc Where to store the code point count. This is undefined on failure.
Translate a UTF-8 string into an unicode string (i.e. RTUNICPs), allocating the string buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppUniString Receives pointer to the allocated unicode string. The returned string must be freed using RTUniFree().
Translates pszString from UTF-8 to an array of code points, allocating the result array if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppaCps If cCps is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppusz is NULL or cCps is zero a buffer of at least cCps items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cCps The number of code points in the unicode string. This includes the terminator.
pcCps Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Calculates the length of the string in RTUTF16 items.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcwc Where to store the string length. Optional. This is undefined on failure.
Translate a UTF-8 string into a UTF-16 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppwszString Receives pointer to the allocated UTF-16 string. The returned string must be freed using RTUtf16Free().
Translates pszString from UTF-8 to UTF-16, allocating the result buffer if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppwsz If cwc is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppwsz is NULL or cwc is zero a buffer of at least cwc items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cwc The buffer size in RTUTF16s. This includes the terminator.
pcwc Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
unicode code point.

RTUNICP_INVALID if the encoding is invalid.

Parameters:
ppsz The string.
pCp Where to store the unicode code point.
Formats an integer number according to the parameters.

Returns:
Length of the formatted number.
Parameters:
psz Pointer to output string buffer of sufficient size.
u64Value Value to format.
uiBase Number representation base.
cchWidth Width.
cchPrecision Precision.
fFlags Flags (NTFS_*).
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
args The format argument.
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
... The format argument.
Converts a string representation of a number to a 64-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu8 Where to store the converted number. (optional)
Converts a string representation of a number to a 64-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi8 Where to store the converted number. (optional)
Performs a case insensitive string compare between two UTF-8 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
psz1 First UTF-8 string.
psz2 Second UTF-8 string.
Destroys the string space. The caller supplies a callback which will be called for each of the string nodes in for freeing their memory and other resources.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Enumerates the string space. The caller supplies a callback which will be called for each of the string nodes.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Allocates a new copy of the specified UTF-16 string.

Returns:
iprt status code.
Parameters:
ppwszString Receives pointer of the allocated UTF-16 string. The returned pointer must be freed using RTUtf16Free().
pwszString UTF-16 string to duplicate.
cwcExtra Number of extra RTUTF16 items to allocate.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case sensitive string compare between two UTF-16 strings.

Returns:
< 0 if the first string less than the second string.s

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case insensitive string compare between two UTF-16 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Performs a case insensitive string compare between two UTF-16 strings using the current locale of the process (if applicable).

This differs from RTUtf16ICmp() in that it will try, if a locale with the required data is available, to do a correct case-insensitive compare. It follows that it is more complex and thereby likely to be more expensive.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Translate a UTF-16 string into a UTF-8 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pwszString UTF-16 string to convert.
ppszString Receives pointer of allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
Translates UTF-16 to UTF-8 using buffer provided by the caller or a fittingly sized buffer allocated by the function.

Returns:
iprt status code.
Parameters:
pwszString The UTF-16 string to convert.
cwcString The number of RTUTF16 items to translation from pwszString. The translate will stop when reaching cwcString or the terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppsz If cch is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppsz is NULL or cch is zero a buffer of at least cch chars will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cch The buffer size in chars (the type). This includes the terminator.
pcch Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
iprt status code.
Parameters:
ppwsz Pointer to the string pointer. This will be updated to point to the char following the current code point.
pCp Where to store the code point. RTUNICP_INVALID is stored here on failure.
Remarks:
This is an internal worker for RTUtf16GetCpEx().
Create a recurring timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
uMilliesInterval Milliseconds between the timer ticks. This is rounded up to the system granularity.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerDestroy, RTTimerStop
Create a suspended timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
u64NanoInterval The interval between timer ticks specified in nanoseconds if it's a recurring timer. This is rounded to the fit the system timer granularity. For one shot timers, pass 0.
fFlags Timer flags.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerStart, RTTimerStop, RTTimerDestroy, RTTimerGetSystemGranularity
Stops and destroys a running timer.

Returns:
iprt status code.
Parameters:
pTimer Timer to stop and destroy. NULL is ok.
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_ACTIVE if the timer isn't suspended.
Parameters:
pTimer The timer to activate.
u64First The RTTimeSystemNanoTS() for when the timer should start firing. If 0 is specified, the timer will fire ASAP.
See also:
RTTimerStop
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_SUSPENDED if the timer isn't active.
VERR_NOT_SUPPORTED if the IPRT implementation doesn't support stopping a timer.
Parameters:
pTimer The timer to suspend.
See also:
RTTimerStart
Requests a specific system timer granularity.

Successfull calls to this API must be coupled with the exact same number of calls to RTTimerReleaseSystemGranularity() in order to undo any changes made.

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the requested value isn't supported by the host platform or if the host platform doesn't support modifying the system timer granularity.
VERR_PERMISSION_DENIED if the caller doesn't have the necessary privilege to modify the system timer granularity.
Parameters:
u32Request The requested system timer granularity in nanoseconds.
pu32Granted Where to store the granted system granularity. This is the value that should be passed to RTTimerReleaseSystemGranularity(). It is what RTTimerGetSystemGranularity() would return immediately after the change was made.
The value differ from the request in two ways; rounding and scale. Meaning if your request is for 10.000.000 you might be granted 10.000.055 or 1.000.000.
See also:
RTTimerReleaseSystemGranularity, RTTimerGetSystemGranularity
Releases a system timer granularity grant acquired by RTTimerRequestSystemGranularity().

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the host platform doesn't have any way of modifying the system timer granularity.
VERR_WRONG_ORDER if nobody call RTTimerRequestSystemGranularity() with the given grant value.
Parameters:
u32Granted The granted system granularity.
See also:
RTTimerRequestSystemGranularity
Create a compressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnOut Callback for consuming output of compression.
enmType Type of compressor to create.
enmLevel Compression level.
Compresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
pvBuf Pointer to buffer containing the bits to compress.
cbBuf Number of bytes to compress.
Finishes the compression. This will flush all data and terminate the compression data stream.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Destroys the compressor instance.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Create a decompressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnIn Callback for producing input for decompression.
Decompresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
pvBuf Where to store the decompressed data.
cbBuf Number of bytes to produce. If pcbWritten is set any number of bytes up to cbBuf might be returned.
pcbWritten Number of bytes actually written to the buffer. If NULL cbBuf number of bytes must be written.
Destroys the decompressor instance.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
Stub function for non-debug builds.

Initializes the heap.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the heap anchor block on success.
pvMemory Pointer to the heap memory.
cbMemory The size of the heap memory.
Initialize a critical section.

Initialize a critical section.

Returns:
iprt status code.
Parameters:
pCritSect Pointer to the critical section structure.
fFlags Flags, any combination of the RTCRITSECT_FLAGS #defines.
Creates an empty environment block.

Returns:
IPRT status code. Typical error is VERR_NO_MEMORY.
Parameters:
pEnv Where to store the handle of the environment block.
Destroys an environment block.

Returns:
IPRT status code.
Parameters:
Env Handle of the environment block.
Creates an environment block and fill it with variables from the given environment array.

Returns:
IPRT status code. Typical error is VERR_NO_MEMORY.
Parameters:
pEnv Where to store the handle of the environment block.
apszEnv Pointer to the NULL-terminated array of environment variables. If NULL, the current process' environment will be cloned.
Converts a Darwin HRESULT error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts a Darwin IOReturn error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts a Darwin kern_return_t error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts errno to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode errno code.
Converts a L4 errno to a iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode l4 errno.
Remarks:
L4 only.
Converts NT status code to iprt status code.

Needless to say, this is only available on NT and winXX targets.

Returns:
iprt status code.
Parameters:
lNativeCode NT status code.
Remarks:
Windows only.
Converts OS/2 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode OS/2 error code.
Remarks:
OS/2 only.
Converts Win32 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode Win32 error code.
Remarks:
Windows only.
Converts a Darwin IOReturn error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts a Darwin kern_return_t error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts errno to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode errno code.
Converts a L4 errno to a iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode l4 errno.
Remarks:
L4 only.
Converts NT status code to iprt status code.

Needless to say, this is only available on NT and winXX targets.

Returns:
iprt status code.
Parameters:
lNativeCode NT status code.
Remarks:
Windows only.
Converts OS/2 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode OS/2 error code.
Remarks:
OS/2 only.
Converts Win32 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode Win32 error code.
Remarks:
Windows only.
Merge two simple heaps into one.

The requiremet is of course that they next two each other memory wise.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the handle to the merged heap on success.
Heap1 Handle to the first heap.
Heap2 Handle to the second heap.
Remarks:
This API isn't implemented yet.
Open a binary image file.

Returns:
iprt status code.
Parameters:
pszFilename Image filename.
phLdrMod Where to store the handle to the loader module.
Opens a binary image file using kLdr.

Returns:
iprt status code.
Parameters:
pszFilename Image filename.
phLdrMod Where to store the handle to the loaded module.
Remarks:
Primarily for testing the loader.
Open a binary image from in-memory bits.

Returns:
iprt status code.
Parameters:
pvBits The start of the raw-image.
cbBits The size of the raw-image.
enmBits What to expect from the pvBits.
pszLogName What to call the raw-image when logging. For RTLdrLoad and RTLdrOpen the filename is used for this.
phLdrMod Where to store the handle to the loader module.
Closes a loader module handle.

The handle can be obtained using any of the RTLdrLoad(), RTLdrOpen() and RTLdrOpenBits() functions.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
Gets the address of a named exported symbol.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pszSymbol Symbol name.
ppvValue Where to store the symbol value. Note that this is restricted to the pointer size used on the host!
Gets the address of a named exported symbol.

This function differs from the plain one in that it can deal with both GC and HC address sizes, and that it can calculate the symbol value relative to any given base address.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pvBits Optional pointer to the loaded image. Set this to NULL if no RTLdrGetBits() processed image bits are available. Not supported for RTLdrLoad() images.
BaseAddress Image load address. Not supported for RTLdrLoad() images.
pszSymbol Symbol name.
pValue Where to store the symbol value.
Loads the image into a buffer provided by the user and applies fixups for the given base address.

Returns:
iprt status code.
Parameters:
hLdrMod The load module handle.
pvBits Where to put the bits. Must be as large as RTLdrSize() suggests.
BaseAddress The base address.
pfnGetImport Callback function for resolving imports one by one.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Relocates bits after getting them. Useful for code which moves around a bit.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pvBits Where the image bits are. Must've been passed to RTLdrGetBits().
NewBaseAddress The new base address.
OldBaseAddress The old base address.
pfnGetImport Callback function for resolving imports one by one.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Enumerates all symbols in a module.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
fFlags Flags indicating what to return and such.
pvBits Optional pointer to the loaded image. (RTLDR_ENUM_SYMBOL_FLAGS_*) Set this to NULL if no RTLdrGetBits() processed image bits are available.
BaseAddress Image load address.
pfnCallback Callback function.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
args Format arguments.
Create a logger instance for singled threaded ring-0 usage.

Returns:
iprt status code.
Parameters:
pLogger Where to create the logger instance.
cbLogger The amount of memory available for the logger instance.
pfnLogger Pointer to logger wrapper function for the clone.
pfnFlush Pointer to flush function for the clone.
fFlags Logger instance flags for the clone, a combination of the RTLOGFLAGS_* values.
fDestFlags The destination flags.
Destroys a logger instance.

The instance is flushed and all output destinations closed (where applicable).

Returns:
iprt status code.
Parameters:
pLogger The logger instance which close destroyed.
Create a logger instance clone for GC usage.

Returns:
iprt status code.
Parameters:
pLogger The logger instance to be cloned.
pLoggerGC Where to create the GC logger instance.
cbLoggerGC Amount of memory allocated to for the GC logger instance clone.
pfnLoggerGCPtr Pointer to logger wrapper function for this instance (GC Ptr).
pfnFlushGCPtr Pointer to flush function (GC Ptr).
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
Copies the group settings and flags from logger instance to another.

Returns:
IPRT status code.
Parameters:
pDstLogger The destination logger instance.
pSrcLogger The source logger instance. If NULL the default one is used.
fFlagsOr OR mask for the flags.
fFlagsAnd AND mask for the flags.
Updates the group settings for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Updates the flags for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Get the absolute path (no symlinks, no . or .. components), doesn't have to exist.

Returns:
iprt status code.
Parameters:
pszPath The path to resolve.
pszAbsPath Where to store the absolute path.
cchAbsPath Size of the buffer.
Get the absolute path (no symlinks, no . or .. components), assuming the given base path as the current directory. The resulting path doesn't have to exist.

Returns:
iprt status code.
Parameters:
pszBase The base path to act like a current directory. When NULL, the actual cwd is used (i.e. the call is equivalent to RTPathAbs(pszPath, ...).
pszPath The path to resolve.
pszAbsPath Where to store the absolute path.
cchAbsPath Size of the buffer.
Compares two paths.

The comparison takes platform-dependent details into account, such as:

  • On DOS-like platforms, both |\| and |/| separator chars are considered to be equal.
  • On platforms with case-insensitive file systems, mismatching characters are uppercased and compared again.

File system details are currently ignored. This means that you won't get case-insentive compares on unix systems when a path goes into a case-insensitive filesystem like FAT, HPFS, HFS, NTFS, JFS, or similar. For NT, OS/2 and similar you'll won't get case-sensitve compares on a case-sensitive file system.

Parameters:
pszPath1 Path to compare (must be an absolute path).
pszPath2 Path to compare (must be an absolute path).
Returns:
< 0 if the first path less than the second path.

0 if the first path identical to the second path.

> 0 if the first path greater than the second path.

Destroy an event semaphore.

Returns:
iprt status code.
Parameters:
EventSem Handle of the
Signal an event semaphore.

The event semaphore will be signaled and automatically reset after exactly one thread have successfully returned from RTSemEventWait() after waiting/polling on that semaphore.

Returns:
iprt status code.
Parameters:
EventSem The event semaphore to signal.
Wait for the event semaphore to be signaled, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
EventSem The event semaphore to wait on.
cMillies Number of milliseconds to wait.
Wait for the event semaphore to be signaled, return on interruption.

This function will not resume the wait if interrupted.

Returns:
iprt status code.
Parameters:
EventSem The event semaphore to wait on.
cMillies Number of milliseconds to wait.
Create a event multi semaphore.

Returns:
iprt status code.
Parameters:
pEventMultiSem Where to store the event multi semaphore handle.
Destroy an event multi semaphore.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi sempahore to destroy.
Signal an event multi semaphore.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to signal.
Resets an event multi semaphore to non-signaled state.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to reset.
Wait for the event multi semaphore to be signaled, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
EventMultiSem The event multi semaphore to wait on.
cMillies Number of milliseconds to wait.
Wait for the event multi semaphore to be signaled, return on interruption.

This function will not resume the wait if interrupted.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to wait on.
cMillies Number of milliseconds to wait.
Create a mutex semaphore.

Returns:
iprt status code.
Parameters:
pMutexSem Where to store the mutex semaphore handle.
Destroy a mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to destroy.
Request ownership of a mutex semaphore, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
MutexSem The mutex semaphore to request ownership over.
cMillies The number of milliseconds to wait.
Request ownership of a mutex semaphore, return on interruption.

This function will not resume the wait if interrupted.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to request ownership over.
cMillies The number of milliseconds to wait.
Release the ownership of a mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex to release the ownership of. It goes without saying the the calling thread must own it.
Create a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
pMutexSem Where to store the mutex semaphore handle.
Destroy a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to destroy.
Request ownership of a fast mutex semaphore.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to request ownership over.
Release the ownership of a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex to release the ownership of. It goes without saying the the calling thread must own it.
Creates a read/write semaphore.

Returns:
iprt status code.
Parameters:
pRWSem Where to store the handle to the created RW semaphore.
Destroys a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to destroy.
Request read access to a read/write semaphore, resume on interruption

Read requests cannot be nested. A deadlock error will be returned on such attempts.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
RWSem The Read/Write semaphore to request read access to.
cMillies The number of milliseconds to wait.
Request read access to a read/write semaphore, return on interruption

Read requests cannot be nested. A deadlock error will be returned on such attempts.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to request read access to.
cMillies The number of milliseconds to wait.
Release read access to a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write sempahore to release read access to. Goes without saying that caller must have read access to the sem.
Request write access to a read/write semaphore, resume on interruption.

Write requests cannot be nested. If called by the thread currently owning the write lock the function returns an error code indicating deadlock.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
RWSem The Read/Write semaphore to request write access to.
cMillies The number of milliseconds to wait.
Request write access to a read/write semaphore, return on interruption.

Write requests cannot be nested. If called by the thread currently owning the write lock the function returns an error code indicating deadlock.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to request write access to.
cMillies The number of milliseconds to wait.
Release write access to a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write sempahore to release read access to. Goes without saying that caller must have write access to the sem.
Init a Ping-Pong construct.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure which needs initialization.
Destroys a Ping-Pong construct.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure which is to be destroyed. (I.e. put into uninitialized state.)
Signals the pong thread in a ping-pong construct. (I.e. sends ping.) This is called by the ping thread.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure to ping.
Signals the ping thread in a ping-pong construct. (I.e. sends pong.) This is called by the pong thread.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure to pong.
Wait function for the ping thread.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
pPP Pointer to the ping-pong structure to wait on.
cMillies Number of milliseconds to wait.
Wait function for the pong thread.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
pPP Pointer to the ping-pong structure to wait on.
cMillies Number of milliseconds to wait.
Destroys a spinlock created by RTSpinlockCreate().

Returns:
iprt status code.
Parameters:
Spinlock Spinlock returned by RTSpinlockCreate().
Gets the number of code points the string is made up of, excluding the terminator.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcuc Where to store the code point count. This is undefined on failure.
Translate a UTF-8 string into an unicode string (i.e. RTUNICPs), allocating the string buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppUniString Receives pointer to the allocated unicode string. The returned string must be freed using RTUniFree().
Translates pszString from UTF-8 to an array of code points, allocating the result array if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppaCps If cCps is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppusz is NULL or cCps is zero a buffer of at least cCps items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cCps The number of code points in the unicode string. This includes the terminator.
pcCps Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Calculates the length of the string in RTUTF16 items.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcwc Where to store the string length. Optional. This is undefined on failure.
Translate a UTF-8 string into a UTF-16 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppwszString Receives pointer to the allocated UTF-16 string. The returned string must be freed using RTUtf16Free().
Translates pszString from UTF-8 to UTF-16, allocating the result buffer if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppwsz If cwc is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppwsz is NULL or cwc is zero a buffer of at least cwc items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cwc The buffer size in RTUTF16s. This includes the terminator.
pcwc Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
unicode code point.

RTUNICP_INVALID if the encoding is invalid.

Parameters:
ppsz The string.
pCp Where to store the unicode code point.
Formats an integer number according to the parameters.

Returns:
Length of the formatted number.
Parameters:
psz Pointer to output string buffer of sufficient size.
u64Value Value to format.
uiBase Number representation base.
cchWidth Width.
cchPrecision Precision.
fFlags Flags (NTFS_*).
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
args The format argument.
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
... The format argument.
Converts a string representation of a number to a 64-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu8 Where to store the converted number. (optional)
Converts a string representation of a number to a 64-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi8 Where to store the converted number. (optional)
Performs a case insensitive string compare between two UTF-8 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
psz1 First UTF-8 string.
psz2 Second UTF-8 string.
Destroys the string space. The caller supplies a callback which will be called for each of the string nodes in for freeing their memory and other resources.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Enumerates the string space. The caller supplies a callback which will be called for each of the string nodes.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Allocates a new copy of the specified UTF-16 string.

Returns:
iprt status code.
Parameters:
ppwszString Receives pointer of the allocated UTF-16 string. The returned pointer must be freed using RTUtf16Free().
pwszString UTF-16 string to duplicate.
cwcExtra Number of extra RTUTF16 items to allocate.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case sensitive string compare between two UTF-16 strings.

Returns:
< 0 if the first string less than the second string.s

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case insensitive string compare between two UTF-16 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Performs a case insensitive string compare between two UTF-16 strings using the current locale of the process (if applicable).

This differs from RTUtf16ICmp() in that it will try, if a locale with the required data is available, to do a correct case-insensitive compare. It follows that it is more complex and thereby likely to be more expensive.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Translate a UTF-16 string into a UTF-8 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pwszString UTF-16 string to convert.
ppszString Receives pointer of allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
Translates UTF-16 to UTF-8 using buffer provided by the caller or a fittingly sized buffer allocated by the function.

Returns:
iprt status code.
Parameters:
pwszString The UTF-16 string to convert.
cwcString The number of RTUTF16 items to translation from pwszString. The translate will stop when reaching cwcString or the terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppsz If cch is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppsz is NULL or cch is zero a buffer of at least cch chars will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cch The buffer size in chars (the type). This includes the terminator.
pcch Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
iprt status code.
Parameters:
ppwsz Pointer to the string pointer. This will be updated to point to the char following the current code point.
pCp Where to store the code point. RTUNICP_INVALID is stored here on failure.
Remarks:
This is an internal worker for RTUtf16GetCpEx().
Create a new thread.

Returns:
iprt status code.
Parameters:
pThread Where to store the thread handle to the new thread. (optional)
pfnThread The thread function.
pvUser User argument.
cbStack The size of the stack for the new thread. Use 0 for the default stack size.
enmType The thread type. Used for deciding scheduling attributes of the thread.
fFlags Flags of the RTTHREADFLAGS type (ORed together).
pszName Thread name.
Remarks:
When called in Ring-0, this API will create a new kernel thread and not a thread in the context of the calling process.
Changes the type of the specified thread.

Returns:
iprt status code.
Parameters:
Thread The thread which type should be changed.
enmType The new thread type.
Remarks:
In Ring-0 it only works if Thread == RTThreadSelf().
Wait for the thread to terminate, resume on interruption.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
prc Where to store the return code of the thread. Optional.
Wait for the thread to terminate, return on interruption.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
prc Where to store the return code of the thread. Optional.
Sets the name of a thread.

Returns:
iprt status code.
Parameters:
Thread Thread handle of the thread to query the name of.
pszName The thread name.
Signal the user event.

Returns:
iprt status code.
Wait for the user event.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
Wait for the user event, return on interruption.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
Reset the user event.

Returns:
iprt status code.
Parameters:
Thread The thread to reset.
Create a suspended timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
u64NanoInterval The interval between timer ticks specified in nanoseconds if it's a recurring timer. This is rounded to the fit the system timer granularity. For one shot timers, pass 0.
fFlags Timer flags.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerStart, RTTimerStop, RTTimerDestroy, RTTimerGetSystemGranularity
Stops and destroys a running timer.

Returns:
iprt status code.
Parameters:
pTimer Timer to stop and destroy. NULL is ok.
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_ACTIVE if the timer isn't suspended.
Parameters:
pTimer The timer to activate.
u64First The RTTimeSystemNanoTS() for when the timer should start firing. If 0 is specified, the timer will fire ASAP.
See also:
RTTimerStop
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_SUSPENDED if the timer isn't active.
VERR_NOT_SUPPORTED if the IPRT implementation doesn't support stopping a timer.
Parameters:
pTimer The timer to suspend.
See also:
RTTimerStart
Requests a specific system timer granularity.

Successfull calls to this API must be coupled with the exact same number of calls to RTTimerReleaseSystemGranularity() in order to undo any changes made.

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the requested value isn't supported by the host platform or if the host platform doesn't support modifying the system timer granularity.
VERR_PERMISSION_DENIED if the caller doesn't have the necessary privilege to modify the system timer granularity.
Parameters:
u32Request The requested system timer granularity in nanoseconds.
pu32Granted Where to store the granted system granularity. This is the value that should be passed to RTTimerReleaseSystemGranularity(). It is what RTTimerGetSystemGranularity() would return immediately after the change was made.
The value differ from the request in two ways; rounding and scale. Meaning if your request is for 10.000.000 you might be granted 10.000.055 or 1.000.000.
See also:
RTTimerReleaseSystemGranularity, RTTimerGetSystemGranularity
Releases a system timer granularity grant acquired by RTTimerRequestSystemGranularity().

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the host platform doesn't have any way of modifying the system timer granularity.
VERR_WRONG_ORDER if nobody call RTTimerRequestSystemGranularity() with the given grant value.
Parameters:
u32Granted The granted system granularity.
See also:
RTTimerRequestSystemGranularity
Makes null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Checks if UUID is null.

Returns:
true if UUID is null.
Parameters:
pUuid uuid to check.
Compares two UUID values.

Returns:
0 if eq, < 0 or > 0.
Parameters:
pUuid1 First value to compare.
pUuid2 Second value to compare.
Converts binary UUID to its string representation.

Returns:
iprt status code.
Parameters:
pUuid Uuid to convert.
pszString Where to store result string.
cchString pszString buffer length, must be >= RTUUID_STR_LENGTH.
Converts UUID from its string representation to binary format.

Returns:
iprt status code.
Parameters:
pUuid Where to store result Uuid.
pszString String with UUID text data.
Compresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
pvBuf Pointer to buffer containing the bits to compress.
cbBuf Number of bytes to compress.
Finishes the compression. This will flush all data and terminate the compression data stream.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Destroys the compressor instance.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Create a decompressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnIn Callback for producing input for decompression.
Decompresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
pvBuf Where to store the decompressed data.
cbBuf Number of bytes to produce. If pcbWritten is set any number of bytes up to cbBuf might be returned.
pcbWritten Number of bytes actually written to the buffer. If NULL cbBuf number of bytes must be written.
Destroys the decompressor instance.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
Initialize a critical section.

Returns:
iprt status code.
Parameters:
pCritSect Pointer to the critical section structure.
fFlags Flags, any combination of the RTCRITSECT_FLAGS #defines.
Destroys an environment block.

Returns:
IPRT status code.
Parameters:
Env Handle of the environment block.
Creates an environment block and fill it with variables from the given environment array.

Returns:
IPRT status code. Typical error is VERR_NO_MEMORY.
Parameters:
pEnv Where to store the handle of the environment block.
apszEnv Pointer to the NULL-terminated array of environment variables. If NULL, the current process' environment will be cloned.
Makes a null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Destroy a request packet queueu

Returns:
iprt status code.
Parameters:
pReqQueue The request queue.
Process one or more request packets

Returns:
iprt status code.

VERR_TIMEOUT if cMillies was reached without the packet being added.

Parameters:
pReqQueue The request queue.
cMillies Number of milliseconds to wait for a pending request. Use RT_INDEFINITE_WAIT to only wait till one is added.
Initializes the heap.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the heap anchor block on success.
pvMemory Pointer to the heap memory.
cbMemory The size of the heap memory.
Merge two simple heaps into one.

The requiremet is of course that they next two each other memory wise.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the handle to the merged heap on success.
Heap1 Handle to the first heap.
Heap2 Handle to the second heap.
Remarks:
This API isn't implemented yet.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
args Format arguments.
Create a logger instance for singled threaded ring-0 usage.

Returns:
iprt status code.
Parameters:
pLogger Where to create the logger instance.
cbLogger The amount of memory available for the logger instance.
pfnLogger Pointer to logger wrapper function for the clone.
pfnFlush Pointer to flush function for the clone.
fFlags Logger instance flags for the clone, a combination of the RTLOGFLAGS_* values.
fDestFlags The destination flags.
Destroys a logger instance.

The instance is flushed and all output destinations closed (where applicable).

Returns:
iprt status code.
Parameters:
pLogger The logger instance which close destroyed.
Create a logger instance clone for GC usage.

Returns:
iprt status code.
Parameters:
pLogger The logger instance to be cloned.
pLoggerGC Where to create the GC logger instance.
cbLoggerGC Amount of memory allocated to for the GC logger instance clone.
pfnLoggerGCPtr Pointer to logger wrapper function for this instance (GC Ptr).
pfnFlushGCPtr Pointer to flush function (GC Ptr).
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
Copies the group settings and flags from logger instance to another.

Returns:
IPRT status code.
Parameters:
pDstLogger The destination logger instance.
pSrcLogger The source logger instance. If NULL the default one is used.
fFlagsOr OR mask for the flags.
fFlagsAnd AND mask for the flags.
Updates the group settings for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Updates the flags for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Change the page level protection of a memory region.

Returns:
iprt status code.
Parameters:
pv Start of the region. Will be rounded down to nearest page boundary.
cb Size of the region. Will be rounded up to the nearest page boundary.
fProtect The new protection, a combination of the RTMEM_PROT_* defines.
Allocates a new copy of the given UTF-8 string.

Returns:
iprt status code.
Parameters:
ppszString Receives pointer of the allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
pszString UTF-8 string to duplicate.
Gets the number of code points the string is made up of, excluding the terminator.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcuc Where to store the code point count. This is undefined on failure.
Translate a UTF-8 string into an unicode string (i.e. RTUNICPs), allocating the string buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppUniString Receives pointer to the allocated unicode string. The returned string must be freed using RTUniFree().
Translates pszString from UTF-8 to an array of code points, allocating the result array if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppaCps If cCps is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppusz is NULL or cCps is zero a buffer of at least cCps items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cCps The number of code points in the unicode string. This includes the terminator.
pcCps Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Calculates the length of the string in RTUTF16 items.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcwc Where to store the string length. Optional. This is undefined on failure.
Translate a UTF-8 string into a UTF-16 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppwszString Receives pointer to the allocated UTF-16 string. The returned string must be freed using RTUtf16Free().
Translates pszString from UTF-8 to UTF-16, allocating the result buffer if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppwsz If cwc is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppwsz is NULL or cwc is zero a buffer of at least cwc items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cwc The buffer size in RTUTF16s. This includes the terminator.
pcwc Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
unicode code point.

RTUNICP_INVALID if the encoding is invalid.

Parameters:
ppsz The string.
pCp Where to store the unicode code point.
Formats an integer number according to the parameters.

Returns:
Length of the formatted number.
Parameters:
psz Pointer to output string buffer of sufficient size.
u64Value Value to format.
uiBase Number representation base.
cchWidth Width.
cchPrecision Precision.
fFlags Flags (NTFS_*).
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
args The format argument.
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
... The format argument.
Converts a string representation of a number to a 64-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu8 Where to store the converted number. (optional)
Converts a string representation of a number to a 64-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi8 Where to store the converted number. (optional)
Performs a case insensitive string compare between two UTF-8 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
psz1 First UTF-8 string.
psz2 Second UTF-8 string.
Destroys the string space. The caller supplies a callback which will be called for each of the string nodes in for freeing their memory and other resources.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Enumerates the string space. The caller supplies a callback which will be called for each of the string nodes.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Allocates a new copy of the specified UTF-16 string.

Returns:
iprt status code.
Parameters:
ppwszString Receives pointer of the allocated UTF-16 string. The returned pointer must be freed using RTUtf16Free().
pwszString UTF-16 string to duplicate.
cwcExtra Number of extra RTUTF16 items to allocate.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case sensitive string compare between two UTF-16 strings.

Returns:
< 0 if the first string less than the second string.s

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case insensitive string compare between two UTF-16 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Performs a case insensitive string compare between two UTF-16 strings using the current locale of the process (if applicable).

This differs from RTUtf16ICmp() in that it will try, if a locale with the required data is available, to do a correct case-insensitive compare. It follows that it is more complex and thereby likely to be more expensive.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Translate a UTF-16 string into a UTF-8 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pwszString UTF-16 string to convert.
ppszString Receives pointer of allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
Translates UTF-16 to UTF-8 using buffer provided by the caller or a fittingly sized buffer allocated by the function.

Returns:
iprt status code.
Parameters:
pwszString The UTF-16 string to convert.
cwcString The number of RTUTF16 items to translation from pwszString. The translate will stop when reaching cwcString or the terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppsz If cch is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppsz is NULL or cch is zero a buffer of at least cch chars will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cch The buffer size in chars (the type). This includes the terminator.
pcch Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
iprt status code.
Parameters:
ppwsz Pointer to the string pointer. This will be updated to point to the char following the current code point.
pCp Where to store the code point. RTUNICP_INVALID is stored here on failure.
Remarks:
This is an internal worker for RTUtf16GetCpEx().
Create a recurring timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
uMilliesInterval Milliseconds between the timer ticks. This is rounded up to the system granularity.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerDestroy, RTTimerStop
Create a suspended timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
u64NanoInterval The interval between timer ticks specified in nanoseconds if it's a recurring timer. This is rounded to the fit the system timer granularity. For one shot timers, pass 0.
fFlags Timer flags.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerStart, RTTimerStop, RTTimerDestroy, RTTimerGetSystemGranularity
Stops and destroys a running timer.

Returns:
iprt status code.
Parameters:
pTimer Timer to stop and destroy. NULL is ok.
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_ACTIVE if the timer isn't suspended.
Parameters:
pTimer The timer to activate.
u64First The RTTimeSystemNanoTS() for when the timer should start firing. If 0 is specified, the timer will fire ASAP.
See also:
RTTimerStop
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_SUSPENDED if the timer isn't active.
VERR_NOT_SUPPORTED if the IPRT implementation doesn't support stopping a timer.
Parameters:
pTimer The timer to suspend.
See also:
RTTimerStart
Requests a specific system timer granularity.

Successfull calls to this API must be coupled with the exact same number of calls to RTTimerReleaseSystemGranularity() in order to undo any changes made.

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the requested value isn't supported by the host platform or if the host platform doesn't support modifying the system timer granularity.
VERR_PERMISSION_DENIED if the caller doesn't have the necessary privilege to modify the system timer granularity.
Parameters:
u32Request The requested system timer granularity in nanoseconds.
pu32Granted Where to store the granted system granularity. This is the value that should be passed to RTTimerReleaseSystemGranularity(). It is what RTTimerGetSystemGranularity() would return immediately after the change was made.
The value differ from the request in two ways; rounding and scale. Meaning if your request is for 10.000.000 you might be granted 10.000.055 or 1.000.000.
See also:
RTTimerReleaseSystemGranularity, RTTimerGetSystemGranularity
Releases a system timer granularity grant acquired by RTTimerRequestSystemGranularity().

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the host platform doesn't have any way of modifying the system timer granularity.
VERR_WRONG_ORDER if nobody call RTTimerRequestSystemGranularity() with the given grant value.
Parameters:
u32Granted The granted system granularity.
See also:
RTTimerRequestSystemGranularity
Create a compressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnOut Callback for consuming output of compression.
enmType Type of compressor to create.
enmLevel Compression level.
Compresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
pvBuf Pointer to buffer containing the bits to compress.
cbBuf Number of bytes to compress.
Finishes the compression. This will flush all data and terminate the compression data stream.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Destroys the compressor instance.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Create a decompressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnIn Callback for producing input for decompression.
Decompresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
pvBuf Where to store the decompressed data.
cbBuf Number of bytes to produce. If pcbWritten is set any number of bytes up to cbBuf might be returned.
pcbWritten Number of bytes actually written to the buffer. If NULL cbBuf number of bytes must be written.
Destroys the decompressor instance.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
Stub function for non-debug builds.

Initializes the heap.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the heap anchor block on success.
pvMemory Pointer to the heap memory.
cbMemory The size of the heap memory.
Initialize a critical section.

Initialize a critical section.

Returns:
iprt status code.
Parameters:
pCritSect Pointer to the critical section structure.
fFlags Flags, any combination of the RTCRITSECT_FLAGS #defines.
Creates an empty environment block.

Returns:
IPRT status code. Typical error is VERR_NO_MEMORY.
Parameters:
pEnv Where to store the handle of the environment block.
Destroys an environment block.

Returns:
IPRT status code.
Parameters:
Env Handle of the environment block.
Creates an environment block and fill it with variables from the given environment array.

Returns:
IPRT status code. Typical error is VERR_NO_MEMORY.
Parameters:
pEnv Where to store the handle of the environment block.
apszEnv Pointer to the NULL-terminated array of environment variables. If NULL, the current process' environment will be cloned.
Generates a new UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated uuid.
Makes a null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Checks if UUID is null.

Returns:
true if UUID is null.
Parameters:
pUuid uuid to check.
Compares two UUID values.

Returns:
0 if eq, < 0 or > 0.
Parameters:
pUuid1 First value to compare.
pUuid2 Second value to compare.
Gets the address of a named exported symbol.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pszSymbol Symbol name.
ppvValue Where to store the symbol value. Note that this is restricted to the pointer size used on the host!
Loads the image into a buffer provided by the user and applies fixups for the given base address.

Returns:
iprt status code.
Parameters:
hLdrMod The load module handle.
pvBits Where to put the bits. Must be as large as RTLdrSize() suggests.
BaseAddress The base address.
pfnGetImport Callback function for resolving imports one by one.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Create a logger instance, comprehensive version.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Todo:
figure out which headers to include to get this one typedef...
Converts a Darwin HRESULT error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts a Darwin IOReturn error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts a Darwin kern_return_t error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts errno to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode errno code.
Converts a L4 errno to a iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode l4 errno.
Remarks:
L4 only.
Converts NT status code to iprt status code.

Needless to say, this is only available on NT and winXX targets.

Returns:
iprt status code.
Parameters:
lNativeCode NT status code.
Remarks:
Windows only.
Converts OS/2 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode OS/2 error code.
Remarks:
OS/2 only.
Converts Win32 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode Win32 error code.
Remarks:
Windows only.
Converts a Darwin IOReturn error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts a Darwin kern_return_t error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts errno to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode errno code.
Converts a L4 errno to a iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode l4 errno.
Remarks:
L4 only.
Converts NT status code to iprt status code.

Needless to say, this is only available on NT and winXX targets.

Returns:
iprt status code.
Parameters:
lNativeCode NT status code.
Remarks:
Windows only.
Converts OS/2 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode OS/2 error code.
Remarks:
OS/2 only.
Converts Win32 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode Win32 error code.
Remarks:
Windows only.
Merge two simple heaps into one.

The requiremet is of course that they next two each other memory wise.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the handle to the merged heap on success.
Heap1 Handle to the first heap.
Heap2 Handle to the second heap.
Remarks:
This API isn't implemented yet.
Open a binary image file.

Returns:
iprt status code.
Parameters:
pszFilename Image filename.
phLdrMod Where to store the handle to the loader module.
Opens a binary image file using kLdr.

Returns:
iprt status code.
Parameters:
pszFilename Image filename.
phLdrMod Where to store the handle to the loaded module.
Remarks:
Primarily for testing the loader.
Open a binary image from in-memory bits.

Returns:
iprt status code.
Parameters:
pvBits The start of the raw-image.
cbBits The size of the raw-image.
enmBits What to expect from the pvBits.
pszLogName What to call the raw-image when logging. For RTLdrLoad and RTLdrOpen the filename is used for this.
phLdrMod Where to store the handle to the loader module.
Closes a loader module handle.

The handle can be obtained using any of the RTLdrLoad(), RTLdrOpen() and RTLdrOpenBits() functions.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
Gets the address of a named exported symbol.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pszSymbol Symbol name.
ppvValue Where to store the symbol value. Note that this is restricted to the pointer size used on the host!
Gets the address of a named exported symbol.

This function differs from the plain one in that it can deal with both GC and HC address sizes, and that it can calculate the symbol value relative to any given base address.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pvBits Optional pointer to the loaded image. Set this to NULL if no RTLdrGetBits() processed image bits are available. Not supported for RTLdrLoad() images.
BaseAddress Image load address. Not supported for RTLdrLoad() images.
pszSymbol Symbol name.
pValue Where to store the symbol value.
Loads the image into a buffer provided by the user and applies fixups for the given base address.

Returns:
iprt status code.
Parameters:
hLdrMod The load module handle.
pvBits Where to put the bits. Must be as large as RTLdrSize() suggests.
BaseAddress The base address.
pfnGetImport Callback function for resolving imports one by one.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Relocates bits after getting them. Useful for code which moves around a bit.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pvBits Where the image bits are. Must've been passed to RTLdrGetBits().
NewBaseAddress The new base address.
OldBaseAddress The old base address.
pfnGetImport Callback function for resolving imports one by one.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Enumerates all symbols in a module.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
fFlags Flags indicating what to return and such.
pvBits Optional pointer to the loaded image. (RTLDR_ENUM_SYMBOL_FLAGS_*) Set this to NULL if no RTLdrGetBits() processed image bits are available.
BaseAddress Image load address.
pfnCallback Callback function.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
args Format arguments.
Create a logger instance for singled threaded ring-0 usage.

Returns:
iprt status code.
Parameters:
pLogger Where to create the logger instance.
cbLogger The amount of memory available for the logger instance.
pfnLogger Pointer to logger wrapper function for the clone.
pfnFlush Pointer to flush function for the clone.
fFlags Logger instance flags for the clone, a combination of the RTLOGFLAGS_* values.
fDestFlags The destination flags.
Destroys a logger instance.

The instance is flushed and all output destinations closed (where applicable).

Returns:
iprt status code.
Parameters:
pLogger The logger instance which close destroyed.
Create a logger instance clone for GC usage.

Returns:
iprt status code.
Parameters:
pLogger The logger instance to be cloned.
pLoggerGC Where to create the GC logger instance.
cbLoggerGC Amount of memory allocated to for the GC logger instance clone.
pfnLoggerGCPtr Pointer to logger wrapper function for this instance (GC Ptr).
pfnFlushGCPtr Pointer to flush function (GC Ptr).
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
Copies the group settings and flags from logger instance to another.

Returns:
IPRT status code.
Parameters:
pDstLogger The destination logger instance.
pSrcLogger The source logger instance. If NULL the default one is used.
fFlagsOr OR mask for the flags.
fFlagsAnd AND mask for the flags.
Updates the group settings for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Updates the flags for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Get the absolute path (no symlinks, no . or .. components), doesn't have to exist.

Returns:
iprt status code.
Parameters:
pszPath The path to resolve.
pszAbsPath Where to store the absolute path.
cchAbsPath Size of the buffer.
Get the absolute path (no symlinks, no . or .. components), assuming the given base path as the current directory. The resulting path doesn't have to exist.

Returns:
iprt status code.
Parameters:
pszBase The base path to act like a current directory. When NULL, the actual cwd is used (i.e. the call is equivalent to RTPathAbs(pszPath, ...).
pszPath The path to resolve.
pszAbsPath Where to store the absolute path.
cchAbsPath Size of the buffer.
Compares two paths.

The comparison takes platform-dependent details into account, such as:

  • On DOS-like platforms, both |\| and |/| separator chars are considered to be equal.
  • On platforms with case-insensitive file systems, mismatching characters are uppercased and compared again.

File system details are currently ignored. This means that you won't get case-insentive compares on unix systems when a path goes into a case-insensitive filesystem like FAT, HPFS, HFS, NTFS, JFS, or similar. For NT, OS/2 and similar you'll won't get case-sensitve compares on a case-sensitive file system.

Parameters:
pszPath1 Path to compare (must be an absolute path).
pszPath2 Path to compare (must be an absolute path).
Returns:
< 0 if the first path less than the second path.

0 if the first path identical to the second path.

> 0 if the first path greater than the second path.

Destroy an event semaphore.

Returns:
iprt status code.
Parameters:
EventSem Handle of the
Signal an event semaphore.

The event semaphore will be signaled and automatically reset after exactly one thread have successfully returned from RTSemEventWait() after waiting/polling on that semaphore.

Returns:
iprt status code.
Parameters:
EventSem The event semaphore to signal.
Wait for the event semaphore to be signaled, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
EventSem The event semaphore to wait on.
cMillies Number of milliseconds to wait.
Wait for the event semaphore to be signaled, return on interruption.

This function will not resume the wait if interrupted.

Returns:
iprt status code.
Parameters:
EventSem The event semaphore to wait on.
cMillies Number of milliseconds to wait.
Create a event multi semaphore.

Returns:
iprt status code.
Parameters:
pEventMultiSem Where to store the event multi semaphore handle.
Destroy an event multi semaphore.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi sempahore to destroy.
Signal an event multi semaphore.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to signal.
Resets an event multi semaphore to non-signaled state.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to reset.
Wait for the event multi semaphore to be signaled, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
EventMultiSem The event multi semaphore to wait on.
cMillies Number of milliseconds to wait.
Wait for the event multi semaphore to be signaled, return on interruption.

This function will not resume the wait if interrupted.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to wait on.
cMillies Number of milliseconds to wait.
Create a mutex semaphore.

Returns:
iprt status code.
Parameters:
pMutexSem Where to store the mutex semaphore handle.
Destroy a mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to destroy.
Request ownership of a mutex semaphore, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
MutexSem The mutex semaphore to request ownership over.
cMillies The number of milliseconds to wait.
Request ownership of a mutex semaphore, return on interruption.

This function will not resume the wait if interrupted.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to request ownership over.
cMillies The number of milliseconds to wait.
Release the ownership of a mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex to release the ownership of. It goes without saying the the calling thread must own it.
Create a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
pMutexSem Where to store the mutex semaphore handle.
Destroy a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to destroy.
Request ownership of a fast mutex semaphore.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to request ownership over.
Release the ownership of a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex to release the ownership of. It goes without saying the the calling thread must own it.
Creates a read/write semaphore.

Returns:
iprt status code.
Parameters:
pRWSem Where to store the handle to the created RW semaphore.
Destroys a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to destroy.
Request read access to a read/write semaphore, resume on interruption

Read requests cannot be nested. A deadlock error will be returned on such attempts.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
RWSem The Read/Write semaphore to request read access to.
cMillies The number of milliseconds to wait.
Request read access to a read/write semaphore, return on interruption

Read requests cannot be nested. A deadlock error will be returned on such attempts.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to request read access to.
cMillies The number of milliseconds to wait.
Release read access to a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write sempahore to release read access to. Goes without saying that caller must have read access to the sem.
Request write access to a read/write semaphore, resume on interruption.

Write requests cannot be nested. If called by the thread currently owning the write lock the function returns an error code indicating deadlock.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
RWSem The Read/Write semaphore to request write access to.
cMillies The number of milliseconds to wait.
Request write access to a read/write semaphore, return on interruption.

Write requests cannot be nested. If called by the thread currently owning the write lock the function returns an error code indicating deadlock.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to request write access to.
cMillies The number of milliseconds to wait.
Release write access to a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write sempahore to release read access to. Goes without saying that caller must have write access to the sem.
Init a Ping-Pong construct.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure which needs initialization.
Destroys a Ping-Pong construct.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure which is to be destroyed. (I.e. put into uninitialized state.)
Signals the pong thread in a ping-pong construct. (I.e. sends ping.) This is called by the ping thread.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure to ping.
Signals the ping thread in a ping-pong construct. (I.e. sends pong.) This is called by the pong thread.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure to pong.
Wait function for the ping thread.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
pPP Pointer to the ping-pong structure to wait on.
cMillies Number of milliseconds to wait.
Wait function for the pong thread.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
pPP Pointer to the ping-pong structure to wait on.
cMillies Number of milliseconds to wait.
Destroys a spinlock created by RTSpinlockCreate().

Returns:
iprt status code.
Parameters:
Spinlock Spinlock returned by RTSpinlockCreate().
Gets the number of code points the string is made up of, excluding the terminator.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcuc Where to store the code point count. This is undefined on failure.
Translate a UTF-8 string into an unicode string (i.e. RTUNICPs), allocating the string buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppUniString Receives pointer to the allocated unicode string. The returned string must be freed using RTUniFree().
Translates pszString from UTF-8 to an array of code points, allocating the result array if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppaCps If cCps is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppusz is NULL or cCps is zero a buffer of at least cCps items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cCps The number of code points in the unicode string. This includes the terminator.
pcCps Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Calculates the length of the string in RTUTF16 items.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcwc Where to store the string length. Optional. This is undefined on failure.
Translate a UTF-8 string into a UTF-16 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppwszString Receives pointer to the allocated UTF-16 string. The returned string must be freed using RTUtf16Free().
Translates pszString from UTF-8 to UTF-16, allocating the result buffer if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppwsz If cwc is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppwsz is NULL or cwc is zero a buffer of at least cwc items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cwc The buffer size in RTUTF16s. This includes the terminator.
pcwc Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
unicode code point.

RTUNICP_INVALID if the encoding is invalid.

Parameters:
ppsz The string.
pCp Where to store the unicode code point.
Formats an integer number according to the parameters.

Returns:
Length of the formatted number.
Parameters:
psz Pointer to output string buffer of sufficient size.
u64Value Value to format.
uiBase Number representation base.
cchWidth Width.
cchPrecision Precision.
fFlags Flags (NTFS_*).
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
args The format argument.
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
... The format argument.
Converts a string representation of a number to a 64-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu8 Where to store the converted number. (optional)
Converts a string representation of a number to a 64-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi8 Where to store the converted number. (optional)
Performs a case insensitive string compare between two UTF-8 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
psz1 First UTF-8 string.
psz2 Second UTF-8 string.
Destroys the string space. The caller supplies a callback which will be called for each of the string nodes in for freeing their memory and other resources.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Enumerates the string space. The caller supplies a callback which will be called for each of the string nodes.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Allocates a new copy of the specified UTF-16 string.

Returns:
iprt status code.
Parameters:
ppwszString Receives pointer of the allocated UTF-16 string. The returned pointer must be freed using RTUtf16Free().
pwszString UTF-16 string to duplicate.
cwcExtra Number of extra RTUTF16 items to allocate.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case sensitive string compare between two UTF-16 strings.

Returns:
< 0 if the first string less than the second string.s

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case insensitive string compare between two UTF-16 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Performs a case insensitive string compare between two UTF-16 strings using the current locale of the process (if applicable).

This differs from RTUtf16ICmp() in that it will try, if a locale with the required data is available, to do a correct case-insensitive compare. It follows that it is more complex and thereby likely to be more expensive.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Translate a UTF-16 string into a UTF-8 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pwszString UTF-16 string to convert.
ppszString Receives pointer of allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
Translates UTF-16 to UTF-8 using buffer provided by the caller or a fittingly sized buffer allocated by the function.

Returns:
iprt status code.
Parameters:
pwszString The UTF-16 string to convert.
cwcString The number of RTUTF16 items to translation from pwszString. The translate will stop when reaching cwcString or the terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppsz If cch is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppsz is NULL or cch is zero a buffer of at least cch chars will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cch The buffer size in chars (the type). This includes the terminator.
pcch Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
iprt status code.
Parameters:
ppwsz Pointer to the string pointer. This will be updated to point to the char following the current code point.
pCp Where to store the code point. RTUNICP_INVALID is stored here on failure.
Remarks:
This is an internal worker for RTUtf16GetCpEx().
Create a new thread.

Returns:
iprt status code.
Parameters:
pThread Where to store the thread handle to the new thread. (optional)
pfnThread The thread function.
pvUser User argument.
cbStack The size of the stack for the new thread. Use 0 for the default stack size.
enmType The thread type. Used for deciding scheduling attributes of the thread.
fFlags Flags of the RTTHREADFLAGS type (ORed together).
pszName Thread name.
Remarks:
When called in Ring-0, this API will create a new kernel thread and not a thread in the context of the calling process.
Changes the type of the specified thread.

Returns:
iprt status code.
Parameters:
Thread The thread which type should be changed.
enmType The new thread type.
Remarks:
In Ring-0 it only works if Thread == RTThreadSelf().
Wait for the thread to terminate, resume on interruption.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
prc Where to store the return code of the thread. Optional.
Wait for the thread to terminate, return on interruption.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
prc Where to store the return code of the thread. Optional.
Sets the name of a thread.

Returns:
iprt status code.
Parameters:
Thread Thread handle of the thread to query the name of.
pszName The thread name.
Signal the user event.

Returns:
iprt status code.
Wait for the user event.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
Wait for the user event, return on interruption.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
Reset the user event.

Returns:
iprt status code.
Parameters:
Thread The thread to reset.
Create a suspended timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
u64NanoInterval The interval between timer ticks specified in nanoseconds if it's a recurring timer. This is rounded to the fit the system timer granularity. For one shot timers, pass 0.
fFlags Timer flags.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerStart, RTTimerStop, RTTimerDestroy, RTTimerGetSystemGranularity
Stops and destroys a running timer.

Returns:
iprt status code.
Parameters:
pTimer Timer to stop and destroy. NULL is ok.
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_ACTIVE if the timer isn't suspended.
Parameters:
pTimer The timer to activate.
u64First The RTTimeSystemNanoTS() for when the timer should start firing. If 0 is specified, the timer will fire ASAP.
See also:
RTTimerStop
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_SUSPENDED if the timer isn't active.
VERR_NOT_SUPPORTED if the IPRT implementation doesn't support stopping a timer.
Parameters:
pTimer The timer to suspend.
See also:
RTTimerStart
Requests a specific system timer granularity.

Successfull calls to this API must be coupled with the exact same number of calls to RTTimerReleaseSystemGranularity() in order to undo any changes made.

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the requested value isn't supported by the host platform or if the host platform doesn't support modifying the system timer granularity.
VERR_PERMISSION_DENIED if the caller doesn't have the necessary privilege to modify the system timer granularity.
Parameters:
u32Request The requested system timer granularity in nanoseconds.
pu32Granted Where to store the granted system granularity. This is the value that should be passed to RTTimerReleaseSystemGranularity(). It is what RTTimerGetSystemGranularity() would return immediately after the change was made.
The value differ from the request in two ways; rounding and scale. Meaning if your request is for 10.000.000 you might be granted 10.000.055 or 1.000.000.
See also:
RTTimerReleaseSystemGranularity, RTTimerGetSystemGranularity
Releases a system timer granularity grant acquired by RTTimerRequestSystemGranularity().

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the host platform doesn't have any way of modifying the system timer granularity.
VERR_WRONG_ORDER if nobody call RTTimerRequestSystemGranularity() with the given grant value.
Parameters:
u32Granted The granted system granularity.
See also:
RTTimerRequestSystemGranularity
Makes null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Checks if UUID is null.

Returns:
true if UUID is null.
Parameters:
pUuid uuid to check.
Compares two UUID values.

Returns:
0 if eq, < 0 or > 0.
Parameters:
pUuid1 First value to compare.
pUuid2 Second value to compare.
Converts binary UUID to its string representation.

Returns:
iprt status code.
Parameters:
pUuid Uuid to convert.
pszString Where to store result string.
cchString pszString buffer length, must be >= RTUUID_STR_LENGTH.
Converts UUID from its string representation to binary format.

Returns:
iprt status code.
Parameters:
pUuid Where to store result Uuid.
pszString String with UUID text data.
Compresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
pvBuf Pointer to buffer containing the bits to compress.
cbBuf Number of bytes to compress.
Finishes the compression. This will flush all data and terminate the compression data stream.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Destroys the compressor instance.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Create a decompressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnIn Callback for producing input for decompression.
Decompresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
pvBuf Where to store the decompressed data.
cbBuf Number of bytes to produce. If pcbWritten is set any number of bytes up to cbBuf might be returned.
pcbWritten Number of bytes actually written to the buffer. If NULL cbBuf number of bytes must be written.
Destroys the decompressor instance.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
Initialize a critical section.

Returns:
iprt status code.
Parameters:
pCritSect Pointer to the critical section structure.
fFlags Flags, any combination of the RTCRITSECT_FLAGS #defines.
Destroys an environment block.

Returns:
IPRT status code.
Parameters:
Env Handle of the environment block.
Creates an environment block and fill it with variables from the given environment array.

Returns:
IPRT status code. Typical error is VERR_NO_MEMORY.
Parameters:
pEnv Where to store the handle of the environment block.
apszEnv Pointer to the NULL-terminated array of environment variables. If NULL, the current process' environment will be cloned.
Makes a null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Destroy a request packet queueu

Returns:
iprt status code.
Parameters:
pReqQueue The request queue.
Process one or more request packets

Returns:
iprt status code.

VERR_TIMEOUT if cMillies was reached without the packet being added.

Parameters:
pReqQueue The request queue.
cMillies Number of milliseconds to wait for a pending request. Use RT_INDEFINITE_WAIT to only wait till one is added.
Initializes the heap.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the heap anchor block on success.
pvMemory Pointer to the heap memory.
cbMemory The size of the heap memory.
Merge two simple heaps into one.

The requiremet is of course that they next two each other memory wise.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the handle to the merged heap on success.
Heap1 Handle to the first heap.
Heap2 Handle to the second heap.
Remarks:
This API isn't implemented yet.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
args Format arguments.
Create a logger instance for singled threaded ring-0 usage.

Returns:
iprt status code.
Parameters:
pLogger Where to create the logger instance.
cbLogger The amount of memory available for the logger instance.
pfnLogger Pointer to logger wrapper function for the clone.
pfnFlush Pointer to flush function for the clone.
fFlags Logger instance flags for the clone, a combination of the RTLOGFLAGS_* values.
fDestFlags The destination flags.
Destroys a logger instance.

The instance is flushed and all output destinations closed (where applicable).

Returns:
iprt status code.
Parameters:
pLogger The logger instance which close destroyed.
Create a logger instance clone for GC usage.

Returns:
iprt status code.
Parameters:
pLogger The logger instance to be cloned.
pLoggerGC Where to create the GC logger instance.
cbLoggerGC Amount of memory allocated to for the GC logger instance clone.
pfnLoggerGCPtr Pointer to logger wrapper function for this instance (GC Ptr).
pfnFlushGCPtr Pointer to flush function (GC Ptr).
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
Copies the group settings and flags from logger instance to another.

Returns:
IPRT status code.
Parameters:
pDstLogger The destination logger instance.
pSrcLogger The source logger instance. If NULL the default one is used.
fFlagsOr OR mask for the flags.
fFlagsAnd AND mask for the flags.
Updates the group settings for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Updates the flags for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Change the page level protection of a memory region.

Returns:
iprt status code.
Parameters:
pv Start of the region. Will be rounded down to nearest page boundary.
cb Size of the region. Will be rounded up to the nearest page boundary.
fProtect The new protection, a combination of the RTMEM_PROT_* defines.
Allocates a new copy of the given UTF-8 string.

Returns:
iprt status code.
Parameters:
ppszString Receives pointer of the allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
pszString UTF-8 string to duplicate.
Gets the number of code points the string is made up of, excluding the terminator.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcuc Where to store the code point count. This is undefined on failure.
Translate a UTF-8 string into an unicode string (i.e. RTUNICPs), allocating the string buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppUniString Receives pointer to the allocated unicode string. The returned string must be freed using RTUniFree().
Translates pszString from UTF-8 to an array of code points, allocating the result array if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppaCps If cCps is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppusz is NULL or cCps is zero a buffer of at least cCps items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cCps The number of code points in the unicode string. This includes the terminator.
pcCps Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Calculates the length of the string in RTUTF16 items.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcwc Where to store the string length. Optional. This is undefined on failure.
Translate a UTF-8 string into a UTF-16 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppwszString Receives pointer to the allocated UTF-16 string. The returned string must be freed using RTUtf16Free().
Translates pszString from UTF-8 to UTF-16, allocating the result buffer if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppwsz If cwc is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppwsz is NULL or cwc is zero a buffer of at least cwc items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cwc The buffer size in RTUTF16s. This includes the terminator.
pcwc Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
unicode code point.

RTUNICP_INVALID if the encoding is invalid.

Parameters:
ppsz The string.
pCp Where to store the unicode code point.
Formats an integer number according to the parameters.

Returns:
Length of the formatted number.
Parameters:
psz Pointer to output string buffer of sufficient size.
u64Value Value to format.
uiBase Number representation base.
cchWidth Width.
cchPrecision Precision.
fFlags Flags (NTFS_*).
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
args The format argument.
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
... The format argument.
Converts a string representation of a number to a 64-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu8 Where to store the converted number. (optional)
Converts a string representation of a number to a 64-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi8 Where to store the converted number. (optional)
Performs a case insensitive string compare between two UTF-8 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
psz1 First UTF-8 string.
psz2 Second UTF-8 string.
Destroys the string space. The caller supplies a callback which will be called for each of the string nodes in for freeing their memory and other resources.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Enumerates the string space. The caller supplies a callback which will be called for each of the string nodes.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Allocates a new copy of the specified UTF-16 string.

Returns:
iprt status code.
Parameters:
ppwszString Receives pointer of the allocated UTF-16 string. The returned pointer must be freed using RTUtf16Free().
pwszString UTF-16 string to duplicate.
cwcExtra Number of extra RTUTF16 items to allocate.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case sensitive string compare between two UTF-16 strings.

Returns:
< 0 if the first string less than the second string.s

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case insensitive string compare between two UTF-16 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Performs a case insensitive string compare between two UTF-16 strings using the current locale of the process (if applicable).

This differs from RTUtf16ICmp() in that it will try, if a locale with the required data is available, to do a correct case-insensitive compare. It follows that it is more complex and thereby likely to be more expensive.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Translate a UTF-16 string into a UTF-8 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pwszString UTF-16 string to convert.
ppszString Receives pointer of allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
Translates UTF-16 to UTF-8 using buffer provided by the caller or a fittingly sized buffer allocated by the function.

Returns:
iprt status code.
Parameters:
pwszString The UTF-16 string to convert.
cwcString The number of RTUTF16 items to translation from pwszString. The translate will stop when reaching cwcString or the terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppsz If cch is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppsz is NULL or cch is zero a buffer of at least cch chars will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cch The buffer size in chars (the type). This includes the terminator.
pcch Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
iprt status code.
Parameters:
ppwsz Pointer to the string pointer. This will be updated to point to the char following the current code point.
pCp Where to store the code point. RTUNICP_INVALID is stored here on failure.
Remarks:
This is an internal worker for RTUtf16GetCpEx().
Create a recurring timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
uMilliesInterval Milliseconds between the timer ticks. This is rounded up to the system granularity.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerDestroy, RTTimerStop
Create a suspended timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
u64NanoInterval The interval between timer ticks specified in nanoseconds if it's a recurring timer. This is rounded to the fit the system timer granularity. For one shot timers, pass 0.
fFlags Timer flags.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerStart, RTTimerStop, RTTimerDestroy, RTTimerGetSystemGranularity
Stops and destroys a running timer.

Returns:
iprt status code.
Parameters:
pTimer Timer to stop and destroy. NULL is ok.
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_ACTIVE if the timer isn't suspended.
Parameters:
pTimer The timer to activate.
u64First The RTTimeSystemNanoTS() for when the timer should start firing. If 0 is specified, the timer will fire ASAP.
See also:
RTTimerStop
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_SUSPENDED if the timer isn't active.
VERR_NOT_SUPPORTED if the IPRT implementation doesn't support stopping a timer.
Parameters:
pTimer The timer to suspend.
See also:
RTTimerStart
Requests a specific system timer granularity.

Successfull calls to this API must be coupled with the exact same number of calls to RTTimerReleaseSystemGranularity() in order to undo any changes made.

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the requested value isn't supported by the host platform or if the host platform doesn't support modifying the system timer granularity.
VERR_PERMISSION_DENIED if the caller doesn't have the necessary privilege to modify the system timer granularity.
Parameters:
u32Request The requested system timer granularity in nanoseconds.
pu32Granted Where to store the granted system granularity. This is the value that should be passed to RTTimerReleaseSystemGranularity(). It is what RTTimerGetSystemGranularity() would return immediately after the change was made.
The value differ from the request in two ways; rounding and scale. Meaning if your request is for 10.000.000 you might be granted 10.000.055 or 1.000.000.
See also:
RTTimerReleaseSystemGranularity, RTTimerGetSystemGranularity
Releases a system timer granularity grant acquired by RTTimerRequestSystemGranularity().

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the host platform doesn't have any way of modifying the system timer granularity.
VERR_WRONG_ORDER if nobody call RTTimerRequestSystemGranularity() with the given grant value.
Parameters:
u32Granted The granted system granularity.
See also:
RTTimerRequestSystemGranularity
Create a compressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnOut Callback for consuming output of compression.
enmType Type of compressor to create.
enmLevel Compression level.
Compresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
pvBuf Pointer to buffer containing the bits to compress.
cbBuf Number of bytes to compress.
Finishes the compression. This will flush all data and terminate the compression data stream.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Destroys the compressor instance.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Create a decompressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnIn Callback for producing input for decompression.
Decompresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
pvBuf Where to store the decompressed data.
cbBuf Number of bytes to produce. If pcbWritten is set any number of bytes up to cbBuf might be returned.
pcbWritten Number of bytes actually written to the buffer. If NULL cbBuf number of bytes must be written.
Destroys the decompressor instance.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
Stub function for non-debug builds.

Initializes the heap.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the heap anchor block on success.
pvMemory Pointer to the heap memory.
cbMemory The size of the heap memory.
Initialize a critical section.

Initialize a critical section.

Returns:
iprt status code.
Parameters:
pCritSect Pointer to the critical section structure.
fFlags Flags, any combination of the RTCRITSECT_FLAGS #defines.
Creates an empty environment block.

Returns:
IPRT status code. Typical error is VERR_NO_MEMORY.
Parameters:
pEnv Where to store the handle of the environment block.
Destroys an environment block.

Returns:
IPRT status code.
Parameters:
Env Handle of the environment block.
Creates an environment block and fill it with variables from the given environment array.

Returns:
IPRT status code. Typical error is VERR_NO_MEMORY.
Parameters:
pEnv Where to store the handle of the environment block.
apszEnv Pointer to the NULL-terminated array of environment variables. If NULL, the current process' environment will be cloned.
Generates a new UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated uuid.
Makes a null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Checks if UUID is null.

Returns:
true if UUID is null.
Parameters:
pUuid uuid to check.
Compares two UUID values.

Returns:
0 if eq, < 0 or > 0.
Parameters:
pUuid1 First value to compare.
pUuid2 Second value to compare.
Gets the address of a named exported symbol.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pszSymbol Symbol name.
ppvValue Where to store the symbol value. Note that this is restricted to the pointer size used on the host!
Loads the image into a buffer provided by the user and applies fixups for the given base address.

Returns:
iprt status code.
Parameters:
hLdrMod The load module handle.
pvBits Where to put the bits. Must be as large as RTLdrSize() suggests.
BaseAddress The base address.
pfnGetImport Callback function for resolving imports one by one.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Create a logger instance, comprehensive version.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Todo:
figure out which headers to include to get this one typedef...
Generates a new UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated uuid.
Makes null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Checks if UUID is null.

Returns:
true if UUID is null.
Parameters:
pUuid uuid to check.
Compares two UUID values.

Returns:
0 if eq, < 0 or > 0.
Parameters:
pUuid1 First value to compare.
pUuid2 Second value to compare.
Create a request packet queueu

Returns:
iprt status code.
Parameters:
pReqQueue The request queue.
Destroy a request packet queueu

Returns:
iprt status code.
Parameters:
pReqQueue The request queue.
Process one or more request packets

Returns:
iprt status code.

VERR_TIMEOUT if cMillies was reached without the packet being added.

Parameters:
pReqQueue The request queue.
cMillies Number of milliseconds to wait for a pending request. Use RT_INDEFINITE_WAIT to only wait till one is added.
Converts a Darwin HRESULT error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts a Darwin IOReturn error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts a Darwin kern_return_t error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts errno to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode errno code.
Converts a L4 errno to a iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode l4 errno.
Remarks:
L4 only.
Converts NT status code to iprt status code.

Needless to say, this is only available on NT and winXX targets.

Returns:
iprt status code.
Parameters:
lNativeCode NT status code.
Remarks:
Windows only.
Converts OS/2 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode OS/2 error code.
Remarks:
OS/2 only.
Converts Win32 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode Win32 error code.
Remarks:
Windows only.
Converts a Darwin IOReturn error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts a Darwin kern_return_t error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts errno to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode errno code.
Converts a L4 errno to a iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode l4 errno.
Remarks:
L4 only.
Converts NT status code to iprt status code.

Needless to say, this is only available on NT and winXX targets.

Returns:
iprt status code.
Parameters:
lNativeCode NT status code.
Remarks:
Windows only.
Converts OS/2 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode OS/2 error code.
Remarks:
OS/2 only.
Converts Win32 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode Win32 error code.
Remarks:
Windows only.
Merge two simple heaps into one.

The requiremet is of course that they next two each other memory wise.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the handle to the merged heap on success.
Heap1 Handle to the first heap.
Heap2 Handle to the second heap.
Remarks:
This API isn't implemented yet.
Open a binary image file.

Returns:
iprt status code.
Parameters:
pszFilename Image filename.
phLdrMod Where to store the handle to the loader module.
Opens a binary image file using kLdr.

Returns:
iprt status code.
Parameters:
pszFilename Image filename.
phLdrMod Where to store the handle to the loaded module.
Remarks:
Primarily for testing the loader.
Open a binary image from in-memory bits.

Returns:
iprt status code.
Parameters:
pvBits The start of the raw-image.
cbBits The size of the raw-image.
enmBits What to expect from the pvBits.
pszLogName What to call the raw-image when logging. For RTLdrLoad and RTLdrOpen the filename is used for this.
phLdrMod Where to store the handle to the loader module.
Closes a loader module handle.

The handle can be obtained using any of the RTLdrLoad(), RTLdrOpen() and RTLdrOpenBits() functions.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
Gets the address of a named exported symbol.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pszSymbol Symbol name.
ppvValue Where to store the symbol value. Note that this is restricted to the pointer size used on the host!
Gets the address of a named exported symbol.

This function differs from the plain one in that it can deal with both GC and HC address sizes, and that it can calculate the symbol value relative to any given base address.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pvBits Optional pointer to the loaded image. Set this to NULL if no RTLdrGetBits() processed image bits are available. Not supported for RTLdrLoad() images.
BaseAddress Image load address. Not supported for RTLdrLoad() images.
pszSymbol Symbol name.
pValue Where to store the symbol value.
Loads the image into a buffer provided by the user and applies fixups for the given base address.

Returns:
iprt status code.
Parameters:
hLdrMod The load module handle.
pvBits Where to put the bits. Must be as large as RTLdrSize() suggests.
BaseAddress The base address.
pfnGetImport Callback function for resolving imports one by one.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Relocates bits after getting them. Useful for code which moves around a bit.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pvBits Where the image bits are. Must've been passed to RTLdrGetBits().
NewBaseAddress The new base address.
OldBaseAddress The old base address.
pfnGetImport Callback function for resolving imports one by one.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Enumerates all symbols in a module.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
fFlags Flags indicating what to return and such.
pvBits Optional pointer to the loaded image. (RTLDR_ENUM_SYMBOL_FLAGS_*) Set this to NULL if no RTLdrGetBits() processed image bits are available.
BaseAddress Image load address.
pfnCallback Callback function.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
args Format arguments.
Create a logger instance for singled threaded ring-0 usage.

Returns:
iprt status code.
Parameters:
pLogger Where to create the logger instance.
cbLogger The amount of memory available for the logger instance.
pfnLogger Pointer to logger wrapper function for the clone.
pfnFlush Pointer to flush function for the clone.
fFlags Logger instance flags for the clone, a combination of the RTLOGFLAGS_* values.
fDestFlags The destination flags.
Destroys a logger instance.

The instance is flushed and all output destinations closed (where applicable).

Returns:
iprt status code.
Parameters:
pLogger The logger instance which close destroyed.
Create a logger instance clone for GC usage.

Returns:
iprt status code.
Parameters:
pLogger The logger instance to be cloned.
pLoggerGC Where to create the GC logger instance.
cbLoggerGC Amount of memory allocated to for the GC logger instance clone.
pfnLoggerGCPtr Pointer to logger wrapper function for this instance (GC Ptr).
pfnFlushGCPtr Pointer to flush function (GC Ptr).
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
Copies the group settings and flags from logger instance to another.

Returns:
IPRT status code.
Parameters:
pDstLogger The destination logger instance.
pSrcLogger The source logger instance. If NULL the default one is used.
fFlagsOr OR mask for the flags.
fFlagsAnd AND mask for the flags.
Updates the group settings for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Updates the flags for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Get the absolute path (no symlinks, no . or .. components), doesn't have to exist.

Returns:
iprt status code.
Parameters:
pszPath The path to resolve.
pszAbsPath Where to store the absolute path.
cchAbsPath Size of the buffer.
Get the absolute path (no symlinks, no . or .. components), assuming the given base path as the current directory. The resulting path doesn't have to exist.

Returns:
iprt status code.
Parameters:
pszBase The base path to act like a current directory. When NULL, the actual cwd is used (i.e. the call is equivalent to RTPathAbs(pszPath, ...).
pszPath The path to resolve.
pszAbsPath Where to store the absolute path.
cchAbsPath Size of the buffer.
Compares two paths.

The comparison takes platform-dependent details into account, such as:

  • On DOS-like platforms, both |\| and |/| separator chars are considered to be equal.
  • On platforms with case-insensitive file systems, mismatching characters are uppercased and compared again.

File system details are currently ignored. This means that you won't get case-insentive compares on unix systems when a path goes into a case-insensitive filesystem like FAT, HPFS, HFS, NTFS, JFS, or similar. For NT, OS/2 and similar you'll won't get case-sensitve compares on a case-sensitive file system.

Parameters:
pszPath1 Path to compare (must be an absolute path).
pszPath2 Path to compare (must be an absolute path).
Returns:
< 0 if the first path less than the second path.

0 if the first path identical to the second path.

> 0 if the first path greater than the second path.

Destroy an event semaphore.

Returns:
iprt status code.
Parameters:
EventSem Handle of the
Signal an event semaphore.

The event semaphore will be signaled and automatically reset after exactly one thread have successfully returned from RTSemEventWait() after waiting/polling on that semaphore.

Returns:
iprt status code.
Parameters:
EventSem The event semaphore to signal.
Wait for the event semaphore to be signaled, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
EventSem The event semaphore to wait on.
cMillies Number of milliseconds to wait.
Wait for the event semaphore to be signaled, return on interruption.

This function will not resume the wait if interrupted.

Returns:
iprt status code.
Parameters:
EventSem The event semaphore to wait on.
cMillies Number of milliseconds to wait.
Create a event multi semaphore.

Returns:
iprt status code.
Parameters:
pEventMultiSem Where to store the event multi semaphore handle.
Destroy an event multi semaphore.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi sempahore to destroy.
Signal an event multi semaphore.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to signal.
Resets an event multi semaphore to non-signaled state.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to reset.
Wait for the event multi semaphore to be signaled, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
EventMultiSem The event multi semaphore to wait on.
cMillies Number of milliseconds to wait.
Wait for the event multi semaphore to be signaled, return on interruption.

This function will not resume the wait if interrupted.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to wait on.
cMillies Number of milliseconds to wait.
Create a mutex semaphore.

Returns:
iprt status code.
Parameters:
pMutexSem Where to store the mutex semaphore handle.
Destroy a mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to destroy.
Request ownership of a mutex semaphore, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
MutexSem The mutex semaphore to request ownership over.
cMillies The number of milliseconds to wait.
Request ownership of a mutex semaphore, return on interruption.

This function will not resume the wait if interrupted.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to request ownership over.
cMillies The number of milliseconds to wait.
Release the ownership of a mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex to release the ownership of. It goes without saying the the calling thread must own it.
Create a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
pMutexSem Where to store the mutex semaphore handle.
Destroy a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to destroy.
Request ownership of a fast mutex semaphore.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to request ownership over.
Release the ownership of a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex to release the ownership of. It goes without saying the the calling thread must own it.
Creates a read/write semaphore.

Returns:
iprt status code.
Parameters:
pRWSem Where to store the handle to the created RW semaphore.
Destroys a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to destroy.
Request read access to a read/write semaphore, resume on interruption

Read requests cannot be nested. A deadlock error will be returned on such attempts.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
RWSem The Read/Write semaphore to request read access to.
cMillies The number of milliseconds to wait.
Request read access to a read/write semaphore, return on interruption

Read requests cannot be nested. A deadlock error will be returned on such attempts.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to request read access to.
cMillies The number of milliseconds to wait.
Release read access to a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write sempahore to release read access to. Goes without saying that caller must have read access to the sem.
Request write access to a read/write semaphore, resume on interruption.

Write requests cannot be nested. If called by the thread currently owning the write lock the function returns an error code indicating deadlock.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
RWSem The Read/Write semaphore to request write access to.
cMillies The number of milliseconds to wait.
Request write access to a read/write semaphore, return on interruption.

Write requests cannot be nested. If called by the thread currently owning the write lock the function returns an error code indicating deadlock.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to request write access to.
cMillies The number of milliseconds to wait.
Release write access to a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write sempahore to release read access to. Goes without saying that caller must have write access to the sem.
Init a Ping-Pong construct.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure which needs initialization.
Destroys a Ping-Pong construct.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure which is to be destroyed. (I.e. put into uninitialized state.)
Signals the pong thread in a ping-pong construct. (I.e. sends ping.) This is called by the ping thread.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure to ping.
Signals the ping thread in a ping-pong construct. (I.e. sends pong.) This is called by the pong thread.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure to pong.
Wait function for the ping thread.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
pPP Pointer to the ping-pong structure to wait on.
cMillies Number of milliseconds to wait.
Wait function for the pong thread.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
pPP Pointer to the ping-pong structure to wait on.
cMillies Number of milliseconds to wait.
Destroys a spinlock created by RTSpinlockCreate().

Returns:
iprt status code.
Parameters:
Spinlock Spinlock returned by RTSpinlockCreate().
Gets the number of code points the string is made up of, excluding the terminator.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcuc Where to store the code point count. This is undefined on failure.
Translate a UTF-8 string into an unicode string (i.e. RTUNICPs), allocating the string buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppUniString Receives pointer to the allocated unicode string. The returned string must be freed using RTUniFree().
Translates pszString from UTF-8 to an array of code points, allocating the result array if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppaCps If cCps is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppusz is NULL or cCps is zero a buffer of at least cCps items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cCps The number of code points in the unicode string. This includes the terminator.
pcCps Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Calculates the length of the string in RTUTF16 items.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcwc Where to store the string length. Optional. This is undefined on failure.
Translate a UTF-8 string into a UTF-16 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppwszString Receives pointer to the allocated UTF-16 string. The returned string must be freed using RTUtf16Free().
Translates pszString from UTF-8 to UTF-16, allocating the result buffer if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppwsz If cwc is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppwsz is NULL or cwc is zero a buffer of at least cwc items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cwc The buffer size in RTUTF16s. This includes the terminator.
pcwc Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
unicode code point.

RTUNICP_INVALID if the encoding is invalid.

Parameters:
ppsz The string.
pCp Where to store the unicode code point.
Formats an integer number according to the parameters.

Returns:
Length of the formatted number.
Parameters:
psz Pointer to output string buffer of sufficient size.
u64Value Value to format.
uiBase Number representation base.
cchWidth Width.
cchPrecision Precision.
fFlags Flags (NTFS_*).
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
args The format argument.
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
... The format argument.
Converts a string representation of a number to a 64-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu8 Where to store the converted number. (optional)
Converts a string representation of a number to a 64-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi8 Where to store the converted number. (optional)
Performs a case insensitive string compare between two UTF-8 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
psz1 First UTF-8 string.
psz2 Second UTF-8 string.
Destroys the string space. The caller supplies a callback which will be called for each of the string nodes in for freeing their memory and other resources.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Enumerates the string space. The caller supplies a callback which will be called for each of the string nodes.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Allocates a new copy of the specified UTF-16 string.

Returns:
iprt status code.
Parameters:
ppwszString Receives pointer of the allocated UTF-16 string. The returned pointer must be freed using RTUtf16Free().
pwszString UTF-16 string to duplicate.
cwcExtra Number of extra RTUTF16 items to allocate.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case sensitive string compare between two UTF-16 strings.

Returns:
< 0 if the first string less than the second string.s

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case insensitive string compare between two UTF-16 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Performs a case insensitive string compare between two UTF-16 strings using the current locale of the process (if applicable).

This differs from RTUtf16ICmp() in that it will try, if a locale with the required data is available, to do a correct case-insensitive compare. It follows that it is more complex and thereby likely to be more expensive.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Translate a UTF-16 string into a UTF-8 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pwszString UTF-16 string to convert.
ppszString Receives pointer of allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
Translates UTF-16 to UTF-8 using buffer provided by the caller or a fittingly sized buffer allocated by the function.

Returns:
iprt status code.
Parameters:
pwszString The UTF-16 string to convert.
cwcString The number of RTUTF16 items to translation from pwszString. The translate will stop when reaching cwcString or the terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppsz If cch is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppsz is NULL or cch is zero a buffer of at least cch chars will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cch The buffer size in chars (the type). This includes the terminator.
pcch Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
iprt status code.
Parameters:
ppwsz Pointer to the string pointer. This will be updated to point to the char following the current code point.
pCp Where to store the code point. RTUNICP_INVALID is stored here on failure.
Remarks:
This is an internal worker for RTUtf16GetCpEx().
Create a new thread.

Returns:
iprt status code.
Parameters:
pThread Where to store the thread handle to the new thread. (optional)
pfnThread The thread function.
pvUser User argument.
cbStack The size of the stack for the new thread. Use 0 for the default stack size.
enmType The thread type. Used for deciding scheduling attributes of the thread.
fFlags Flags of the RTTHREADFLAGS type (ORed together).
pszName Thread name.
Remarks:
When called in Ring-0, this API will create a new kernel thread and not a thread in the context of the calling process.
Changes the type of the specified thread.

Returns:
iprt status code.
Parameters:
Thread The thread which type should be changed.
enmType The new thread type.
Remarks:
In Ring-0 it only works if Thread == RTThreadSelf().
Wait for the thread to terminate, resume on interruption.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
prc Where to store the return code of the thread. Optional.
Wait for the thread to terminate, return on interruption.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
prc Where to store the return code of the thread. Optional.
Sets the name of a thread.

Returns:
iprt status code.
Parameters:
Thread Thread handle of the thread to query the name of.
pszName The thread name.
Signal the user event.

Returns:
iprt status code.
Wait for the user event.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
Wait for the user event, return on interruption.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
Reset the user event.

Returns:
iprt status code.
Parameters:
Thread The thread to reset.
Create a suspended timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
u64NanoInterval The interval between timer ticks specified in nanoseconds if it's a recurring timer. This is rounded to the fit the system timer granularity. For one shot timers, pass 0.
fFlags Timer flags.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerStart, RTTimerStop, RTTimerDestroy, RTTimerGetSystemGranularity
Stops and destroys a running timer.

Returns:
iprt status code.
Parameters:
pTimer Timer to stop and destroy. NULL is ok.
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_ACTIVE if the timer isn't suspended.
Parameters:
pTimer The timer to activate.
u64First The RTTimeSystemNanoTS() for when the timer should start firing. If 0 is specified, the timer will fire ASAP.
See also:
RTTimerStop
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_SUSPENDED if the timer isn't active.
VERR_NOT_SUPPORTED if the IPRT implementation doesn't support stopping a timer.
Parameters:
pTimer The timer to suspend.
See also:
RTTimerStart
Requests a specific system timer granularity.

Successfull calls to this API must be coupled with the exact same number of calls to RTTimerReleaseSystemGranularity() in order to undo any changes made.

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the requested value isn't supported by the host platform or if the host platform doesn't support modifying the system timer granularity.
VERR_PERMISSION_DENIED if the caller doesn't have the necessary privilege to modify the system timer granularity.
Parameters:
u32Request The requested system timer granularity in nanoseconds.
pu32Granted Where to store the granted system granularity. This is the value that should be passed to RTTimerReleaseSystemGranularity(). It is what RTTimerGetSystemGranularity() would return immediately after the change was made.
The value differ from the request in two ways; rounding and scale. Meaning if your request is for 10.000.000 you might be granted 10.000.055 or 1.000.000.
See also:
RTTimerReleaseSystemGranularity, RTTimerGetSystemGranularity
Releases a system timer granularity grant acquired by RTTimerRequestSystemGranularity().

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the host platform doesn't have any way of modifying the system timer granularity.
VERR_WRONG_ORDER if nobody call RTTimerRequestSystemGranularity() with the given grant value.
Parameters:
u32Granted The granted system granularity.
See also:
RTTimerRequestSystemGranularity
Makes null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Checks if UUID is null.

Returns:
true if UUID is null.
Parameters:
pUuid uuid to check.
Compares two UUID values.

Returns:
0 if eq, < 0 or > 0.
Parameters:
pUuid1 First value to compare.
pUuid2 Second value to compare.
Converts binary UUID to its string representation.

Returns:
iprt status code.
Parameters:
pUuid Uuid to convert.
pszString Where to store result string.
cchString pszString buffer length, must be >= RTUUID_STR_LENGTH.
Converts UUID from its string representation to binary format.

Returns:
iprt status code.
Parameters:
pUuid Where to store result Uuid.
pszString String with UUID text data.
Compresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
pvBuf Pointer to buffer containing the bits to compress.
cbBuf Number of bytes to compress.
Finishes the compression. This will flush all data and terminate the compression data stream.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Destroys the compressor instance.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Create a decompressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnIn Callback for producing input for decompression.
Decompresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
pvBuf Where to store the decompressed data.
cbBuf Number of bytes to produce. If pcbWritten is set any number of bytes up to cbBuf might be returned.
pcbWritten Number of bytes actually written to the buffer. If NULL cbBuf number of bytes must be written.
Destroys the decompressor instance.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
Initialize a critical section.

Returns:
iprt status code.
Parameters:
pCritSect Pointer to the critical section structure.
fFlags Flags, any combination of the RTCRITSECT_FLAGS #defines.
Destroys an environment block.

Returns:
IPRT status code.
Parameters:
Env Handle of the environment block.
Creates an environment block and fill it with variables from the given environment array.

Returns:
IPRT status code. Typical error is VERR_NO_MEMORY.
Parameters:
pEnv Where to store the handle of the environment block.
apszEnv Pointer to the NULL-terminated array of environment variables. If NULL, the current process' environment will be cloned.
Makes a null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Destroy a request packet queueu

Returns:
iprt status code.
Parameters:
pReqQueue The request queue.
Process one or more request packets

Returns:
iprt status code.

VERR_TIMEOUT if cMillies was reached without the packet being added.

Parameters:
pReqQueue The request queue.
cMillies Number of milliseconds to wait for a pending request. Use RT_INDEFINITE_WAIT to only wait till one is added.
Initializes the heap.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the heap anchor block on success.
pvMemory Pointer to the heap memory.
cbMemory The size of the heap memory.
Merge two simple heaps into one.

The requiremet is of course that they next two each other memory wise.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the handle to the merged heap on success.
Heap1 Handle to the first heap.
Heap2 Handle to the second heap.
Remarks:
This API isn't implemented yet.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
args Format arguments.
Create a logger instance for singled threaded ring-0 usage.

Returns:
iprt status code.
Parameters:
pLogger Where to create the logger instance.
cbLogger The amount of memory available for the logger instance.
pfnLogger Pointer to logger wrapper function for the clone.
pfnFlush Pointer to flush function for the clone.
fFlags Logger instance flags for the clone, a combination of the RTLOGFLAGS_* values.
fDestFlags The destination flags.
Destroys a logger instance.

The instance is flushed and all output destinations closed (where applicable).

Returns:
iprt status code.
Parameters:
pLogger The logger instance which close destroyed.
Create a logger instance clone for GC usage.

Returns:
iprt status code.
Parameters:
pLogger The logger instance to be cloned.
pLoggerGC Where to create the GC logger instance.
cbLoggerGC Amount of memory allocated to for the GC logger instance clone.
pfnLoggerGCPtr Pointer to logger wrapper function for this instance (GC Ptr).
pfnFlushGCPtr Pointer to flush function (GC Ptr).
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
Copies the group settings and flags from logger instance to another.

Returns:
IPRT status code.
Parameters:
pDstLogger The destination logger instance.
pSrcLogger The source logger instance. If NULL the default one is used.
fFlagsOr OR mask for the flags.
fFlagsAnd AND mask for the flags.
Updates the group settings for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Updates the flags for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Change the page level protection of a memory region.

Returns:
iprt status code.
Parameters:
pv Start of the region. Will be rounded down to nearest page boundary.
cb Size of the region. Will be rounded up to the nearest page boundary.
fProtect The new protection, a combination of the RTMEM_PROT_* defines.
Allocates a new copy of the given UTF-8 string.

Returns:
iprt status code.
Parameters:
ppszString Receives pointer of the allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
pszString UTF-8 string to duplicate.
Gets the number of code points the string is made up of, excluding the terminator.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcuc Where to store the code point count. This is undefined on failure.
Translate a UTF-8 string into an unicode string (i.e. RTUNICPs), allocating the string buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppUniString Receives pointer to the allocated unicode string. The returned string must be freed using RTUniFree().
Translates pszString from UTF-8 to an array of code points, allocating the result array if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppaCps If cCps is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppusz is NULL or cCps is zero a buffer of at least cCps items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cCps The number of code points in the unicode string. This includes the terminator.
pcCps Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Calculates the length of the string in RTUTF16 items.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcwc Where to store the string length. Optional. This is undefined on failure.
Translate a UTF-8 string into a UTF-16 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppwszString Receives pointer to the allocated UTF-16 string. The returned string must be freed using RTUtf16Free().
Translates pszString from UTF-8 to UTF-16, allocating the result buffer if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppwsz If cwc is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppwsz is NULL or cwc is zero a buffer of at least cwc items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cwc The buffer size in RTUTF16s. This includes the terminator.
pcwc Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
unicode code point.

RTUNICP_INVALID if the encoding is invalid.

Parameters:
ppsz The string.
pCp Where to store the unicode code point.
Formats an integer number according to the parameters.

Returns:
Length of the formatted number.
Parameters:
psz Pointer to output string buffer of sufficient size.
u64Value Value to format.
uiBase Number representation base.
cchWidth Width.
cchPrecision Precision.
fFlags Flags (NTFS_*).
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
args The format argument.
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
... The format argument.
Converts a string representation of a number to a 64-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu8 Where to store the converted number. (optional)
Converts a string representation of a number to a 64-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi8 Where to store the converted number. (optional)
Performs a case insensitive string compare between two UTF-8 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
psz1 First UTF-8 string.
psz2 Second UTF-8 string.
Destroys the string space. The caller supplies a callback which will be called for each of the string nodes in for freeing their memory and other resources.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Enumerates the string space. The caller supplies a callback which will be called for each of the string nodes.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Allocates a new copy of the specified UTF-16 string.

Returns:
iprt status code.
Parameters:
ppwszString Receives pointer of the allocated UTF-16 string. The returned pointer must be freed using RTUtf16Free().
pwszString UTF-16 string to duplicate.
cwcExtra Number of extra RTUTF16 items to allocate.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case sensitive string compare between two UTF-16 strings.

Returns:
< 0 if the first string less than the second string.s

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case insensitive string compare between two UTF-16 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Performs a case insensitive string compare between two UTF-16 strings using the current locale of the process (if applicable).

This differs from RTUtf16ICmp() in that it will try, if a locale with the required data is available, to do a correct case-insensitive compare. It follows that it is more complex and thereby likely to be more expensive.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Translate a UTF-16 string into a UTF-8 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pwszString UTF-16 string to convert.
ppszString Receives pointer of allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
Translates UTF-16 to UTF-8 using buffer provided by the caller or a fittingly sized buffer allocated by the function.

Returns:
iprt status code.
Parameters:
pwszString The UTF-16 string to convert.
cwcString The number of RTUTF16 items to translation from pwszString. The translate will stop when reaching cwcString or the terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppsz If cch is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppsz is NULL or cch is zero a buffer of at least cch chars will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cch The buffer size in chars (the type). This includes the terminator.
pcch Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
iprt status code.
Parameters:
ppwsz Pointer to the string pointer. This will be updated to point to the char following the current code point.
pCp Where to store the code point. RTUNICP_INVALID is stored here on failure.
Remarks:
This is an internal worker for RTUtf16GetCpEx().
Create a recurring timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
uMilliesInterval Milliseconds between the timer ticks. This is rounded up to the system granularity.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerDestroy, RTTimerStop
Create a suspended timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
u64NanoInterval The interval between timer ticks specified in nanoseconds if it's a recurring timer. This is rounded to the fit the system timer granularity. For one shot timers, pass 0.
fFlags Timer flags.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerStart, RTTimerStop, RTTimerDestroy, RTTimerGetSystemGranularity
Stops and destroys a running timer.

Returns:
iprt status code.
Parameters:
pTimer Timer to stop and destroy. NULL is ok.
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_ACTIVE if the timer isn't suspended.
Parameters:
pTimer The timer to activate.
u64First The RTTimeSystemNanoTS() for when the timer should start firing. If 0 is specified, the timer will fire ASAP.
See also:
RTTimerStop
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_SUSPENDED if the timer isn't active.
VERR_NOT_SUPPORTED if the IPRT implementation doesn't support stopping a timer.
Parameters:
pTimer The timer to suspend.
See also:
RTTimerStart
Requests a specific system timer granularity.

Successfull calls to this API must be coupled with the exact same number of calls to RTTimerReleaseSystemGranularity() in order to undo any changes made.

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the requested value isn't supported by the host platform or if the host platform doesn't support modifying the system timer granularity.
VERR_PERMISSION_DENIED if the caller doesn't have the necessary privilege to modify the system timer granularity.
Parameters:
u32Request The requested system timer granularity in nanoseconds.
pu32Granted Where to store the granted system granularity. This is the value that should be passed to RTTimerReleaseSystemGranularity(). It is what RTTimerGetSystemGranularity() would return immediately after the change was made.
The value differ from the request in two ways; rounding and scale. Meaning if your request is for 10.000.000 you might be granted 10.000.055 or 1.000.000.
See also:
RTTimerReleaseSystemGranularity, RTTimerGetSystemGranularity
Releases a system timer granularity grant acquired by RTTimerRequestSystemGranularity().

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the host platform doesn't have any way of modifying the system timer granularity.
VERR_WRONG_ORDER if nobody call RTTimerRequestSystemGranularity() with the given grant value.
Parameters:
u32Granted The granted system granularity.
See also:
RTTimerRequestSystemGranularity
Create a compressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnOut Callback for consuming output of compression.
enmType Type of compressor to create.
enmLevel Compression level.
Compresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
pvBuf Pointer to buffer containing the bits to compress.
cbBuf Number of bytes to compress.
Finishes the compression. This will flush all data and terminate the compression data stream.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Destroys the compressor instance.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Create a decompressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnIn Callback for producing input for decompression.
Decompresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
pvBuf Where to store the decompressed data.
cbBuf Number of bytes to produce. If pcbWritten is set any number of bytes up to cbBuf might be returned.
pcbWritten Number of bytes actually written to the buffer. If NULL cbBuf number of bytes must be written.
Destroys the decompressor instance.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
Stub function for non-debug builds.

Initializes the heap.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the heap anchor block on success.
pvMemory Pointer to the heap memory.
cbMemory The size of the heap memory.
Initialize a critical section.

Initialize a critical section.

Returns:
iprt status code.
Parameters:
pCritSect Pointer to the critical section structure.
fFlags Flags, any combination of the RTCRITSECT_FLAGS #defines.
Creates an empty environment block.

Returns:
IPRT status code. Typical error is VERR_NO_MEMORY.
Parameters:
pEnv Where to store the handle of the environment block.
Destroys an environment block.

Returns:
IPRT status code.
Parameters:
Env Handle of the environment block.
Creates an environment block and fill it with variables from the given environment array.

Returns:
IPRT status code. Typical error is VERR_NO_MEMORY.
Parameters:
pEnv Where to store the handle of the environment block.
apszEnv Pointer to the NULL-terminated array of environment variables. If NULL, the current process' environment will be cloned.
Generates a new UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated uuid.
Makes a null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Checks if UUID is null.

Returns:
true if UUID is null.
Parameters:
pUuid uuid to check.
Compares two UUID values.

Returns:
0 if eq, < 0 or > 0.
Parameters:
pUuid1 First value to compare.
pUuid2 Second value to compare.
Gets the address of a named exported symbol.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pszSymbol Symbol name.
ppvValue Where to store the symbol value. Note that this is restricted to the pointer size used on the host!
Loads the image into a buffer provided by the user and applies fixups for the given base address.

Returns:
iprt status code.
Parameters:
hLdrMod The load module handle.
pvBits Where to put the bits. Must be as large as RTLdrSize() suggests.
BaseAddress The base address.
pfnGetImport Callback function for resolving imports one by one.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Create a logger instance, comprehensive version.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Todo:
figure out which headers to include to get this one typedef...
Generates a new UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated uuid.
Makes null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Checks if UUID is null.

Returns:
true if UUID is null.
Parameters:
pUuid uuid to check.
Compares two UUID values.

Returns:
0 if eq, < 0 or > 0.
Parameters:
pUuid1 First value to compare.
pUuid2 Second value to compare.
Create a request packet queueu

Returns:
iprt status code.
Parameters:
pReqQueue The request queue.
Destroy a request packet queueu

Returns:
iprt status code.
Parameters:
pReqQueue The request queue.
Process one or more request packets

Returns:
iprt status code.

VERR_TIMEOUT if cMillies was reached without the packet being added.

Parameters:
pReqQueue The request queue.
cMillies Number of milliseconds to wait for a pending request. Use RT_INDEFINITE_WAIT to only wait till one is added.
Formats an integer number according to the parameters.

Returns:
Length of the formatted number.
Parameters:
psz Pointer to output string buffer of sufficient size.
u64Value Value to format.
uiBase Number representation base.
cchWidth Width.
cchPrecision Precision.
fFlags Flags (NTFS_*).
Iterates thru all nodes in the given tree so the caller can free resources associated with each node.

Returns:
0 on success.

Return code from the callback on failure. The tree might be half destroyed at this point and will not behave correctly when any insert or remove operation is attempted.

Parameters:
ppTree Pointer to the AVL-tree root node pointer.
pfnCallBack Pointer to callback function.
pvParam User parameter passed on to the callback function.
Iterates tru all nodes in the given tree.
Returns:
0 on success. Return from callback on failure.
Parameters:
ppTree Pointer to the AVL-tree root node pointer.
fFromLeft TRUE: Left to right. FALSE: Right to left.
pfnCallBack Pointer to callback function.
pvParam Userparameter passed on to the callback function.
Adopts a non-IPRT thread.

Returns:
IPRT status code.
Parameters:
enmType The thread type.
fFlags The thread flags. RTTHREADFLAGS_WAITABLE is not currently allowed.
pszName The thread name. Optional.
pThread Where to store the thread handle. Optional.
Converts a Darwin HRESULT error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts a Darwin IOReturn error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts a Darwin kern_return_t error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts errno to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode errno code.
Converts a L4 errno to a iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode l4 errno.
Remarks:
L4 only.
Converts NT status code to iprt status code.

Needless to say, this is only available on NT and winXX targets.

Returns:
iprt status code.
Parameters:
lNativeCode NT status code.
Remarks:
Windows only.
Converts OS/2 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode OS/2 error code.
Remarks:
OS/2 only.
Converts Win32 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode Win32 error code.
Remarks:
Windows only.
Converts a Darwin IOReturn error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts a Darwin kern_return_t error to an iprt status code.

Returns:
iprt status code.
Parameters:
iNativeCode errno code.
Remarks:
Darwin only.
Converts errno to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode errno code.
Converts a L4 errno to a iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode l4 errno.
Remarks:
L4 only.
Converts NT status code to iprt status code.

Needless to say, this is only available on NT and winXX targets.

Returns:
iprt status code.
Parameters:
lNativeCode NT status code.
Remarks:
Windows only.
Converts OS/2 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode OS/2 error code.
Remarks:
OS/2 only.
Converts Win32 error code to iprt status code.

Returns:
iprt status code.
Parameters:
uNativeCode Win32 error code.
Remarks:
Windows only.
Merge two simple heaps into one.

The requiremet is of course that they next two each other memory wise.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the handle to the merged heap on success.
Heap1 Handle to the first heap.
Heap2 Handle to the second heap.
Remarks:
This API isn't implemented yet.
Open a binary image file.

Returns:
iprt status code.
Parameters:
pszFilename Image filename.
phLdrMod Where to store the handle to the loader module.
Opens a binary image file using kLdr.

Returns:
iprt status code.
Parameters:
pszFilename Image filename.
phLdrMod Where to store the handle to the loaded module.
Remarks:
Primarily for testing the loader.
Open a binary image from in-memory bits.

Returns:
iprt status code.
Parameters:
pvBits The start of the raw-image.
cbBits The size of the raw-image.
enmBits What to expect from the pvBits.
pszLogName What to call the raw-image when logging. For RTLdrLoad and RTLdrOpen the filename is used for this.
phLdrMod Where to store the handle to the loader module.
Closes a loader module handle.

The handle can be obtained using any of the RTLdrLoad(), RTLdrOpen() and RTLdrOpenBits() functions.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
Gets the address of a named exported symbol.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pszSymbol Symbol name.
ppvValue Where to store the symbol value. Note that this is restricted to the pointer size used on the host!
Gets the address of a named exported symbol.

This function differs from the plain one in that it can deal with both GC and HC address sizes, and that it can calculate the symbol value relative to any given base address.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pvBits Optional pointer to the loaded image. Set this to NULL if no RTLdrGetBits() processed image bits are available. Not supported for RTLdrLoad() images.
BaseAddress Image load address. Not supported for RTLdrLoad() images.
pszSymbol Symbol name.
pValue Where to store the symbol value.
Loads the image into a buffer provided by the user and applies fixups for the given base address.

Returns:
iprt status code.
Parameters:
hLdrMod The load module handle.
pvBits Where to put the bits. Must be as large as RTLdrSize() suggests.
BaseAddress The base address.
pfnGetImport Callback function for resolving imports one by one.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Relocates bits after getting them. Useful for code which moves around a bit.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pvBits Where the image bits are. Must've been passed to RTLdrGetBits().
NewBaseAddress The new base address.
OldBaseAddress The old base address.
pfnGetImport Callback function for resolving imports one by one.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Enumerates all symbols in a module.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
fFlags Flags indicating what to return and such.
pvBits Optional pointer to the loaded image. (RTLDR_ENUM_SYMBOL_FLAGS_*) Set this to NULL if no RTLdrGetBits() processed image bits are available.
BaseAddress Image load address.
pfnCallback Callback function.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
args Format arguments.
Create a logger instance for singled threaded ring-0 usage.

Returns:
iprt status code.
Parameters:
pLogger Where to create the logger instance.
cbLogger The amount of memory available for the logger instance.
pfnLogger Pointer to logger wrapper function for the clone.
pfnFlush Pointer to flush function for the clone.
fFlags Logger instance flags for the clone, a combination of the RTLOGFLAGS_* values.
fDestFlags The destination flags.
Destroys a logger instance.

The instance is flushed and all output destinations closed (where applicable).

Returns:
iprt status code.
Parameters:
pLogger The logger instance which close destroyed.
Create a logger instance clone for GC usage.

Returns:
iprt status code.
Parameters:
pLogger The logger instance to be cloned.
pLoggerGC Where to create the GC logger instance.
cbLoggerGC Amount of memory allocated to for the GC logger instance clone.
pfnLoggerGCPtr Pointer to logger wrapper function for this instance (GC Ptr).
pfnFlushGCPtr Pointer to flush function (GC Ptr).
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
Copies the group settings and flags from logger instance to another.

Returns:
IPRT status code.
Parameters:
pDstLogger The destination logger instance.
pSrcLogger The source logger instance. If NULL the default one is used.
fFlagsOr OR mask for the flags.
fFlagsAnd AND mask for the flags.
Updates the group settings for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Updates the flags for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Get the absolute path (no symlinks, no . or .. components), doesn't have to exist.

Returns:
iprt status code.
Parameters:
pszPath The path to resolve.
pszAbsPath Where to store the absolute path.
cchAbsPath Size of the buffer.
Get the absolute path (no symlinks, no . or .. components), assuming the given base path as the current directory. The resulting path doesn't have to exist.

Returns:
iprt status code.
Parameters:
pszBase The base path to act like a current directory. When NULL, the actual cwd is used (i.e. the call is equivalent to RTPathAbs(pszPath, ...).
pszPath The path to resolve.
pszAbsPath Where to store the absolute path.
cchAbsPath Size of the buffer.
Compares two paths.

The comparison takes platform-dependent details into account, such as:

  • On DOS-like platforms, both |\| and |/| separator chars are considered to be equal.
  • On platforms with case-insensitive file systems, mismatching characters are uppercased and compared again.

File system details are currently ignored. This means that you won't get case-insentive compares on unix systems when a path goes into a case-insensitive filesystem like FAT, HPFS, HFS, NTFS, JFS, or similar. For NT, OS/2 and similar you'll won't get case-sensitve compares on a case-sensitive file system.

Parameters:
pszPath1 Path to compare (must be an absolute path).
pszPath2 Path to compare (must be an absolute path).
Returns:
< 0 if the first path less than the second path.

0 if the first path identical to the second path.

> 0 if the first path greater than the second path.

Destroy an event semaphore.

Returns:
iprt status code.
Parameters:
EventSem Handle of the
Signal an event semaphore.

The event semaphore will be signaled and automatically reset after exactly one thread have successfully returned from RTSemEventWait() after waiting/polling on that semaphore.

Returns:
iprt status code.
Parameters:
EventSem The event semaphore to signal.
Wait for the event semaphore to be signaled, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
EventSem The event semaphore to wait on.
cMillies Number of milliseconds to wait.
Wait for the event semaphore to be signaled, return on interruption.

This function will not resume the wait if interrupted.

Returns:
iprt status code.
Parameters:
EventSem The event semaphore to wait on.
cMillies Number of milliseconds to wait.
Create a event multi semaphore.

Returns:
iprt status code.
Parameters:
pEventMultiSem Where to store the event multi semaphore handle.
Destroy an event multi semaphore.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi sempahore to destroy.
Signal an event multi semaphore.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to signal.
Resets an event multi semaphore to non-signaled state.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to reset.
Wait for the event multi semaphore to be signaled, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
EventMultiSem The event multi semaphore to wait on.
cMillies Number of milliseconds to wait.
Wait for the event multi semaphore to be signaled, return on interruption.

This function will not resume the wait if interrupted.

Returns:
iprt status code.
Parameters:
EventMultiSem The event multi semaphore to wait on.
cMillies Number of milliseconds to wait.
Create a mutex semaphore.

Returns:
iprt status code.
Parameters:
pMutexSem Where to store the mutex semaphore handle.
Destroy a mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to destroy.
Request ownership of a mutex semaphore, resume on interruption.

This function will resume if the wait is interrupted by an async system event (like a unix signal) or similar.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
MutexSem The mutex semaphore to request ownership over.
cMillies The number of milliseconds to wait.
Request ownership of a mutex semaphore, return on interruption.

This function will not resume the wait if interrupted.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to request ownership over.
cMillies The number of milliseconds to wait.
Release the ownership of a mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex to release the ownership of. It goes without saying the the calling thread must own it.
Create a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
pMutexSem Where to store the mutex semaphore handle.
Destroy a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to destroy.
Request ownership of a fast mutex semaphore.

The same thread may request a mutex semaphore multiple times, a nested counter is kept to make sure it's released on the right RTSemMutexRelease() call.

Returns:
iprt status code.
Parameters:
MutexSem The mutex semaphore to request ownership over.
Release the ownership of a fast mutex semaphore.

Returns:
iprt status code.
Parameters:
MutexSem The mutex to release the ownership of. It goes without saying the the calling thread must own it.
Creates a read/write semaphore.

Returns:
iprt status code.
Parameters:
pRWSem Where to store the handle to the created RW semaphore.
Destroys a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to destroy.
Request read access to a read/write semaphore, resume on interruption

Read requests cannot be nested. A deadlock error will be returned on such attempts.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
RWSem The Read/Write semaphore to request read access to.
cMillies The number of milliseconds to wait.
Request read access to a read/write semaphore, return on interruption

Read requests cannot be nested. A deadlock error will be returned on such attempts.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to request read access to.
cMillies The number of milliseconds to wait.
Release read access to a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write sempahore to release read access to. Goes without saying that caller must have read access to the sem.
Request write access to a read/write semaphore, resume on interruption.

Write requests cannot be nested. If called by the thread currently owning the write lock the function returns an error code indicating deadlock.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
RWSem The Read/Write semaphore to request write access to.
cMillies The number of milliseconds to wait.
Request write access to a read/write semaphore, return on interruption.

Write requests cannot be nested. If called by the thread currently owning the write lock the function returns an error code indicating deadlock.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write semaphore to request write access to.
cMillies The number of milliseconds to wait.
Release write access to a read/write semaphore.

Returns:
iprt status code.
Parameters:
RWSem The Read/Write sempahore to release read access to. Goes without saying that caller must have write access to the sem.
Init a Ping-Pong construct.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure which needs initialization.
Destroys a Ping-Pong construct.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure which is to be destroyed. (I.e. put into uninitialized state.)
Signals the pong thread in a ping-pong construct. (I.e. sends ping.) This is called by the ping thread.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure to ping.
Signals the ping thread in a ping-pong construct. (I.e. sends pong.) This is called by the pong thread.

Returns:
iprt status code.
Parameters:
pPP Pointer to the ping-pong structure to pong.
Wait function for the ping thread.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
pPP Pointer to the ping-pong structure to wait on.
cMillies Number of milliseconds to wait.
Wait function for the pong thread.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
pPP Pointer to the ping-pong structure to wait on.
cMillies Number of milliseconds to wait.
Destroys a spinlock created by RTSpinlockCreate().

Returns:
iprt status code.
Parameters:
Spinlock Spinlock returned by RTSpinlockCreate().
Gets the number of code points the string is made up of, excluding the terminator.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcuc Where to store the code point count. This is undefined on failure.
Translate a UTF-8 string into an unicode string (i.e. RTUNICPs), allocating the string buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppUniString Receives pointer to the allocated unicode string. The returned string must be freed using RTUniFree().
Translates pszString from UTF-8 to an array of code points, allocating the result array if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppaCps If cCps is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppusz is NULL or cCps is zero a buffer of at least cCps items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cCps The number of code points in the unicode string. This includes the terminator.
pcCps Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Calculates the length of the string in RTUTF16 items.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcwc Where to store the string length. Optional. This is undefined on failure.
Translate a UTF-8 string into a UTF-16 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppwszString Receives pointer to the allocated UTF-16 string. The returned string must be freed using RTUtf16Free().
Translates pszString from UTF-8 to UTF-16, allocating the result buffer if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppwsz If cwc is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppwsz is NULL or cwc is zero a buffer of at least cwc items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cwc The buffer size in RTUTF16s. This includes the terminator.
pcwc Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
unicode code point.

RTUNICP_INVALID if the encoding is invalid.

Parameters:
ppsz The string.
pCp Where to store the unicode code point.
Formats an integer number according to the parameters.

Returns:
Length of the formatted number.
Parameters:
psz Pointer to output string buffer of sufficient size.
u64Value Value to format.
uiBase Number representation base.
cchWidth Width.
cchPrecision Precision.
fFlags Flags (NTFS_*).
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
args The format argument.
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
... The format argument.
Converts a string representation of a number to a 64-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu8 Where to store the converted number. (optional)
Converts a string representation of a number to a 64-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi8 Where to store the converted number. (optional)
Performs a case insensitive string compare between two UTF-8 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
psz1 First UTF-8 string.
psz2 Second UTF-8 string.
Destroys the string space. The caller supplies a callback which will be called for each of the string nodes in for freeing their memory and other resources.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Enumerates the string space. The caller supplies a callback which will be called for each of the string nodes.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Allocates a new copy of the specified UTF-16 string.

Returns:
iprt status code.
Parameters:
ppwszString Receives pointer of the allocated UTF-16 string. The returned pointer must be freed using RTUtf16Free().
pwszString UTF-16 string to duplicate.
cwcExtra Number of extra RTUTF16 items to allocate.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case sensitive string compare between two UTF-16 strings.

Returns:
< 0 if the first string less than the second string.s

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case insensitive string compare between two UTF-16 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Performs a case insensitive string compare between two UTF-16 strings using the current locale of the process (if applicable).

This differs from RTUtf16ICmp() in that it will try, if a locale with the required data is available, to do a correct case-insensitive compare. It follows that it is more complex and thereby likely to be more expensive.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Translate a UTF-16 string into a UTF-8 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pwszString UTF-16 string to convert.
ppszString Receives pointer of allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
Translates UTF-16 to UTF-8 using buffer provided by the caller or a fittingly sized buffer allocated by the function.

Returns:
iprt status code.
Parameters:
pwszString The UTF-16 string to convert.
cwcString The number of RTUTF16 items to translation from pwszString. The translate will stop when reaching cwcString or the terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppsz If cch is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppsz is NULL or cch is zero a buffer of at least cch chars will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cch The buffer size in chars (the type). This includes the terminator.
pcch Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
iprt status code.
Parameters:
ppwsz Pointer to the string pointer. This will be updated to point to the char following the current code point.
pCp Where to store the code point. RTUNICP_INVALID is stored here on failure.
Remarks:
This is an internal worker for RTUtf16GetCpEx().
Create a new thread.

Returns:
iprt status code.
Parameters:
pThread Where to store the thread handle to the new thread. (optional)
pfnThread The thread function.
pvUser User argument.
cbStack The size of the stack for the new thread. Use 0 for the default stack size.
enmType The thread type. Used for deciding scheduling attributes of the thread.
fFlags Flags of the RTTHREADFLAGS type (ORed together).
pszName Thread name.
Remarks:
When called in Ring-0, this API will create a new kernel thread and not a thread in the context of the calling process.
Changes the type of the specified thread.

Returns:
iprt status code.
Parameters:
Thread The thread which type should be changed.
enmType The new thread type.
Remarks:
In Ring-0 it only works if Thread == RTThreadSelf().
Wait for the thread to terminate, resume on interruption.

Returns:
iprt status code. Will not return VERR_INTERRUPTED.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
prc Where to store the return code of the thread. Optional.
Wait for the thread to terminate, return on interruption.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
prc Where to store the return code of the thread. Optional.
Sets the name of a thread.

Returns:
iprt status code.
Parameters:
Thread Thread handle of the thread to query the name of.
pszName The thread name.
Signal the user event.

Returns:
iprt status code.
Wait for the user event.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
Wait for the user event, return on interruption.

Returns:
iprt status code.
Parameters:
Thread The thread to wait for.
cMillies The number of milliseconds to wait. Use RT_INDEFINITE_WAIT for an indefinite wait.
Reset the user event.

Returns:
iprt status code.
Parameters:
Thread The thread to reset.
Create a suspended timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
u64NanoInterval The interval between timer ticks specified in nanoseconds if it's a recurring timer. This is rounded to the fit the system timer granularity. For one shot timers, pass 0.
fFlags Timer flags.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerStart, RTTimerStop, RTTimerDestroy, RTTimerGetSystemGranularity
Stops and destroys a running timer.

Returns:
iprt status code.
Parameters:
pTimer Timer to stop and destroy. NULL is ok.
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_ACTIVE if the timer isn't suspended.
Parameters:
pTimer The timer to activate.
u64First The RTTimeSystemNanoTS() for when the timer should start firing. If 0 is specified, the timer will fire ASAP.
See also:
RTTimerStop
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_SUSPENDED if the timer isn't active.
VERR_NOT_SUPPORTED if the IPRT implementation doesn't support stopping a timer.
Parameters:
pTimer The timer to suspend.
See also:
RTTimerStart
Requests a specific system timer granularity.

Successfull calls to this API must be coupled with the exact same number of calls to RTTimerReleaseSystemGranularity() in order to undo any changes made.

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the requested value isn't supported by the host platform or if the host platform doesn't support modifying the system timer granularity.
VERR_PERMISSION_DENIED if the caller doesn't have the necessary privilege to modify the system timer granularity.
Parameters:
u32Request The requested system timer granularity in nanoseconds.
pu32Granted Where to store the granted system granularity. This is the value that should be passed to RTTimerReleaseSystemGranularity(). It is what RTTimerGetSystemGranularity() would return immediately after the change was made.
The value differ from the request in two ways; rounding and scale. Meaning if your request is for 10.000.000 you might be granted 10.000.055 or 1.000.000.
See also:
RTTimerReleaseSystemGranularity, RTTimerGetSystemGranularity
Releases a system timer granularity grant acquired by RTTimerRequestSystemGranularity().

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the host platform doesn't have any way of modifying the system timer granularity.
VERR_WRONG_ORDER if nobody call RTTimerRequestSystemGranularity() with the given grant value.
Parameters:
u32Granted The granted system granularity.
See also:
RTTimerRequestSystemGranularity
Makes null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Checks if UUID is null.

Returns:
true if UUID is null.
Parameters:
pUuid uuid to check.
Compares two UUID values.

Returns:
0 if eq, < 0 or > 0.
Parameters:
pUuid1 First value to compare.
pUuid2 Second value to compare.
Converts binary UUID to its string representation.

Returns:
iprt status code.
Parameters:
pUuid Uuid to convert.
pszString Where to store result string.
cchString pszString buffer length, must be >= RTUUID_STR_LENGTH.
Converts UUID from its string representation to binary format.

Returns:
iprt status code.
Parameters:
pUuid Where to store result Uuid.
pszString String with UUID text data.
Compresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
pvBuf Pointer to buffer containing the bits to compress.
cbBuf Number of bytes to compress.
Finishes the compression. This will flush all data and terminate the compression data stream.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Destroys the compressor instance.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Create a decompressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnIn Callback for producing input for decompression.
Decompresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
pvBuf Where to store the decompressed data.
cbBuf Number of bytes to produce. If pcbWritten is set any number of bytes up to cbBuf might be returned.
pcbWritten Number of bytes actually written to the buffer. If NULL cbBuf number of bytes must be written.
Destroys the decompressor instance.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
Initialize a critical section.

Returns:
iprt status code.
Parameters:
pCritSect Pointer to the critical section structure.
fFlags Flags, any combination of the RTCRITSECT_FLAGS #defines.
Destroys an environment block.

Returns:
IPRT status code.
Parameters:
Env Handle of the environment block.
Creates an environment block and fill it with variables from the given environment array.

Returns:
IPRT status code. Typical error is VERR_NO_MEMORY.
Parameters:
pEnv Where to store the handle of the environment block.
apszEnv Pointer to the NULL-terminated array of environment variables. If NULL, the current process' environment will be cloned.
Makes a null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Destroy a request packet queueu

Returns:
iprt status code.
Parameters:
pReqQueue The request queue.
Process one or more request packets

Returns:
iprt status code.

VERR_TIMEOUT if cMillies was reached without the packet being added.

Parameters:
pReqQueue The request queue.
cMillies Number of milliseconds to wait for a pending request. Use RT_INDEFINITE_WAIT to only wait till one is added.
Initializes the heap.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the heap anchor block on success.
pvMemory Pointer to the heap memory.
cbMemory The size of the heap memory.
Merge two simple heaps into one.

The requiremet is of course that they next two each other memory wise.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the handle to the merged heap on success.
Heap1 Handle to the first heap.
Heap2 Handle to the second heap.
Remarks:
This API isn't implemented yet.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Create a logger instance.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
args Format arguments.
Create a logger instance for singled threaded ring-0 usage.

Returns:
iprt status code.
Parameters:
pLogger Where to create the logger instance.
cbLogger The amount of memory available for the logger instance.
pfnLogger Pointer to logger wrapper function for the clone.
pfnFlush Pointer to flush function for the clone.
fFlags Logger instance flags for the clone, a combination of the RTLOGFLAGS_* values.
fDestFlags The destination flags.
Destroys a logger instance.

The instance is flushed and all output destinations closed (where applicable).

Returns:
iprt status code.
Parameters:
pLogger The logger instance which close destroyed.
Create a logger instance clone for GC usage.

Returns:
iprt status code.
Parameters:
pLogger The logger instance to be cloned.
pLoggerGC Where to create the GC logger instance.
cbLoggerGC Amount of memory allocated to for the GC logger instance clone.
pfnLoggerGCPtr Pointer to logger wrapper function for this instance (GC Ptr).
pfnFlushGCPtr Pointer to flush function (GC Ptr).
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
Copies the group settings and flags from logger instance to another.

Returns:
IPRT status code.
Parameters:
pDstLogger The destination logger instance.
pSrcLogger The source logger instance. If NULL the default one is used.
fFlagsOr OR mask for the flags.
fFlagsAnd AND mask for the flags.
Updates the group settings for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Updates the flags for the logger instance using the specified specification string.

Returns:
iprt status code. Failures can safely be ignored.
Parameters:
pLogger Logger instance (NULL for default logger).
pszVar Value to parse.
Change the page level protection of a memory region.

Returns:
iprt status code.
Parameters:
pv Start of the region. Will be rounded down to nearest page boundary.
cb Size of the region. Will be rounded up to the nearest page boundary.
fProtect The new protection, a combination of the RTMEM_PROT_* defines.
Allocates a new copy of the given UTF-8 string.

Returns:
iprt status code.
Parameters:
ppszString Receives pointer of the allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
pszString UTF-8 string to duplicate.
Gets the number of code points the string is made up of, excluding the terminator.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcuc Where to store the code point count. This is undefined on failure.
Translate a UTF-8 string into an unicode string (i.e. RTUNICPs), allocating the string buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppUniString Receives pointer to the allocated unicode string. The returned string must be freed using RTUniFree().
Translates pszString from UTF-8 to an array of code points, allocating the result array if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppaCps If cCps is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppusz is NULL or cCps is zero a buffer of at least cCps items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cCps The number of code points in the unicode string. This includes the terminator.
pcCps Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Calculates the length of the string in RTUTF16 items.

This function will validate the string, and incorrectly encoded UTF-8 strings will be rejected.

Returns:
iprt status code.
Parameters:
psz The string.
cch The max string length. Use RTSTR_MAX to process the entire string.
pcwc Where to store the string length. Optional. This is undefined on failure.
Translate a UTF-8 string into a UTF-16 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
ppwszString Receives pointer to the allocated UTF-16 string. The returned string must be freed using RTUtf16Free().
Translates pszString from UTF-8 to UTF-16, allocating the result buffer if requested.

Returns:
iprt status code.
Parameters:
pszString UTF-8 string to convert.
cchString The maximum size in chars (the type) to convert. The conversion stop when it reaches cchString or the string terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppwsz If cwc is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppwsz is NULL or cwc is zero a buffer of at least cwc items will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cwc The buffer size in RTUTF16s. This includes the terminator.
pcwc Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
unicode code point.

RTUNICP_INVALID if the encoding is invalid.

Parameters:
ppsz The string.
pCp Where to store the unicode code point.
Formats an integer number according to the parameters.

Returns:
Length of the formatted number.
Parameters:
psz Pointer to output string buffer of sufficient size.
u64Value Value to format.
uiBase Number representation base.
cchWidth Width.
cchPrecision Precision.
fFlags Flags (NTFS_*).
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
args The format argument.
Allocating string printf.

Returns:
The length of the string in the returned *ppszBuffer.

-1 on failure.

Parameters:
ppszBuffer Where to store the pointer to the allocated output buffer. The buffer should be freed using RTStrFree(). On failure *ppszBuffer will be set to NULL.
pszFormat The format string.
... The format argument.
Converts a string representation of a number to a 64-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit unsigned number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pu8 Where to store the converted number. (optional)
Converts a string representation of a number to a 64-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi64 Where to store the converted number. (optional)
Converts a string representation of a number to a 32-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi32 Where to store the converted number. (optional)
Converts a string representation of a number to a 16-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi16 Where to store the converted number. (optional)
Converts a string representation of a number to a 8-bit signed number.

Returns:
iprt status code. Warnings are used to indicate conversion problems.
Parameters:
pszValue Pointer to the string value.
ppszNext Where to store the pointer to the first char following the number. (Optional)
uBase The base of the representation used. If 0 the function will look for known prefixes before defaulting to 10.
pi8 Where to store the converted number. (optional)
Performs a case insensitive string compare between two UTF-8 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
psz1 First UTF-8 string.
psz2 Second UTF-8 string.
Destroys the string space. The caller supplies a callback which will be called for each of the string nodes in for freeing their memory and other resources.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Enumerates the string space. The caller supplies a callback which will be called for each of the string nodes.

Returns:
0 or what ever non-zero return value pfnCallback returned when aborting the destruction.
Parameters:
pStrSpace The space to insert it into.
pfnCallback The callback.
pvUser The user argument.
Allocates a new copy of the specified UTF-16 string.

Returns:
iprt status code.
Parameters:
ppwszString Receives pointer of the allocated UTF-16 string. The returned pointer must be freed using RTUtf16Free().
pwszString UTF-16 string to duplicate.
cwcExtra Number of extra RTUTF16 items to allocate.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case sensitive string compare between two UTF-16 strings.

Returns:
< 0 if the first string less than the second string.s

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Remarks:
This function will not make any attempt to validate the encoding.
Performs a case insensitive string compare between two UTF-16 strings.

This is a simplified compare, as only the simplified lower/upper case folding specified by the unicode specs are used. It does not consider character pairs as they are used in some languages, just simple upper & lower case compares.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Performs a case insensitive string compare between two UTF-16 strings using the current locale of the process (if applicable).

This differs from RTUtf16ICmp() in that it will try, if a locale with the required data is available, to do a correct case-insensitive compare. It follows that it is more complex and thereby likely to be more expensive.

Returns:
< 0 if the first string less than the second string.

0 if the first string identical to the second string.

> 0 if the first string greater than the second string.

Parameters:
pwsz1 First UTF-16 string.
pwsz2 Second UTF-16 string.
Translate a UTF-16 string into a UTF-8 allocating the result buffer.

Returns:
iprt status code.
Parameters:
pwszString UTF-16 string to convert.
ppszString Receives pointer of allocated UTF-8 string. The returned pointer must be freed using RTStrFree().
Translates UTF-16 to UTF-8 using buffer provided by the caller or a fittingly sized buffer allocated by the function.

Returns:
iprt status code.
Parameters:
pwszString The UTF-16 string to convert.
cwcString The number of RTUTF16 items to translation from pwszString. The translate will stop when reaching cwcString or the terminator ('\0'). Use RTSTR_MAX to translate the entire string.
ppsz If cch is non-zero, this must either be pointing to pointer to a buffer of the specified size, or pointer to a NULL pointer. If *ppsz is NULL or cch is zero a buffer of at least cch chars will be allocated to hold the translated string. If a buffer was requirest it must be freed using RTUtf16Free().
cch The buffer size in chars (the type). This includes the terminator.
pcch Where to store the length of the translated string. (Optional) This field will be updated even on failure, however the value is only specified for the following two error codes. On VERR_BUFFER_OVERFLOW and VERR_NO_STR_MEMORY it contains the required buffer space.
Get the unicode code point at the given string position.

Returns:
iprt status code.
Parameters:
ppwsz Pointer to the string pointer. This will be updated to point to the char following the current code point.
pCp Where to store the code point. RTUNICP_INVALID is stored here on failure.
Remarks:
This is an internal worker for RTUtf16GetCpEx().
Create a recurring timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
uMilliesInterval Milliseconds between the timer ticks. This is rounded up to the system granularity.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerDestroy, RTTimerStop
Create a suspended timer.

Returns:
iprt status code.
Parameters:
ppTimer Where to store the timer handle.
u64NanoInterval The interval between timer ticks specified in nanoseconds if it's a recurring timer. This is rounded to the fit the system timer granularity. For one shot timers, pass 0.
fFlags Timer flags.
pfnTimer Callback function which shall be scheduled for execution on every timer tick.
pvUser User argument for the callback.
See also:
RTTimerStart, RTTimerStop, RTTimerDestroy, RTTimerGetSystemGranularity
Stops and destroys a running timer.

Returns:
iprt status code.
Parameters:
pTimer Timer to stop and destroy. NULL is ok.
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_ACTIVE if the timer isn't suspended.
Parameters:
pTimer The timer to activate.
u64First The RTTimeSystemNanoTS() for when the timer should start firing. If 0 is specified, the timer will fire ASAP.
See also:
RTTimerStop
Stops an active timer.

Returns:
IPRT status code.
Return values:
VERR_INVALID_HANDLE if pTimer isn't valid.
VERR_TIMER_SUSPENDED if the timer isn't active.
VERR_NOT_SUPPORTED if the IPRT implementation doesn't support stopping a timer.
Parameters:
pTimer The timer to suspend.
See also:
RTTimerStart
Requests a specific system timer granularity.

Successfull calls to this API must be coupled with the exact same number of calls to RTTimerReleaseSystemGranularity() in order to undo any changes made.

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the requested value isn't supported by the host platform or if the host platform doesn't support modifying the system timer granularity.
VERR_PERMISSION_DENIED if the caller doesn't have the necessary privilege to modify the system timer granularity.
Parameters:
u32Request The requested system timer granularity in nanoseconds.
pu32Granted Where to store the granted system granularity. This is the value that should be passed to RTTimerReleaseSystemGranularity(). It is what RTTimerGetSystemGranularity() would return immediately after the change was made.
The value differ from the request in two ways; rounding and scale. Meaning if your request is for 10.000.000 you might be granted 10.000.055 or 1.000.000.
See also:
RTTimerReleaseSystemGranularity, RTTimerGetSystemGranularity
Releases a system timer granularity grant acquired by RTTimerRequestSystemGranularity().

Returns:
IPRT status code.
Return values:
VERR_NOT_SUPPORTED if the host platform doesn't have any way of modifying the system timer granularity.
VERR_WRONG_ORDER if nobody call RTTimerRequestSystemGranularity() with the given grant value.
Parameters:
u32Granted The granted system granularity.
See also:
RTTimerRequestSystemGranularity
Create a compressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnOut Callback for consuming output of compression.
enmType Type of compressor to create.
enmLevel Compression level.
Compresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
pvBuf Pointer to buffer containing the bits to compress.
cbBuf Number of bytes to compress.
Finishes the compression. This will flush all data and terminate the compression data stream.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Destroys the compressor instance.

Returns:
iprt status code.
Parameters:
pZip The compressor instance.
Create a decompressor instance.

Returns:
iprt status code.
Parameters:
ppZip Where to store the instance handle.
pvUser User argument which will be passed on to pfnOut and pfnIn.
pfnIn Callback for producing input for decompression.
Decompresses a chunk of memory.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
pvBuf Where to store the decompressed data.
cbBuf Number of bytes to produce. If pcbWritten is set any number of bytes up to cbBuf might be returned.
pcbWritten Number of bytes actually written to the buffer. If NULL cbBuf number of bytes must be written.
Destroys the decompressor instance.

Returns:
iprt status code.
Parameters:
pZip The decompressor instance.
Stub function for non-debug builds.

Initializes the heap.

Returns:
IPRT status code on success.
Parameters:
pHeap Where to store the heap anchor block on success.
pvMemory Pointer to the heap memory.
cbMemory The size of the heap memory.
Initialize a critical section.

Initialize a critical section.

Returns:
iprt status code.
Parameters:
pCritSect Pointer to the critical section structure.
fFlags Flags, any combination of the RTCRITSECT_FLAGS #defines.
Creates an empty environment block.

Returns:
IPRT status code. Typical error is VERR_NO_MEMORY.
Parameters:
pEnv Where to store the handle of the environment block.
Destroys an environment block.

Returns:
IPRT status code.
Parameters:
Env Handle of the environment block.
Creates an environment block and fill it with variables from the given environment array.

Returns:
IPRT status code. Typical error is VERR_NO_MEMORY.
Parameters:
pEnv Where to store the handle of the environment block.
apszEnv Pointer to the NULL-terminated array of environment variables. If NULL, the current process' environment will be cloned.
Generates a new UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated uuid.
Makes a null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Checks if UUID is null.

Returns:
true if UUID is null.
Parameters:
pUuid uuid to check.
Compares two UUID values.

Returns:
0 if eq, < 0 or > 0.
Parameters:
pUuid1 First value to compare.
pUuid2 Second value to compare.
Gets the address of a named exported symbol.

Returns:
iprt status code.
Parameters:
hLdrMod The loader module handle.
pszSymbol Symbol name.
ppvValue Where to store the symbol value. Note that this is restricted to the pointer size used on the host!
Loads the image into a buffer provided by the user and applies fixups for the given base address.

Returns:
iprt status code.
Parameters:
hLdrMod The load module handle.
pvBits Where to put the bits. Must be as large as RTLdrSize() suggests.
BaseAddress The base address.
pfnGetImport Callback function for resolving imports one by one.
pvUser User argument for the callback.
Remarks:
Not supported for RTLdrLoad() images.
Create a logger instance, comprehensive version.

Returns:
iprt status code.
Parameters:
ppLogger Where to store the logger instance.
fFlags Logger instance flags, a combination of the RTLOGFLAGS_* values.
pszGroupSettings The initial group settings.
pszEnvVarBase Base name for the environment variables for this instance.
cGroups Number of groups in the array.
papszGroups Pointer to array of groups. This must stick around for the life of the logger instance.
fDestFlags The destination flags. RTLOGDEST_FILE is ORed if pszFilenameFmt specified.
pszErrorMsg A buffer which is filled with an error message if something fails. May be NULL.
cchErrorMsg The size of the error message buffer.
pszFilenameFmt Log filename format string. Standard RTStrFormat().
... Format arguments.
Todo:
figure out which headers to include to get this one typedef...
Generates a new UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated uuid.
Makes null UUID value.

Returns:
iprt status code.
Parameters:
pUuid Where to store generated null uuid.
Checks if UUID is null.

Returns:
true if UUID is null.
Parameters:
pUuid uuid to check.
Compares two UUID values.

Returns:
0 if eq, < 0 or > 0.
Parameters:
pUuid1 First value to compare.
pUuid2 Second value to compare.
Create a request packet queueu

Returns:
iprt status code.
Parameters:
pReqQueue The request queue.
Destroy a request packet queueu

Returns:
iprt status code.
Parameters:
pReqQueue The request queue.
Process one or more request packets

Returns:
iprt status code.

VERR_TIMEOUT if cMillies was reached without the packet being added.

Parameters:
pReqQueue The request queue.
cMillies Number of milliseconds to wait for a pending request. Use RT_INDEFINITE_WAIT to only wait till one is added.
Formats an integer number according to the parameters.

Returns:
Length of the formatted number.
Parameters:
psz Pointer to output string buffer of sufficient size.
u64Value Value to format.
uiBase Number representation base.
cchWidth Width.
cchPrecision Precision.
fFlags Flags (NTFS_*).
Iterates thru all nodes in the given tree so the caller can free resources associated with each node.

Returns:
0 on success.

Return code from the callback on failure. The tree might be half destroyed at this point and will not behave correctly when any insert or remove operation is attempted.

Parameters:
ppTree Pointer to the AVL-tree root node pointer.
pfnCallBack Pointer to callback function.
pvParam User parameter passed on to the callback function.
Iterates tru all nodes in the given tree.
Returns:
0 on success. Return from callback on failure.
Parameters:
ppTree Pointer to the AVL-tree root node pointer.
fFromLeft TRUE: Left to right. FALSE: Right to left.
pfnCallBack Pointer to callback function.
pvParam Userparameter passed on to the callback function.
Adopts a non-IPRT thread.

Returns:
IPRT status code.
Parameters:
enmType The thread type.
fFlags The thread flags. RTTHREADFLAGS_WAITABLE is not currently allowed.
pszName The thread name. Optional.
pThread Where to store the thread handle. Optional.

Todo:
r=bird: Is this interruptible or non-interruptible?

Definition at line 114 of file env-generic.cpp.

{
    struct RTENVINTERNAL *pIntEnv = Env;

    if (pIntEnv == NULL)
        return VERR_INVALID_HANDLE;

    for (size_t i = 0; i < pIntEnv->cCount; ++i)
    {
        RTStrFree(pIntEnv->apszEnv[i]);
    }

    RTMemFree(pIntEnv->apszEnv);
    RTMemFree(pIntEnv);
    return VINF_SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index