VirtualBox

Changeset 80827 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Sep 16, 2019 2:04:02 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
133397
Message:

IPRT: Added RTEnvCreateEx and RTEnvCreateChangeRecordEx so flags can be specified when creating custom environments. Defined one flag RTENV_CREATE_F_ALLOW_EQUAL_FIRST_IN_VAR for accomodating windows style environment variables (used for CWD by driver letter). The flag is set by default on windows hosts, however it does not work for the default environment due to CRT limitations.

Location:
trunk/include/iprt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/env.h

    r76585 r80827  
    5353 */
    5454RTDECL(int) RTEnvCreate(PRTENV pEnv);
     55
     56/**
     57 * Creates an empty environment block.
     58 *
     59 * @returns IPRT status code. Typical error is VERR_NO_MEMORY.
     60 *
     61 * @param   phEnv       Where to store the handle of the new environment block.
     62 * @param   fFlags      Zero or more RTENV_CREATE_F_XXX flags.
     63 */
     64RTDECL(int) RTEnvCreateEx(PRTENV phEnv, uint32_t fFlags);
     65
     66/** @name RTENV_CREATE_F_XXX - Flags for RTEnvCreateEx() and RTEnvCreateChangeRecordEx()
     67 * @{ */
     68/** Allow equal ('=') as the first character of a variable name.
     69 * This is useful for compatibility with Windows' handling of CWD on drives, as
     70 * these are stored on the form "=D:=D:\tmp\asdf".   It is only really useful
     71 * for creating environment blocks for processes and such, since the CRT doesn't
     72 * allow us to apply it directly to the process enviornment. */
     73#define RTENV_CREATE_F_ALLOW_EQUAL_FIRST_IN_VAR     RT_BIT_32(0)
     74/** Valid flags.   */
     75#define RTENV_CREATE_F_VALID_MASK                   UINT32_C(0x00000001)
     76/** @} */
    5577
    5678/**
     
    382404
    383405/**
     406 * Extended version of RTEnvCreateChangeRecord that takes flags.
     407 *
     408 * @returns IPRT status code. Typical error is VERR_NO_MEMORY.
     409 *
     410 * @param   phEnv       Where to store the handle of the new environment block.
     411 * @param   fFlags      Zero or more RTENV_CREATE_F_XXX flags.
     412 */
     413RTDECL(int) RTEnvCreateChangeRecordEx(PRTENV phEnv, uint32_t fFlags);
     414
     415/**
    384416 * Checks if @a hEnv is an environment change record.
    385417 *
  • trunk/include/iprt/mangling.h

    r80765 r80827  
    842842# define RTEnvCountEx                                   RT_MANGLER(RTEnvCountEx)
    843843# define RTEnvCreate                                    RT_MANGLER(RTEnvCreate)
     844# define RTEnvCreateEx                                  RT_MANGLER(RTEnvCreateEx)
    844845# define RTEnvCreateChangeRecord                        RT_MANGLER(RTEnvCreateChangeRecord)
     846# define RTEnvCreateChangeRecordEx                      RT_MANGLER(RTEnvCreateChangeRecordEx)
    845847# define RTEnvDestroy                                   RT_MANGLER(RTEnvDestroy)
    846848# define RTEnvDupEx                                     RT_MANGLER(RTEnvDupEx)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette