本文整理汇总了C++中ERR_函数的典型用法代码示例。如果您正苦于以下问题:C++ ERR_函数的具体用法?C++ ERR_怎么用?C++ ERR_使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ERR_函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IrpStub
static NTSTATUS NTAPI
IrpStub(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
NTSTATUS Status = STATUS_NOT_SUPPORTED;
if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO)
{
/* Forward some IRPs to lower device */
switch (IoGetCurrentIrpStackLocation(Irp)->MajorFunction)
{
case IRP_MJ_PNP:
case IRP_MJ_INTERNAL_DEVICE_CONTROL:
return ForwardIrpAndForget(DeviceObject, Irp);
default:
{
ERR_(CLASS_NAME, "Port DO stub for major function 0x%lx\n",
IoGetCurrentIrpStackLocation(Irp)->MajorFunction);
ASSERT(FALSE);
}
}
}
else
{
ERR_(CLASS_NAME, "Class DO stub for major function 0x%lx\n",
IoGetCurrentIrpStackLocation(Irp)->MajorFunction);
ASSERT(FALSE);
}
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}
示例2: nulldrv_CreateWindow
static BOOL CDECL nulldrv_CreateWindow( HWND hwnd )
{
static int warned;
HWND parent = GetAncestor( hwnd, GA_PARENT );
/* HWND_MESSAGE windows don't need a graphics driver */
if (!parent || parent == get_user_thread_info()->msg_window) return TRUE;
if (warned++) return FALSE;
ERR_(winediag)( "Application tried to create a window, but no driver could be loaded.\n" );
if (driver_load_error[0]) ERR_(winediag)( "%s\n", driver_load_error );
return FALSE;
}
示例3: i8042InternalDeviceControl
static NTSTATUS NTAPI
i8042InternalDeviceControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PFDO_DEVICE_EXTENSION DeviceExtension;
ULONG ControlCode;
NTSTATUS Status;
TRACE_(I8042PRT, "i8042InternalDeviceControl(%p %p)\n", DeviceObject, Irp);
DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
switch (DeviceExtension->Type)
{
case Unknown:
{
ControlCode = IoGetCurrentIrpStackLocation(Irp)->Parameters.DeviceIoControl.IoControlCode;
switch (ControlCode)
{
case IOCTL_INTERNAL_KEYBOARD_CONNECT:
Status = i8042KbdInternalDeviceControl(DeviceObject, Irp);
break;
case IOCTL_INTERNAL_MOUSE_CONNECT:
Status = i8042MouInternalDeviceControl(DeviceObject, Irp);
break;
default:
ERR_(I8042PRT, "Unknown IO control code 0x%lx\n", ControlCode);
ASSERT(FALSE);
Status = STATUS_INVALID_DEVICE_REQUEST;
break;
}
break;
}
case Keyboard:
Status = i8042KbdInternalDeviceControl(DeviceObject, Irp);
break;
case Mouse:
Status = i8042MouInternalDeviceControl(DeviceObject, Irp);
break;
default:
ERR_(I8042PRT, "Unknown FDO type %u\n", DeviceExtension->Type);
ASSERT(FALSE);
Status = STATUS_INTERNAL_ERROR;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
break;
}
return Status;
}
示例4: 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;
}
示例5: i8042StartPacket
/*
* This function starts a packet. It must be called with the
* correct DIRQL.
*/
NTSTATUS
i8042StartPacket(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
IN PFDO_DEVICE_EXTENSION FdoDeviceExtension,
IN PUCHAR Bytes,
IN ULONG ByteCount,
IN PIRP Irp)
{
KIRQL Irql;
NTSTATUS Status;
Irql = KeAcquireInterruptSpinLock(DeviceExtension->HighestDIRQLInterrupt);
if (DeviceExtension->Packet.State != Idle)
{
Status = STATUS_DEVICE_BUSY;
goto done;
}
switch (FdoDeviceExtension->Type)
{
case Keyboard: DeviceExtension->PacketPort = 0; break;
case Mouse: DeviceExtension->PacketPort = CTRL_WRITE_MOUSE; break;
default:
ERR_(I8042PRT, "Unknown FDO type %u\n", FdoDeviceExtension->Type);
ASSERT(FALSE);
Status = STATUS_INTERNAL_ERROR;
goto done;
}
DeviceExtension->Packet.Bytes = Bytes;
DeviceExtension->Packet.CurrentByte = 0;
DeviceExtension->Packet.ByteCount = ByteCount;
DeviceExtension->Packet.State = SendingBytes;
DeviceExtension->PacketResult = Status = STATUS_PENDING;
DeviceExtension->CurrentIrp = Irp;
DeviceExtension->CurrentIrpDevice = FdoDeviceExtension->Fdo;
if (!i8042PacketWrite(DeviceExtension))
{
Status = STATUS_IO_TIMEOUT;
DeviceExtension->Packet.State = Idle;
DeviceExtension->PacketResult = STATUS_ABANDONED;
goto done;
}
DeviceExtension->Packet.CurrentByte++;
done:
KeReleaseInterruptSpinLock(DeviceExtension->HighestDIRQLInterrupt, Irql);
if (Status != STATUS_PENDING)
{
DeviceExtension->CurrentIrp = NULL;
DeviceExtension->CurrentIrpDevice = NULL;
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
}
return Status;
}
示例6: ReportEventW
/******************************************************************************
* ReportEventW [[email protected]]
*
* See ReportEventA.
*/
BOOL WINAPI ReportEventW( HANDLE hEventLog, WORD wType, WORD wCategory, DWORD dwEventID,
PSID lpUserSid, WORD wNumStrings, DWORD dwDataSize, LPCWSTR *lpStrings, LPVOID lpRawData )
{
UINT i;
FIXME("(%p,0x%04x,0x%04x,0x%08x,%p,0x%04x,0x%08x,%p,%p): stub\n", hEventLog,
wType, wCategory, dwEventID, lpUserSid, wNumStrings, dwDataSize, lpStrings, lpRawData);
/* partial stub */
if (wNumStrings == 0) return TRUE;
if (!lpStrings) return TRUE;
for (i = 0; i < wNumStrings; i++)
{
switch (wType)
{
case EVENTLOG_SUCCESS:
TRACE_(eventlog)("%s\n", debugstr_w(lpStrings[i]));
break;
case EVENTLOG_ERROR_TYPE:
ERR_(eventlog)("%s\n", debugstr_w(lpStrings[i]));
break;
case EVENTLOG_WARNING_TYPE:
WARN_(eventlog)("%s\n", debugstr_w(lpStrings[i]));
break;
default:
TRACE_(eventlog)("%s\n", debugstr_w(lpStrings[i]));
break;
}
}
return TRUE;
}
示例7: IDirectMusicSegTriggerTrack_IPersistStream_ParseSegTrackList
static HRESULT IDirectMusicSegTriggerTrack_IPersistStream_ParseSegTrackList (LPPERSISTSTREAM iface, DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm) {
/*ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, PersistStreamVtbl, iface);*/
HRESULT hr = E_FAIL;
DMUS_PRIVATE_CHUNK Chunk;
DWORD ListSize[3], ListCount[3];
LARGE_INTEGER liMove; /* used when skipping chunks */
if (pChunk->fccID != DMUS_FOURCC_SEGTRACK_LIST) {
ERR_(dmfile)(": %s chunk should be a SEGTRACK list\n", debugstr_fourcc (pChunk->fccID));
return E_FAIL;
}
ListSize[0] = pChunk->dwSize - sizeof(FOURCC);
ListCount[0] = 0;
do {
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = %d)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case DMUS_FOURCC_SEGTRACK_CHUNK: {
TRACE_(dmfile)(": segment trigger track chunk\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case FOURCC_LIST: {
IStream_Read (pStm, &Chunk.fccID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(Chunk.fccID));
ListSize[1] = Chunk.dwSize - sizeof(FOURCC);
ListCount[1] = 0;
switch (Chunk.fccID) {
case DMUS_FOURCC_SEGMENTS_LIST: {
TRACE_(dmfile)(": SEGMENTS list\n");
hr = IDirectMusicSegTriggerTrack_IPersistStream_ParseSegmentsList (iface, &Chunk, pStm);
if (FAILED(hr)) return hr;
break;
}
default: {
TRACE_(dmfile)(": unknown (skipping)\n");
liMove.QuadPart = Chunk.dwSize - sizeof(FOURCC);
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrelevant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %d < ListSize[0] = %d\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
return S_OK;
}
示例8: error_exit_fn
static void error_exit_fn(j_common_ptr cinfo)
{
char message[JMSG_LENGTH_MAX];
if (ERR_ON(jpeg))
{
cinfo->err->format_message(cinfo, message);
ERR_(jpeg)("%s\n", message);
}
longjmp(*(jmp_buf*)cinfo->client_data, 1);
}
示例9: EnumDisplayDevicesA
/***********************************************************************
* EnumDisplayDevicesA ([email protected])
*/
BOOL WINAPI
EnumDisplayDevicesA (LPCSTR lpDevice, DWORD iDevNum,
LPDISPLAY_DEVICEA lpDisplayDevice, DWORD dwFlags)
{
DISPLAY_DEVICEW DispDev;
LPWSTR pDeviceW = NULL;
BOOL Ret;
TRACE_(system) ("(%s, %ld, %p, 0x%08lx)\n", lpDevice, iDevNum,
lpDisplayDevice, dwFlags);
if (lpDevice)
{
INT Len;
Len = MultiByteToWideChar (CP_ACP, 0, lpDevice, -1, NULL, 0);
pDeviceW = HeapAlloc (GetProcessHeap (), 0, Len * sizeof (WCHAR));
if (!pDeviceW)
{
ERR_(system) ("Out of memory copying lpDevice!\n");
return FALSE;
}
MultiByteToWideChar (CP_ACP, 0, lpDevice, -1, pDeviceW, Len);
}
DispDev.cb = sizeof (DispDev);
Ret = EnumDisplayDevicesW (pDeviceW, iDevNum, &DispDev, dwFlags);
if (pDeviceW)
HeapFree (GetProcessHeap (), 0, pDeviceW);
if (!Ret)
return FALSE;
/* Don't bother checking for lpDisplayDevice != NULL; Windows XP crashes
in that case too */
lpDisplayDevice->StateFlags = DispDev.StateFlags;
WideCharToMultiByte (CP_ACP, 0, DispDev.DeviceName, -1,
lpDisplayDevice->DeviceName,
sizeof (lpDisplayDevice->DeviceName), NULL, NULL);
WideCharToMultiByte (CP_ACP, 0, DispDev.DeviceString, -1,
lpDisplayDevice->DeviceString,
sizeof (lpDisplayDevice->DeviceString), NULL, NULL);
WideCharToMultiByte (CP_ACP, 0, DispDev.DeviceID, -1,
lpDisplayDevice->DeviceID,
sizeof (lpDisplayDevice->DeviceID), NULL, NULL);
WideCharToMultiByte (CP_ACP, 0, DispDev.DeviceKey, -1,
lpDisplayDevice->DeviceKey,
sizeof (lpDisplayDevice->DeviceKey), NULL, NULL);
return TRUE;
}
示例10: IsValidPnpIdString
static BOOLEAN
IsValidPnpIdString(
IN PUCHAR Buffer,
IN ULONG BufferLength)
{
ANSI_STRING String;
/* FIXME: IsValidPnpIdString not implemented */
UNIMPLEMENTED;
String.Length = String.MaximumLength = BufferLength;
String.Buffer = (PCHAR)Buffer;
ERR_(SERENUM, "Buffer %Z\n", &String);
return TRUE;
}
示例11: IrpStub
static NTSTATUS NTAPI
IrpStub(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
NTSTATUS Status = STATUS_NOT_SUPPORTED;
PPORT_DEVICE_EXTENSION DeviceExtension;
DeviceExtension = DeviceObject->DeviceExtension;
if (!DeviceExtension->Common.IsClassDO)
{
/* Forward some IRPs to lower device */
switch (IoGetCurrentIrpStackLocation(Irp)->MajorFunction)
{
case IRP_MJ_POWER:
PoStartNextPowerIrp(Irp);
IoSkipCurrentIrpStackLocation(Irp);
return PoCallDriver(DeviceExtension->LowerDevice, Irp);
default:
{
ERR_(CLASS_NAME, "Port DO stub for major function 0x%lx\n",
IoGetCurrentIrpStackLocation(Irp)->MajorFunction);
ASSERT(FALSE);
}
}
}
else
{
ERR_(CLASS_NAME, "Class DO stub for major function 0x%lx\n",
IoGetCurrentIrpStackLocation(Irp)->MajorFunction);
ASSERT(FALSE);
}
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}
示例12: EnumDisplayDevicesW
/***********************************************************************
* EnumDisplayDevicesW ([email protected])
*/
BOOL WINAPI
EnumDisplayDevicesW (LPCWSTR lpDevice, DWORD iDevNum,
LPDISPLAY_DEVICEW lpDisplayDevice, DWORD dwFlags)
{
TRACE_(system) ("(%s, %ld, %p, 0x%08lx)\n", debugstr_w (lpDevice), iDevNum,
lpDisplayDevice, dwFlags);
if (dwFlags)
FIXME_(system) ("dwFlags 0x%lx is not supported!\n", dwFlags);
/* We only present one device to the application */
if (iDevNum)
return FALSE;
FIXME_(system) ("Real display device and monitor names should be retrieved\n");
/* Don't bother checking for lpDisplayDevice != NULL; Windows XP crashes
in that case too */
if (lpDevice == NULL)
{
strcpyW (lpDisplayDevice->DeviceName, DeviceName);
strcpyW (lpDisplayDevice->DeviceString, DeviceString);
strcpyW (lpDisplayDevice->DeviceID, DeviceID);
strcpyW (lpDisplayDevice->DeviceKey, DeviceKey);
lpDisplayDevice->StateFlags =
DISPLAY_DEVICE_ATTACHED_TO_DESKTOP |
DISPLAY_DEVICE_PRIMARY_DEVICE |
DISPLAY_DEVICE_VGA_COMPATIBLE;
}
else
{
if (strcmpW (lpDevice, DeviceName))
{
ERR_(system) ("Attempted to get non-existant monitor info!\n");
return FALSE;
}
strcpyW (lpDisplayDevice->DeviceName, MDeviceName);
strcpyW (lpDisplayDevice->DeviceString, MDeviceString);
strcpyW (lpDisplayDevice->DeviceID, MDeviceID);
strcpyW (lpDisplayDevice->DeviceKey, MDeviceKey);
lpDisplayDevice->StateFlags =
DISPLAY_DEVICE_ATTACHED_TO_DESKTOP |
DISPLAY_DEVICE_MULTI_DRIVER;
}
return TRUE;
}
示例13: ReportDetectedPnpDevice
static NTSTATUS
ReportDetectedPnpDevice(
IN PUCHAR Buffer,
IN ULONG BufferLength)
{
ANSI_STRING String;
/* FIXME: ReportDetectedPnpDevice not implemented */
UNIMPLEMENTED;
String.Length = String.MaximumLength = BufferLength;
String.Buffer = (PCHAR)Buffer;
ERR_(SERENUM, "Buffer %Z\n", &String);
/* Call ReportDetectedDevice */
return STATUS_SUCCESS;
}
示例14: gnutls_initialize
static BOOL gnutls_initialize(void)
{
int ret;
if (!(libgnutls_handle = wine_dlopen( SONAME_LIBGNUTLS, RTLD_NOW, NULL, 0 )))
{
ERR_(winediag)( "failed to load libgnutls, no support for crypto hashes\n" );
return FALSE;
}
#define LOAD_FUNCPTR(f) \
if (!(p##f = wine_dlsym( libgnutls_handle, #f, NULL, 0 ))) \
{ \
ERR( "failed to load %s\n", #f ); \
goto fail; \
}
LOAD_FUNCPTR(gnutls_global_deinit)
LOAD_FUNCPTR(gnutls_global_init)
LOAD_FUNCPTR(gnutls_global_set_log_function)
LOAD_FUNCPTR(gnutls_global_set_log_level)
LOAD_FUNCPTR(gnutls_hash);
LOAD_FUNCPTR(gnutls_hash_deinit);
LOAD_FUNCPTR(gnutls_hash_init);
LOAD_FUNCPTR(gnutls_perror)
#undef LOAD_FUNCPTR
if ((ret = pgnutls_global_init()) != GNUTLS_E_SUCCESS)
{
pgnutls_perror( ret );
goto fail;
}
if (TRACE_ON( bcrypt ))
{
pgnutls_global_set_log_level( 4 );
pgnutls_global_set_log_function( gnutls_log );
}
return TRUE;
fail:
wine_dlclose( libgnutls_handle, NULL, 0 );
libgnutls_handle = NULL;
return FALSE;
}
示例15: gzClose
/**
* Close compressed stream.
*
* @return 0 - Success
* @return -1 - File system error (not compression error), errno contains error code
*/
static int gzClose(gzFile fd_gz)
{
int res;
res = gzclose(fd_gz);
if (res != Z_OK)
{
if (res == Z_ERRNO)
{
ERR_("Failed to close fd_gz!");
return -1;
}
CRIT_("Failed to close fd_gz (gz error): %s", gzerror(fd_gz, &res));
//exit(EXIT_FAILURE);
return -1;
}
return 0;
}