Exemple #1
0
static VOID FsRtlIsDbcsInExpressionTest()
{
    ULONG i;
    for (i = 0; i < sizeof(Tests) / sizeof(Tests[0]); i++)
    {
        BOOLEAN TestResult;
        UNICODE_STRING UExpression;
        UNICODE_STRING UName;
        ANSI_STRING Expression;
        ANSI_STRING Name;

        /* Don't run Tests which are known to assert in checked builds */
        if (KmtIsCheckedBuild && Tests[i].AssertsInChecked)
            continue;

        /* Ignore Tests flagged IgnoreCase==TRUE to avoid duplicated testing */
        if (Tests[i].IgnoreCase)
            continue;

        RtlInitUnicodeString(&UExpression, Tests[i].Expression);
        RtlInitUnicodeString(&UName, Tests[i].Name);

        RtlUnicodeStringToAnsiString(&Expression, &UExpression, TRUE);
        RtlUnicodeStringToAnsiString(&Name, &UName, TRUE);

        TestResult = FsRtlIsDbcsInExpression(&Expression, &Name);

        ok(TestResult == Tests[i].Expected, "FsRtlIsDbcsInExpression(%Z,%Z): Expected %s, got %s\n",
           &Expression, &Name, Tests[i].Expected ? "TRUE" : "FALSE", TestResult ? "TRUE" : "FALSE");

        RtlFreeAnsiString(&Expression);
        RtlFreeAnsiString(&Name);
    }
}
Exemple #2
0
BOOLEAN
FatIsNameInExpression (
    IN PIRP_CONTEXT IrpContext,
    IN OEM_STRING Expression,
    IN OEM_STRING Name
    )

/*++

Routine Description:

    This routine compare a name and an expression and tells the caller if
    the name is equal to or not equal to the expression.  The input name
    cannot contain wildcards, while the expression may contain wildcards.

Arguments:

    Expression - Supplies the input expression to check against
                 The caller must have already upcased the Expression.

    Name - Supplies the input name to check for.  The caller must have
           already upcased the name.

Return Value:

    BOOLEAN - TRUE if Name is an element in the set of strings denoted
        by the input Expression and FALSE otherwise.

--*/

{
    PAGED_CODE();

    //
    //  Call the appropriate FsRtl routine do to the real work
    //

    return FsRtlIsDbcsInExpression( &Expression,
                                    &Name );

    UNREFERENCED_PARAMETER( IrpContext );
}