本文整理汇总了C++中INFO_函数的典型用法代码示例。如果您正苦于以下问题:C++ INFO_函数的具体用法?C++ INFO_怎么用?C++ INFO_使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了INFO_函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: INFO_
size_t MifareSTidSTRCommands::updateBinary(unsigned char blockno, const void* buf, size_t buflen)
{
INFO_("Update binary block {0x%x(%u)} [in] buffer len {%d}", blockno, blockno, buflen);
if ((buflen >= 256) || (!buf))
{
THROW_EXCEPTION_WITH_LOG(std::invalid_argument, "Bad buffer parameter.");
}
if (d_useSKB)
{
INFO_SIMPLE_("Need to use reader memory key storage (SKB) !");
return updateBinaryIndex(d_skbIndex, blockno, buf, buflen);
}
INFO_SIMPLE_(" => Rescanning card to avoid bad authentication");
scanMifare();
INFO_SIMPLE_("Scan done ! Continue to update binary block.");
if (blockno != 0)
{
std::vector<unsigned char> command;
command.push_back(static_cast<unsigned char>(d_lastKeyType));
command.push_back(blockno);
command.insert(command.end(), (unsigned char*)buf, (unsigned char*)buf + buflen);
getSTidSTRReaderCardAdapter()->sendCommand(0x00D2, command);
}
INFO_("Returns final [out] buffer len {%d}", buflen);
return buflen;
}
示例2: VideoPortDDCMonitorHelper
BOOLEAN NTAPI
VideoPortDDCMonitorHelper(
PVOID HwDeviceExtension,
PVOID I2CFunctions,
PUCHAR pEdidBuffer,
ULONG EdidBufferSize
)
{
PDDC_CONTROL ddc = (PDDC_CONTROL)I2CFunctions;
PI2C_CALLBACKS i2c = &ddc->I2CCallbacks;
INT Count, i;
PUCHAR pBuffer = (PUCHAR)pEdidBuffer;
BOOL Ack;
TRACE_(VIDEOPRT, "VideoPortDDCMonitorHelper()\n");
ASSERT_IRQL_LESS_OR_EQUAL(PASSIVE_LEVEL);
if (ddc->Size != sizeof (ddc))
{
WARN_(VIDEOPRT, "ddc->Size != %d (%d)\n", sizeof (ddc), ddc->Size);
return FALSE;
}
/* select eeprom */
if (!I2CStart(HwDeviceExtension, i2c, DDC_EEPROM_ADDRESS | WRITE))
return FALSE;
/* set address */
if (!I2CWrite(HwDeviceExtension, i2c, 0x00))
return FALSE;
/* change into read mode */
if (!I2CRepStart(HwDeviceExtension, i2c, DDC_EEPROM_ADDRESS | READ))
return FALSE;
/* read eeprom */
RtlZeroMemory(pEdidBuffer, EdidBufferSize);
Count = min(128, EdidBufferSize);
for (i = 0; i < Count; i++)
{
Ack = ((i + 1) < Count);
pBuffer[i] = I2CRead(HwDeviceExtension, i2c, Ack);
}
I2CStop(HwDeviceExtension, i2c);
/* check EDID header */
if (pBuffer[0] != 0x00 || pBuffer[1] != 0xff ||
pBuffer[2] != 0xff || pBuffer[3] != 0xff ||
pBuffer[4] != 0xff || pBuffer[5] != 0xff ||
pBuffer[6] != 0xff || pBuffer[7] != 0x00)
{
WARN_(VIDEOPRT, "VideoPortDDCMonitorHelper(): Invalid EDID header!\n");
return FALSE;
}
INFO_(VIDEOPRT, "VideoPortDDCMonitorHelper(): EDID version %d rev. %d\n", pBuffer[18], pBuffer[19]);
INFO_(VIDEOPRT, "VideoPortDDCMonitorHelper() - SUCCESS!\n");
return TRUE;
}
示例3: HwDiskChanged
NTSTATUS NTAPI
HwDiskChanged(PDRIVE_INFO DriveInfo, PBOOLEAN DiskChanged)
/*
* FUNCTION: Detect whether the hardware has sensed a disk change
* ARGUMENTS:
* DriveInfo: pointer to the drive that we are to check
* DiskChanged: boolean that is set with whether or not the controller thinks there has been a disk change
* RETURNS:
* STATUS_SUCCESS if the drive is successfully queried
* NOTES:
* - Does not interrupt.
* - Guessing a bit at the Model30 stuff
*/
{
UCHAR Buffer;
PCONTROLLER_INFO ControllerInfo = (PCONTROLLER_INFO) DriveInfo->ControllerInfo;
Buffer = READ_PORT_UCHAR(ControllerInfo->BaseAddress + DIGITAL_INPUT_REGISTER);
TRACE_(FLOPPY, "HwDiskChanged: read 0x%x from DIR\n", Buffer);
if(ControllerInfo->Model30)
{
if(!(Buffer & DIR_DISKETTE_CHANGE))
{
INFO_(FLOPPY, "HdDiskChanged - Model30 - returning TRUE\n");
*DiskChanged = TRUE;
}
else
{
INFO_(FLOPPY, "HdDiskChanged - Model30 - returning FALSE\n");
*DiskChanged = FALSE;
}
}
else
{
if(Buffer & DIR_DISKETTE_CHANGE)
{
INFO_(FLOPPY, "HdDiskChanged - PS2 - returning TRUE\n");
*DiskChanged = TRUE;
}
else
{
INFO_(FLOPPY, "HdDiskChanged - PS2 - returning FALSE\n");
*DiskChanged = FALSE;
}
}
return STATUS_SUCCESS;
}
示例4: i8042Write
/*
* FUNCTION: Write data to a port, waiting first for it to become ready
*/
BOOLEAN
i8042Write(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
IN PUCHAR addr,
IN UCHAR data)
{
ULONG Counter;
ASSERT(addr);
ASSERT(DeviceExtension->ControlPort != NULL);
Counter = DeviceExtension->Settings.PollingIterations;
while ((KBD_IBF & READ_PORT_UCHAR(DeviceExtension->ControlPort)) &&
(Counter--))
{
KeStallExecutionProcessor(50);
}
if (Counter)
{
WRITE_PORT_UCHAR(addr, data);
INFO_(I8042PRT, "Sent 0x%x to port %p\n", data, addr);
return TRUE;
}
return FALSE;
}
示例5: IntVideoPortSetupTimer
BOOLEAN NTAPI
IntVideoPortSetupTimer(
IN PDEVICE_OBJECT DeviceObject,
IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension)
{
NTSTATUS Status;
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
DeviceExtension = (PVIDEO_PORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
if (DriverExtension->InitializationData.HwTimer != NULL)
{
INFO_(VIDEOPRT, "Initializing timer\n");
Status = IoInitializeTimer(
DeviceObject,
IntVideoPortTimerRoutine,
DeviceExtension);
if (!NT_SUCCESS(Status))
{
ERR_(VIDEOPRT, "IoInitializeTimer failed with status 0x%08x\n", Status);
return FALSE;
}
}
return TRUE;
}
示例6: HwReset
NTSTATUS NTAPI
HwReset(PCONTROLLER_INFO ControllerInfo)
/*
* FUNCTION: Reset the controller
* ARGUMENTS:
* ControllerInfo: controller to reset
* RETURNS:
* STATUS_SUCCESS in all cases
* NOTES:
* - Generates an interrupt that must be serviced four times (one per drive)
*/
{
TRACE_(FLOPPY, "HwReset called\n");
/* Write the reset bit in the DRSR */
WRITE_PORT_UCHAR(ControllerInfo->BaseAddress + DATA_RATE_SELECT_REGISTER, DRSR_SW_RESET);
/* Check for the reset bit in the DOR and set it if necessary (see Intel doc) */
if(!(READ_PORT_UCHAR(ControllerInfo->BaseAddress + DIGITAL_OUTPUT_REGISTER) & DOR_RESET))
{
HwDumpRegisters(ControllerInfo);
INFO_(FLOPPY, "HwReset: Setting Enable bit\n");
WRITE_PORT_UCHAR(ControllerInfo->BaseAddress + DIGITAL_OUTPUT_REGISTER, DOR_DMA_IO_INTERFACE_ENABLE|DOR_RESET);
HwDumpRegisters(ControllerInfo);
if(!(READ_PORT_UCHAR(ControllerInfo->BaseAddress + DIGITAL_OUTPUT_REGISTER) & DOR_RESET))
{
WARN_(FLOPPY, "HwReset: failed to set the DOR enable bit!\n");
HwDumpRegisters(ControllerInfo);
return STATUS_UNSUCCESSFUL;
}
}
return STATUS_SUCCESS;
}
示例7: i8042ReadData
/*
* FUNCTION: Read data from port 0x60
*/
NTSTATUS
i8042ReadData(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
IN UCHAR StatusFlags,
OUT PUCHAR Data)
{
UCHAR PortStatus;
NTSTATUS Status;
Status = i8042ReadStatus(DeviceExtension, &PortStatus);
if (!NT_SUCCESS(Status))
return Status;
// If data is available
if (PortStatus & StatusFlags)
{
*Data = READ_PORT_UCHAR(DeviceExtension->DataPort);
INFO_(I8042PRT, "Read: 0x%02x (status: 0x%x)\n", Data[0], PortStatus);
// If the data is valid (not timeout, not parity error)
if ((PortStatus & KBD_PERR) == 0)
return STATUS_SUCCESS;
}
return STATUS_UNSUCCESSFUL;
}
示例8: HwGetVersion
NTSTATUS NTAPI
HwGetVersion(PCONTROLLER_INFO ControllerInfo)
/*
* FUNCTION: Gets the version of the controller
* ARGUMENTS:
* ControllerInfo: controller to target with the request
* ConfigValue: Configuration value to send to the drive (see header)
* RETURNS:
* Version number returned by the command, or
* 0 on failure
* NOTE:
* - This command doesn't interrupt, so we go right to reading after
* we issue the command
*/
{
UCHAR Buffer;
PAGED_CODE();
if(Send_Byte(ControllerInfo, COMMAND_VERSION) != STATUS_SUCCESS)
{
WARN_(FLOPPY, "HwGetVersion: unable to write fifo\n");
return STATUS_UNSUCCESSFUL;
}
if(Get_Byte(ControllerInfo, &Buffer) != STATUS_SUCCESS)
{
WARN_(FLOPPY, "HwGetVersion: unable to write fifo\n");
return STATUS_UNSUCCESSFUL;
}
INFO_(FLOPPY, "HwGetVersion returning version 0x%x\n", Buffer);
return Buffer;
}
示例9: HwSenseInterruptStatus
NTSTATUS NTAPI
HwSenseInterruptStatus(PCONTROLLER_INFO ControllerInfo)
/*
* FUNCTION: Send a sense interrupt status command to a controller
* ARGUMENTS:
* ControllerInfo: controller to queue the command to
* RETURNS:
* STATUS_SUCCESS if the command is queued successfully
* STATUS_UNSUCCESSFUL if not
*/
{
UCHAR Buffer[2];
int i;
PAGED_CODE();
if(Send_Byte(ControllerInfo, COMMAND_SENSE_INTERRUPT_STATUS) != STATUS_SUCCESS)
{
WARN_(FLOPPY, "HwSenseInterruptStatus: failed to write controller\n");
return STATUS_UNSUCCESSFUL;
}
for(i = 0; i < 2; i++)
{
if(Get_Byte(ControllerInfo, &Buffer[i]) != STATUS_SUCCESS)
{
WARN_(FLOPPY, "HwSenseInterruptStatus: failed to read controller\n");
return STATUS_UNSUCCESSFUL;
}
}
INFO_(FLOPPY, "HwSenseInterruptStatus returned 0x%x 0x%x\n", Buffer[0], Buffer[1]);
return STATUS_SUCCESS;
}
示例10: I2CWrite
static BOOL
I2CWrite(PVOID HwDeviceExtension, PI2C_CALLBACKS i2c, UCHAR Data)
{
UCHAR Bit;
BOOL Ack;
/* transmit data */
for (Bit = (1 << 7); Bit != 0; Bit >>= 1)
{
WRITE_SCL(LOW);
WRITE_SDA((Data & Bit) ? HIGH : LOW);
DELAY_HALF();
WRITE_SCL(HIGH);
DELAY_HALF();
}
/* get ack */
WRITE_SCL(LOW);
WRITE_SDA(HIGH);
DELAY_HALF();
WRITE_SCL(HIGH);
do
{
DELAY_HALF();
}
while (READ_SCL() != HIGH);
Ack = (READ_SDA() == LOW);
DELAY_HALF();
INFO_(VIDEOPRT, "I2CWrite: %s\n", Ack ? "Ack" : "Nak");
return Ack;
}
示例11: IntInt10AllocateBuffer
VP_STATUS NTAPI
IntInt10AllocateBuffer(
IN PVOID Context,
OUT PUSHORT Seg,
OUT PUSHORT Off,
IN OUT PULONG Length)
{
PVOID MemoryAddress;
NTSTATUS Status;
PKPROCESS CallingProcess = (PKPROCESS)PsGetCurrentProcess();
KAPC_STATE ApcState;
TRACE_(VIDEOPRT, "IntInt10AllocateBuffer\n");
IntAttachToCSRSS(&CallingProcess, &ApcState);
MemoryAddress = (PVOID)0x20000;
Status = ZwAllocateVirtualMemory(NtCurrentProcess(), &MemoryAddress, 0,
Length, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
if (!NT_SUCCESS(Status))
{
WARN_(VIDEOPRT, "- ZwAllocateVirtualMemory failed\n");
IntDetachFromCSRSS(&CallingProcess, &ApcState);
return ERROR_NOT_ENOUGH_MEMORY;
}
if (MemoryAddress > (PVOID)(0x100000 - *Length))
{
ZwFreeVirtualMemory(NtCurrentProcess(), &MemoryAddress, Length,
MEM_RELEASE);
WARN_(VIDEOPRT, "- Unacceptable memory allocated\n");
IntDetachFromCSRSS(&CallingProcess, &ApcState);
return ERROR_NOT_ENOUGH_MEMORY;
}
*Seg = (USHORT)((ULONG)MemoryAddress >> 4);
*Off = (USHORT)((ULONG)MemoryAddress & 0xF);
INFO_(VIDEOPRT, "- Segment: %x\n", (ULONG)MemoryAddress >> 4);
INFO_(VIDEOPRT, "- Offset: %x\n", (ULONG)MemoryAddress & 0xF);
INFO_(VIDEOPRT, "- Length: %x\n", *Length);
IntDetachFromCSRSS(&CallingProcess, &ApcState);
return NO_ERROR;
}
示例12: HwReadIdResult
NTSTATUS NTAPI
HwReadIdResult(PCONTROLLER_INFO ControllerInfo,
PUCHAR CurCylinder,
PUCHAR CurHead)
/*
* FUNCTION: Get the result of a read id command
* ARGUMENTS:
* ControllerInfo: controller to query
* CurCylinder: Returns the cylinder that we're at
* CurHead: Returns the head that we're at
* RETURNS:
* STATUS_SUCCESS if the read id was a success
* STATUS_UNSUCCESSFUL otherwise
* NOTES:
* - This function tests the error conditions itself, and boils the
* whole thing down to a single SUCCESS or FAILURE result
* - Called post-interrupt; does not interrupt
* TODO
* - perhaps handle more status
*/
{
UCHAR Buffer[7] = {0,0,0,0,0,0,0};
int i;
PAGED_CODE();
for(i = 0; i < 7; i++)
if(Get_Byte(ControllerInfo, &Buffer[i]) != STATUS_SUCCESS)
{
WARN_(FLOPPY, "ReadIdResult(): can't read from the controller\n");
return STATUS_UNSUCCESSFUL;
}
/* Validate that it did what we told it to */
INFO_(FLOPPY, "ReadId results: 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n", Buffer[0], Buffer[1], Buffer[2], Buffer[3],
Buffer[4], Buffer[5], Buffer[6]);
/* Last command successful? */
if((Buffer[0] & SR0_LAST_COMMAND_STATUS) != SR0_LCS_SUCCESS)
{
WARN_(FLOPPY, "ReadId didn't return last command success\n");
return STATUS_UNSUCCESSFUL;
}
/* ID mark found? */
if(Buffer[1] & SR1_CANNOT_FIND_ID_ADDRESS)
{
WARN_(FLOPPY, "ReadId didn't find an address mark\n");
return STATUS_UNSUCCESSFUL;
}
if(CurCylinder)
*CurCylinder = Buffer[3];
if(CurHead)
*CurHead = Buffer[4];
return STATUS_SUCCESS;
}
示例13: INFO_SIMPLE_
void IdOnDemandReaderUnitConfiguration::unSerialize(boost::property_tree::ptree& node)
{
INFO_SIMPLE_("Unserializing reader unit configuration...");
d_authCode = node.get_child("AuthenticateCode").get_value<std::string>();
INFO_("Authenticate Code unSerialized {%s}", d_authCode.c_str());
}
示例14: i8042KbdDpcRoutine
static VOID NTAPI
i8042KbdDpcRoutine(
IN PKDPC Dpc,
IN PVOID DeferredContext,
IN PVOID SystemArgument1,
IN PVOID SystemArgument2)
{
PI8042_KEYBOARD_EXTENSION DeviceExtension;
PPORT_DEVICE_EXTENSION PortDeviceExtension;
ULONG KeysTransferred = 0;
ULONG KeysInBufferCopy;
KIRQL Irql;
UNREFERENCED_PARAMETER(Dpc);
UNREFERENCED_PARAMETER(SystemArgument1);
UNREFERENCED_PARAMETER(SystemArgument2);
__analysis_assume(DeferredContext != NULL);
DeviceExtension = DeferredContext;
PortDeviceExtension = DeviceExtension->Common.PortDeviceExtension;
if (HandlePowerKeys(DeviceExtension))
{
DeviceExtension->KeyComplete = FALSE;
return;
}
i8042PacketDpc(PortDeviceExtension);
if (!DeviceExtension->KeyComplete)
return;
/* We got the interrupt as it was being enabled, too bad */
if (!PortDeviceExtension->HighestDIRQLInterrupt)
return;
Irql = KeAcquireInterruptSpinLock(PortDeviceExtension->HighestDIRQLInterrupt);
DeviceExtension->KeyComplete = FALSE;
KeysInBufferCopy = DeviceExtension->KeysInBuffer;
KeReleaseInterruptSpinLock(PortDeviceExtension->HighestDIRQLInterrupt, Irql);
TRACE_(I8042PRT, "Send a key\n");
if (!DeviceExtension->KeyboardData.ClassService)
return;
INFO_(I8042PRT, "Sending %lu key(s)\n", KeysInBufferCopy);
(*(PSERVICE_CALLBACK_ROUTINE)DeviceExtension->KeyboardData.ClassService)(
DeviceExtension->KeyboardData.ClassDeviceObject,
DeviceExtension->KeyboardBuffer,
DeviceExtension->KeyboardBuffer + KeysInBufferCopy,
&KeysTransferred);
KeAcquireInterruptSpinLock(PortDeviceExtension->HighestDIRQLInterrupt);
DeviceExtension->KeysInBuffer -= KeysTransferred;
KeReleaseInterruptSpinLock(PortDeviceExtension->HighestDIRQLInterrupt, Irql);
}
示例15: INFO_
void TcpDataTransport::disconnect()
{
if (d_socket)
{
INFO_("Disconnected.");
d_socket->close();
d_socket.reset();
}
}