예제 #1
0
Bool32 CRLControl::CorrectWord(CSTR_rast Beg, CSTR_rast End, uint32_t * pLanguage, char* CorrWord)
{
	Bool32 bRet = FALSE;
	uint32_t wSizeOut;
	int32_t  iOut;

	mcEderator.Init();

	if ( mcEderator.MakeWord(Beg, End, (puchar)pLanguage) )
	{
		if ( CheckED(mcEderator.GetEdPool(), mcEderator.GetEdOutPool(), mcEderator.GetEdPoolSize(), &wSizeOut, &iOut) )
		{
			bRet = mcEderator.ExcludeToVers(wSizeOut, CorrWord);
		}
	}
	return bRet;
}
예제 #2
0
Bool32 CRLControl::CorrectHypWord(CSTR_rast BegF, CSTR_rast EndF, uint32_t * pLanguageF, CSTR_rast BegS, CSTR_rast EndS, uint32_t * pLanguageS, char* CorrWord)
{
	Bool32 bRet = FALSE;
	uint32_t wSizeOut;
	int32_t  iOut;

	mcEderator.Init();

	if ( mcEderator.MakeWord(BegF, EndF, (puchar)pLanguageF) &&
		 mcEderator.AddWord(BegS, EndS, (puchar)pLanguageS)    )
	{
		// Это уже делается в CheckED
		//PumaMemoryToFileDumper Dmp(mcEderator.GetEdPool(), mcEderator.GetEdPoolSize(), "RLingMakeHypWord.ed");

		if ( CheckED(mcEderator.GetEdPool(), mcEderator.GetEdOutPool(), mcEderator.GetEdPoolSize(), &wSizeOut, &iOut) )
		{
			bRet = mcEderator.ExcludeToVers(wSizeOut, CorrWord);
		}
	}
	return bRet;
}
예제 #3
0
NTSTATUS
SrvpValidateStatusFile(
    IN PVOID StatusFileData,
    IN ULONG StatusFileLength,
    OUT PULONG FileOffsetOfInvalidData
    )
{
    NTSTATUS Status;
    IFI ifi;
    IED ied;
    PSH SHRecord;
    PFI FIRecords;
    PED EDRecords;
    PFS FSRecords;
    PFI FIRecord;
    PED EDRecord;
    PFS FSRecord;
    PCHAR EndOfData;

    //
    // Validate the Status File header first
    //

    SHRecord = (PSH)StatusFileData;
    Status = CheckSH( SHRecord );
    if (!NT_SUCCESS( Status )) {
        *FileOffsetOfInvalidData = 0;
        return( Status );
        }

    //
    // Compute pointers to remaining structures in status file
    //

    FIRecords = (PFI)(SHRecord + 1);

    EDRecords = (PED)((PCHAR)FIRecords + (sizeof( FI ) *
                                          SHRecord->ifiMac
                                         )
                     );

    FSRecords = (PFS)((PCHAR)EDRecords + (sizeof( ED ) *
                                          SHRecord->iedMac
                                         )
                     );

    //
    // Calculate the end of file and compare it against the actual file
    // length.  Error if different.
    //

    EndOfData = (PCHAR)FSRecords + (sizeof( FS ) *
                                    SHRecord->ifiMac *
                                    SHRecord->iedMac
                                   );

    if ((ULONG)(EndOfData - (PCHAR)StatusFileData) != StatusFileLength) {
        *FileOffsetOfInvalidData = 0;
        return( (NTSTATUS)((ULONG)STATUS_UNSUCCESSFUL + 0x4000) );
        }

    //
    // Assume success for empty status files.
    //

    Status = STATUS_SUCCESS;

    //
    // Validate each file information records.
    //

    FIRecord = FIRecords;
    for (ifi=0; ifi<SHRecord->ifiMac; ifi++) {
        Status = CheckFI( FIRecord, ifi );
        if (!NT_SUCCESS( Status )) {
            *FileOffsetOfInvalidData = ((PCHAR)FIRecord - (PCHAR)StatusFileData);
            return( Status );
            }

        FIRecord++;
        }

    //
    // Validate each enlisted directory record.
    //

    EDRecord = EDRecords;
    FSRecord = FSRecords;
    for (ied=0; ied<SHRecord->iedMac; ied++) {
        Status = CheckED( EDRecord, ied );
        if (!NT_SUCCESS( Status )) {
            *FileOffsetOfInvalidData = ((PCHAR)EDRecord - (PCHAR)StatusFileData);
            return( Status );
            }

        EDRecord++;
        }

    //
    // Validate set of file status records associated with each enlisted
    // directory record.
    //

    FSRecord = FSRecords;
    for (ied=0; ied<SHRecord->iedMac; ied++) {
        FIRecord = FIRecords;
        for (ifi=0; ifi<SHRecord->ifiMac; ifi++) {
            Status = CheckFS( SHRecord,
                              FIRecord,
                              FSRecord,
                              ied,
                              ifi
                            );
            if (!NT_SUCCESS( Status )) {
                *FileOffsetOfInvalidData = ((PCHAR)FSRecord - (PCHAR)StatusFileData);
                return( Status );
                }

            FSRecord++;
            FIRecord++;
            }
        }

    return( STATUS_SUCCESS );
}