test: jzcrap.c Source File

Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

# jzcrap.c

Go to the documentation of this file.

    00001 #include "precomp.h"
    00002 #pragma hdrstop
    00003
    00004 VOID
    00005 JzDeleteVariableSegment (
    00006     PCHAR VariableName,
    00007     ULONG Selection
    00008     )
    00009 {
    00010     PCHAR Variable;
    00011     CHAR VariableValue[MAXIMUM_ENVIRONMENT_VALUE];
    00012     ULONG Index;
    00013     ULONG Count;
    00014     BOOLEAN FirstSegment;
    00015
    00016     if ((Variable = ArcGetEnvironmentVariable(VariableName)) == NULL) {
    00017         return;
    00018     }
    00019
    00020     FirstSegment = TRUE;
    00021     Index = 0;
    00022     *VariableValue = 0;
    00023     while (strchr(Variable,';') != NULL) {
    00024         Count = strchr(Variable,';') - Variable;
    00025         if (Index != Selection) {
    00026             if (!FirstSegment) {
    00027                 strcat(VariableValue,";");
    00028             }
    00029             strncat(VariableValue, Variable, Count);
    00030             FirstSegment = FALSE;
    00031         }
    00032         Variable += Count + 1;
    00033         Index++;
    00034     }
    00035
    00036     if (Index != Selection) {
    00037         if (!FirstSegment) {
    00038             strcat(VariableValue,";");
    00039         }
    00040         strcat(VariableValue,Variable);
    00041     }
    00042
    00043     ArcSetEnvironmentVariable(VariableName, VariableValue);
    00044     return;
    00045 }
    00046
    00047 PCHAR BootString[] = { "LOADIDENTIFIER",
    00048                        "SYSTEMPARTITION",
    00049                        "OSLOADER",
    00050                        "OSLOADPARTITION",
    00051                        "OSLOADFILENAME",
    00052                        "OSLOADOPTIONS" };