这篇教程C++ ASSERTMSG函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ASSERTMSG函数的典型用法代码示例。如果您正苦于以下问题:C++ ASSERTMSG函数的具体用法?C++ ASSERTMSG怎么用?C++ ASSERTMSG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ASSERTMSG函数的22个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: neoSystemOpenbool neoSystemOpen(const char* szFileName){ TNeoRomHeader header; int rom; u32 bit; ASSERT(g_neo->cpuClockDivide == 2 || g_neo->cpuClockDivide == 3); guiConsoleLogf("Loading %s...", szFileName); guiConsoleDump(); rom = systemOpen(szFileName, false); ASSERTMSG(g_neo->cpuClockDivide == 2 || g_neo->cpuClockDivide == 3, "%d", g_neo->cpuClockDivide); if(rom < 0) { guiConsoleLogf(" -> Failed!"); ASSERT(0); return false; } systemRead(rom, &header, sizeof(TNeoRomHeader)); if(header.magic != NEO_ROM_MAGIC || header.version != NEO_ROM_VERSION || header.sectionCount != NEOROM_COUNT) { systemClose(rom); guiConsoleLogf(" -> invalid rom"); guiConsoleLogf(" -> magic %08X / %08X", header.magic, NEO_ROM_MAGIC); guiConsoleLogf(" -> version %d / %d", header.version, NEO_ROM_VERSION); guiConsoleLogf(" -> section %d / %d", header.sectionCount, NEOROM_COUNT); ASSERT(0); return false; } neoSystemClose(); g_romSize = systemFileSize(rom) - NEO_HEADER_SIZE; g_header = header; g_rom = rom; linearHeapReset(&g_vramHHeap); linearHeapClear(&g_vramHHeap); g_neo->scanline = 0; g_neo->frameCount = 0; g_neo->irqPending = 0; g_neo->paletteBank = 0; g_neo->fixedBank = 0; g_neo->sramProtectCount = 0; g_neo->debug = true; g_neo->irqVectorLatch = false; g_neo->screenDarkLatch = false; g_neo->fixedRomLatch = false; g_neo->sramProtectLatch = false; g_neo->paletteRamLatch = false; g_neo->smaRand = 0x2345; NEOIPC->audioCommandPending = 0; NEOIPC->audioResult = 0; //sram hack gets around watchdog protection check...values taken from GnGeo //added samsho5 variations g_neo->sramProtection = g_header.sramProtection; guiConsoleLogf("Loaded Game: %s", g_header.name); g_neo->spriteCount = g_header.romEntry[NEOROM_SPRITEDATA].size / SPRITE_SIZE; g_neo->spriteMask = 0xffffffff; for(bit = 0x80000000; bit != 0; bit >>= 1) { if((g_neo->spriteCount - 1) & bit) break; g_neo->spriteMask >>= 1; } g_neo->romBankCount = 0; const s32 bankSize = (s32)g_header.romEntry[NEOROM_MAINPROGRAM].size - 1*MB; if(bankSize > 0) { g_neo->romBankCount = bankSize / (1*MB); if(g_neo->romBankCount * 1*MB != bankSize) { g_neo->romBankCount++; guiConsoleLogf(" -> partial rom bank"); } } guiConsoleLogf(" -> sprites: %d", g_neo->spriteCount); guiConsoleLogf(" -> mask: %08X", g_neo->spriteMask); guiConsoleLogf(" -> rom bank(s): %d", g_neo->romBankCount); if(g_neo->sramProtection == -1) { guiConsoleLogf(" -> sramProtection off"); } else { guiConsoleLogf(" -> sramProtection: %08X", g_neo->sramProtection); } guiConsoleDump(); systemRamReset(); cpuInit(); neoMemoryInit(); neoIOInit(); pd4990a_init();//.........这里部分代码省略.........
开发者ID:Leerz,项目名称:NeoDS,代码行数:101,
示例2: ASSERTMSGvoid CDAVCLanSettingsImpl::requestSettingInformationNotification_02A1(const DAVCLanSettings::SettingInformationNotificationType tSettingInformationNotification){ ASSERTMSG ( "mpLogic is 0", 0 != mpLogic ); mpLogic->requestSettingInformationNotification_02A1( tSettingInformationNotification );}
开发者ID:connectivityTester,项目名称:System,代码行数:5,
示例3: DiskReadPartitionTableExNTSTATUSNTAPIDiskReadPartitionTableEx( IN PFUNCTIONAL_DEVICE_EXTENSION Fdo, IN BOOLEAN BypassCache, OUT PDRIVE_LAYOUT_INFORMATION_EX* DriveLayout )/*++Routine Description: This routine will return the current layout information for the disk. If the cached information is still valid then it will be returned, otherwise the layout will be retreived from the kernel and cached for future use. This routine must be called with the partitioning lock held. The partition list which is returned is not guaranteed to remain valid once the lock has been released. Arguments: Fdo - a pointer to the FDO for the disk. DriveLayout - a location to store a pointer to the drive layout information. Return Value: STATUS_SUCCESS if successful or an error status indicating what failed. --*/ { PDISK_DATA diskData = Fdo->CommonExtension.DriverData; NTSTATUS status; PDRIVE_LAYOUT_INFORMATION_EX layoutEx; layoutEx = NULL; if(BypassCache) { diskData->CachedPartitionTableValid = FALSE; DebugPrint((PtCache, "DiskRPTEx: cache bypassed and invalidated for " "FDO %#p/n", Fdo)); } // // If the cached partition table is present then return a copy of it. // if(diskData->CachedPartitionTableValid == TRUE) { ULONG partitionNumber; PDRIVE_LAYOUT_INFORMATION_EX layout = diskData->CachedPartitionTable; // // Clear the partition numbers from the list entries // for(partitionNumber = 0; partitionNumber < layout->PartitionCount; partitionNumber++) { layout->PartitionEntry[partitionNumber].PartitionNumber = 0; } *DriveLayout = diskData->CachedPartitionTable; DebugPrint((PtCache, "DiskRPTEx: cached PT returned (%#p) for " "FDO %#p/n", *DriveLayout, Fdo)); return STATUS_SUCCESS; } ASSERTMSG("DiskReadPartitionTableEx is not using cached partition table", (DiskBreakOnPtInval == FALSE)); // // If there's a cached partition table still around then free it. // if(diskData->CachedPartitionTable) { DebugPrint((PtCache, "DiskRPTEx: cached PT (%#p) freed for FDO %#p/n", diskData->CachedPartitionTable, Fdo)); ExFreePool(diskData->CachedPartitionTable); diskData->CachedPartitionTable = NULL; } // // By default, X86 disables recognition of GPT disks. Instead we // return the protective MBR partition. Use IoReadPartitionTable // to get this. // status = IoReadPartitionTableEx(Fdo->DeviceObject, &layoutEx); if (DiskDisableGpt) { PDRIVE_LAYOUT_INFORMATION layout; if (NT_SUCCESS (status) &&//.........这里部分代码省略.........
开发者ID:hoangduit,项目名称:reactos,代码行数:101,
示例4: HwSetControlNTSTATUSHwSetControl( PMIXER_INFO MixerInfo, ULONG ControlId, ULONG DataLength, PVOID ControlData){ PLOCAL_MIXER_CONTROL_INFO ControlInfo; int i; BOOLEAN Changed; LONG Values[2]; BOOLEAN MixerSetResult; PGLOBAL_DEVICE_INFO pGDI; pGDI = CONTAINING_RECORD(MixerInfo, GLOBAL_DEVICE_INFO, MixerInfo); /* ** Validate control ID */ if (ControlId > MAXCONTROLS) { return STATUS_INVALID_PARAMETER; } /* ** Establish pointers to our structures */ ControlInfo = &pGDI->LocalMixerData.ControlInfo[ControlId]; ASSERTMSG("Set index out of range", ControlInfo->SetIndex < MAXSETTABLECONTROLS || ControlInfo->SetIndex == MIXER_SET_INDEX_INVALID); /* ** Validate data length and values */ switch (DataLength) { case sizeof(LONG): Values[0] = *(PLONG)ControlData; Values[1] = Values[0]; break; case sizeof(LONG) * 2: Values[0] = *(PLONG)ControlData; Values[1] = ((PLONG)ControlData)[1]; break; default: return STATUS_BUFFER_TOO_SMALL; } /* ** Apparently Boolean values can be anything */ if (ControlInfo->Boolean) { Values[0] = (ULONG)!!Values[0]; Values[1] = (ULONG)!!Values[1]; } /* ** Check the item ranges and assign the values. Note that ** this stuff only works for <= 2 channels/items. */ for (i = 0, Changed = FALSE; i < 2; i++) { if (ControlInfo->Signed) { if (Values[i] < (LONG)ControlInfo->Range.Min.s || Values[i] > (LONG)ControlInfo->Range.Max.s) { return STATUS_INVALID_PARAMETER; } else { if ((SHORT)((PLONG)Values)[i] != ControlInfo->Data.v[i].s) { Changed = TRUE; ControlInfo->Data.v[i].s = (SHORT)((PLONG)Values)[i]; } } } else { if ((((PULONG)Values)[i] < (ULONG)ControlInfo->Range.Min.u || ((PULONG)Values)[i] > (ULONG)ControlInfo->Range.Max.u)) { return STATUS_INVALID_PARAMETER; } else { /* ** Do muxes slightly differently so we don't store a big ** array of n - 1 zeros and 1 one */ if (ControlInfo->Mux) { if (Values[i] != (LONG)ControlInfo->Range.Min.s) { /* ** 'On' - only turn ONE on */ if ((USHORT)i != ControlInfo->Data.v[0].u) {//.........这里部分代码省略.........
开发者ID:BillTheBest,项目名称:WinNT4,代码行数:101,
示例5: NICHandleSendInterruptNTSTATUSNICHandleSendInterrupt( __in PFDO_DATA FdoData )/*++Routine Description: Interrupt handler for sending processing. Re-claim the send resources, complete sends and get more to send from the send wait queue. Assumption: Send spinlock has been acquiredArguments: FdoData Pointer to our FdoDataReturn Value: NTSTATUS code--*/{ NTSTATUS status = STATUS_SUCCESS; PMP_TCB pMpTcb;#if DBG LONG i;#endif DebugPrint(TRACE, DBG_WRITE, "---> NICHandleSendInterrupt/n"); // // Any packets being sent? Any packet waiting in the send queue? // if (FdoData->nBusySend == 0 && IsListEmpty(&FdoData->SendQueueHead)) { ASSERT(FdoData->CurrSendHead == FdoData->CurrSendTail); DebugPrint(TRACE, DBG_WRITE, "<--- NICHandleSendInterrupt/n"); return status; } // // Check the first TCB on the send list // while (FdoData->nBusySend > 0) {#if DBG pMpTcb = FdoData->CurrSendHead; for (i = 0; i < FdoData->nBusySend; i++) { pMpTcb = pMpTcb->Next; } if (pMpTcb != FdoData->CurrSendTail) { DebugPrint(ERROR, DBG_WRITE, "nBusySend= %d/n", FdoData->nBusySend); DebugPrint(ERROR, DBG_WRITE, "CurrSendhead= %p/n", FdoData->CurrSendHead); DebugPrint(ERROR, DBG_WRITE, "CurrSendTail= %p/n", FdoData->CurrSendTail); ASSERT(FALSE); }#endif pMpTcb = FdoData->CurrSendHead; // // Is this TCB completed? // if (pMpTcb->HwTcb->TxCbHeader.CbStatus & CB_STATUS_COMPLETE) { // // Check if this is a multicast hw workaround packet // if ((pMpTcb->HwTcb->TxCbHeader.CbCommand & CB_CMD_MASK) != CB_MULTICAST) { MP_FREE_SEND_PACKET(FdoData, pMpTcb, STATUS_SUCCESS); } else { ASSERTMSG("Not sure what to do", FALSE); } } else { break; } } // // If we queued any transmits because we didn't have any TCBs earlier, // dequeue and send those packets now, as long as we have free TCBs. // while (!IsListEmpty(&FdoData->SendQueueHead) && MP_TCB_RESOURCES_AVAIABLE(FdoData)) { PIRP irp; PLIST_ENTRY pEntry; pEntry = RemoveHeadList(&FdoData->SendQueueHead);//.........这里部分代码省略.........
开发者ID:kcrazy,项目名称:winekit,代码行数:101,
示例6: ASSERTMSGString SensorFileSysWalker::getFileOnly( String file ) { int index = file.findLast( '//' ); ASSERTMSG( index >= 0 , "Unexpected: " + file ); return( file.getMid( index + 1 ) );}
开发者ID:AbhishekGhosh,项目名称:Artificial-Human,代码行数:6,
示例7: SoundReportResourceUsage//.........这里部分代码省略......... // // Get the processor affinity and vector // InterruptVector = HalGetInterruptVector(BusType, BusNumber, *InterruptNumber, *InterruptNumber, &InterruptRequestLevel, &Affinity); ResourceList->List[0].PartialResourceList.Count++; Descriptor->Type = CmResourceTypeInterrupt; Descriptor->ShareDisposition = (UCHAR)(InterruptShareDisposition ? CmResourceShareShared : CmResourceShareDeviceExclusive); Descriptor->Flags = InterruptMode == Latched ? CM_RESOURCE_INTERRUPT_LATCHED : CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE; Descriptor->u.Interrupt.Level = *InterruptNumber; Descriptor->u.Interrupt.Vector = InterruptVector; Descriptor->u.Interrupt.Affinity = (ULONG)Affinity; // // Move on to next resource descriptor entry // Descriptor++; } // // Add DMA description if any // if (ARGUMENT_PRESENT(DmaChannel)) { ResourceList->List[0].PartialResourceList.Count++; Descriptor->Type = CmResourceTypeDma; Descriptor->ShareDisposition = CmResourceShareDeviceExclusive; Descriptor->u.Dma.Channel = *DmaChannel; Descriptor->u.Dma.Port = 0; // ??? // // Move on to next resource descriptor entry // Descriptor++; } // // Report our resource usage and detect conflicts // switch (DeviceObject->Type) { case IO_TYPE_DEVICE: Status = IoReportResourceUsage(NULL, DeviceObject->DriverObject, NULL, 0, DeviceObject, ResourceList, (PUCHAR)Descriptor - (PUCHAR)ResourceList, FALSE, &ResourceConflict); break; case IO_TYPE_DRIVER: Status = IoReportResourceUsage(NULL, (PDRIVER_OBJECT)DeviceObject, ResourceList, (PUCHAR)Descriptor - (PUCHAR)ResourceList, NULL, NULL, 0, FALSE, &ResourceConflict); break; default: ASSERTMSG("SoundReportResourceUsage - invalid object", FALSE); } if (ResourceConflict) { dprintf1(("Resource conflict reported")); Status = STATUS_DEVICE_CONFIGURATION_ERROR; } return Status;}
开发者ID:BillTheBest,项目名称:WinNT4,代码行数:101,
示例8: SmpExecuteImageNTSTATUSNTAPISmpExecuteImage(IN PUNICODE_STRING FileName, IN PUNICODE_STRING Directory, IN PUNICODE_STRING CommandLine, IN ULONG MuSessionId, IN ULONG Flags, IN PRTL_USER_PROCESS_INFORMATION ProcessInformation){ PRTL_USER_PROCESS_INFORMATION ProcessInfo; NTSTATUS Status; RTL_USER_PROCESS_INFORMATION LocalProcessInfo; PRTL_USER_PROCESS_PARAMETERS ProcessParameters; /* Use the input process information if we have it, otherwise use local */ ProcessInfo = ProcessInformation; if (!ProcessInfo) ProcessInfo = &LocalProcessInfo; /* Create parameters for the target process */ Status = RtlCreateProcessParameters(&ProcessParameters, FileName, SmpDefaultLibPath.Length ? &SmpDefaultLibPath : NULL, Directory, CommandLine, SmpDefaultEnvironment, NULL, NULL, NULL, 0); if (!NT_SUCCESS(Status)) { /* This is a pretty bad failure. ASSERT on checked builds and exit */ ASSERTMSG("RtlCreateProcessParameters", NT_SUCCESS(Status)); DPRINT1("SMSS: RtlCreateProcessParameters failed for %wZ - Status == %lx/n", FileName, Status); return Status; } /* Set the size field as required */ ProcessInfo->Size = sizeof(RTL_USER_PROCESS_INFORMATION); /* Check if the debug flag was requested */ if (Flags & SMP_DEBUG_FLAG) { /* Write it in the process parameters */ ProcessParameters->DebugFlags = 1; } else { /* Otherwise inherit the flag that was passed to SMSS itself */ ProcessParameters->DebugFlags = SmpDebug; } /* Subsystems get the first 1MB of memory reserved for DOS/IVT purposes */ if (Flags & SMP_SUBSYSTEM_FLAG) { ProcessParameters->Flags |= RTL_USER_PROCESS_PARAMETERS_RESERVE_1MB; } /* And always force NX for anything that SMSS launches */ ProcessParameters->Flags |= RTL_USER_PROCESS_PARAMETERS_NX; /* Now create the process */ Status = RtlCreateUserProcess(FileName, OBJ_CASE_INSENSITIVE, ProcessParameters, NULL, NULL, NULL, FALSE, NULL, NULL, ProcessInfo); RtlDestroyProcessParameters(ProcessParameters); if (!NT_SUCCESS(Status)) { /* If we couldn't create it, fail back to the caller */ DPRINT1("SMSS: Failed load of %wZ - Status == %lx/n", FileName, Status); return Status; } /* Associate a session with this process */ Status = SmpSetProcessMuSessionId(ProcessInfo->ProcessHandle, MuSessionId); /* If the application is deferred (suspended), there's nothing to do */ if (Flags & SMP_DEFERRED_FLAG) return Status; /* Otherwise, get ready to start it, but make sure it's a native app */ if (ProcessInfo->ImageInformation.SubSystemType == IMAGE_SUBSYSTEM_NATIVE) { /* Resume it */ NtResumeThread(ProcessInfo->ThreadHandle, NULL); if (!(Flags & SMP_ASYNC_FLAG)) { /* Block on it unless Async was requested */ NtWaitForSingleObject(ProcessInfo->ThreadHandle, FALSE, NULL); }//.........这里部分代码省略.........
开发者ID:RPG-7,项目名称:reactos,代码行数:101,
示例9: ASSERTMSGBOOL CTileManager::CollisonCheck(VECTOR3* pStart,VECTOR3* pEnd,VECTOR3* pRtCollisonPos,CObject* pObj){ if( pStart->x >= 51200 || pStart->x < 0 || pStart->z >= 51200 || pStart->z < 0 ) { ASSERTMSG(0," C++ ASSERTN函数代码示例 C++ ASSERT2函数代码示例
|