本文整理汇总了C++中dprintf1函数的典型用法代码示例。如果您正苦于以下问题:C++ dprintf1函数的具体用法?C++ dprintf1怎么用?C++ dprintf1使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dprintf1函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dprintf1
JNIEXPORT jlong JNICALL Java_sun_security_pkcs11_Secmod_nssLoadLibrary
(JNIEnv *env, jclass thisClass, jstring jName)
{
HINSTANCE hModule;
LPVOID lpMsgBuf;
const char *libName = (*env)->GetStringUTFChars(env, jName, NULL);
dprintf1("-lib %s\n", libName);
hModule = LoadLibrary(libName);
(*env)->ReleaseStringUTFChars(env, jName, libName);
if (hModule == NULL) {
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
0, /* Default language */
(LPTSTR) &lpMsgBuf,
0,
NULL
);
dprintf1("-error: %s\n", lpMsgBuf);
JNU_ThrowIOException(env, (char*)lpMsgBuf);
LocalFree(lpMsgBuf);
return 0;
}
dprintf2("-handle: %d (0X%X)\n", hModule, hModule);
return (jlong)hModule;
}
示例2: test7
static int
test7(gs_state * pgs, gs_memory_t * mem)
{
/* Define a non-monotonic 4 x 4 halftone with 4 gray levels. */
static const byte masks[1 * 4 * 4] =
{
/* 0% */
0x00, 0x00, 0x00, 0x00,
/* 25% */
0x80, 0x40, 0x20, 0x10,
/* 50% */
0xa0, 0xa0, 0x50, 0x50,
/* 75% */
0xd0, 0xe0, 0x70, 0xb0
};
gs_ht *pht;
int code;
int i;
/* Fabricate a Type 5 halftone. */
code = gs_ht_build(&pht, 1, mem);
dprintf1("ht build code = %d\n", code);
code = gs_ht_set_mask_comp(pht, 0,
4, 4, 4, masks, NULL, NULL);
dprintf1("set mask code = %d\n", code);
code = gs_sethalftone(pgs, pht);
dprintf1("sethalftone code = %d\n", code);
for (i = 0; i <= 4; ++i) {
gs_setgray(pgs, i / 4.0);
fill_rect1(pgs, 100 + i * 100, 100, 50, 50);
}
return 0;
}
示例3: dprintf1
JNIEXPORT jobjectArray JNICALL Java_sun_security_smartcardio_PCSC_SCardListReaders
(JNIEnv *env, jclass thisClass, jlong jContext)
{
SCARDCONTEXT context = (SCARDCONTEXT)jContext;
LONG rv;
LPTSTR mszReaders = NULL;
DWORD size = 0;
jobjectArray result;
dprintf1("-context: %x\n", context);
rv = CALL_SCardListReaders(context, NULL, NULL, &size);
if (handleRV(env, rv)) {
return NULL;
}
dprintf1("-size: %d\n", size);
if (size) {
mszReaders = malloc(size);
if (mszReaders == NULL) {
throwOutOfMemoryError(env, NULL);
return NULL;
}
rv = CALL_SCardListReaders(context, NULL, mszReaders, &size);
if (handleRV(env, rv)) {
free(mszReaders);
return NULL;
}
dprintf1("-String: %s\n", mszReaders);
}
result = pcsc_multi2jstring(env, mszReaders);
free(mszReaders);
return result;
}
示例4: trace_drawing_color
static void
trace_drawing_color(const char *prefix, const gx_drawing_color *pdcolor)
{
dprintf1("%scolor=", prefix);
if (pdcolor->type == gx_dc_type_none)
dputs("none");
else if (pdcolor->type == gx_dc_type_null)
dputs("null");
else if (pdcolor->type == gx_dc_type_pure)
dprintf1("0x%lx", (ulong)pdcolor->colors.pure);
else if (pdcolor->type == gx_dc_type_ht_binary) {
int ci = pdcolor->colors.binary.b_index;
dprintf5("binary(0x%lx, 0x%lx, %d/%d, index=%d)",
(ulong)pdcolor->colors.binary.color[0],
(ulong)pdcolor->colors.binary.color[1],
pdcolor->colors.binary.b_level,
(ci < 0 ? pdcolor->colors.binary.b_ht->order.num_bits :
pdcolor->colors.binary.b_ht->components[ci].corder.num_bits),
ci);
} else if (pdcolor->type == gx_dc_type_ht_colored) {
ulong plane_mask = pdcolor->colors.colored.plane_mask;
int ci;
dprintf1("colored(mask=%lu", plane_mask);
for (ci = 0; plane_mask != 0; ++ci, plane_mask >>= 1)
if (plane_mask & 1) {
dprintf2(", (base=%u, level=%u)",
pdcolor->colors.colored.c_base[ci],
pdcolor->colors.colored.c_level[ci]);
} else
dputs(", -");
} else {
示例5: vbi_proxy_msg_finish_connect
/* ----------------------------------------------------------------------------
** Check for the result of the connect syscall
** - UNIX: called when select() indicates writability
** - Win32: called when select() indicates writablility (successful connected)
** or an exception (connect failed)
*/
vbi_bool vbi_proxy_msg_finish_connect( int sock_fd, char ** ppErrorText )
{
vbi_bool result = FALSE;
int sockerr;
socklen_t sockerrlen;
sockerrlen = sizeof(sockerr);
if (getsockopt(sock_fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr, &sockerrlen) == 0)
{
if (sockerr == 0)
{ /* success -> send the first message of the startup protocol to the server */
dprintf2("finish_connect: socket connect succeeded\n");
result = TRUE;
}
else
{ /* failed to establish a connection to the server */
dprintf1("finish_connect: socket connect failed: %s\n", strerror(sockerr));
asprintf(ppErrorText, _("Cannot connect to server: %s."),
strerror(sockerr));
}
}
else
{
dprintf1("finish_connect: getsockopt: %s\n", strerror(errno));
asprintf(ppErrorText, _("Socket I/O error: %s."),
strerror(errno));
}
return result;
}
示例6: gslt_alloc_print_leaks
void
gslt_alloc_print_leaks(void)
{
dprintf1("number of allocs: %d\n", num_alloc_called);
dprintf1("number of frees: %d\n", num_free_called);
dprintf1("number of resizes: %d\n", num_resize_called);
dprintf1("number of leaked chunks: %d\n", num_alloc_called - num_free_called);
}
示例7: debug_dump_bytes
/* Dump a region of memory */
void
debug_dump_bytes(const byte *from, const byte *to, const char *msg)
{ const byte *p = from;
if ( from < to && msg )
dprintf1("%s:\n", msg);
while ( p != to )
{ const byte *q = min(p + 16, to);
dprintf1("%lx:", (ulong)p);
while ( p != q ) dprintf1(" %02x", *p++);
dputc('\n');
}
}
示例8: SynthPortValid
NTSTATUS
SynthPortValid(
IN OUT PGLOBAL_SYNTH_INFO pGDI,
IN ULONG Port,
IN volatile BOOLEAN * Fired
)
{
NTSTATUS Status;
//
// Check we're going to be allowed to use this port or whether
// some other device thinks it owns this hardware
//
Status = SoundReportResourceUsage(
pGDI->DeviceObject,
pGDI->BusType,
pGDI->BusNumber,
NULL,
0,
FALSE,
NULL,
&Port,
NUMBER_OF_SYNTH_PORTS);
if (!NT_SUCCESS(Status)) {
return Status;
}
//
// Find where our device is mapped
//
pGDI->Hw.SynthBase = SoundMapPortAddress(
pGDI->BusType,
pGDI->BusNumber,
Port,
NUMBER_OF_SYNTH_PORTS,
&pGDI->MemType);
{
PUCHAR base;
base = pGDI->Hw.SynthBase;
if (!SynthPresent(base, base, Fired)) {
dprintf1(("No synthesizer present"));
//
// Unmap the memory
//
SynthCleanup(pGDI);
return STATUS_DEVICE_CONFIGURATION_ERROR;
}
}
return STATUS_SUCCESS;
}
示例9: debug_print_packed_ref
void
debug_print_packed_ref(const ref_packed *pref)
{ ushort elt = *pref;
ref nref;
switch ( elt >> packed_type_shift )
{
case pt_executable_operator:
dprintf("<op_name>");
elt &= packed_int_mask;
op_index_ref(elt, &nref);
debug_print_ref(&nref);
break;
case pt_integer:
dprintf1("<int> %d", (int)(elt & packed_int_mask) + packed_min_intval);
break;
case pt_literal_name: case pt_literal_name+1:
dprintf("<lit_name>"); elt &= packed_max_name_index; goto ptn;
case pt_executable_name: case pt_executable_name+1:
dprintf("<exec_name>"); elt &= packed_max_name_index;
ptn: name_index_ref(elt, &nref);
dprintf2("(0x%lx#%x)", (ulong)nref.value.pname, elt);
debug_print_name(&nref);
break;
}
}
示例10: SoundSetVersion
/*****************************************************************************
NOT USED ANYMORE
Routine Description :
Sets a version DWORD into the registry as a pseudo return code
to sndblst.drv
As a side effect the key to the registry entry is closed.
Arguments :
pGlobalInfo - Our driver global info
DSPVersion - the version number we want to set
Return Value :
None
*****************************************************************************/
VOID SoundSetVersion( IN PGLOBAL_DEVICE_INFO pGlobalInfo,
IN ULONG DSPVersion )
{
/***** Local Variables *****/
UNICODE_STRING VersionString;
/***** Start *****/
RtlInitUnicodeString(&VersionString,
L"DSP Version");
if ( pGlobalInfo->RegistryPathName )
{
NTSTATUS SetStatus;
SetStatus = SoundWriteRegistryDWORD( pGlobalInfo->RegistryPathName,
L"DSP Version",
DSPVersion );
if (!NT_SUCCESS(SetStatus))
{
dprintf1(("ERROR: SoundSetVersion(): Failed to write version - status %XH", SetStatus));
}
} // End IF (pGlobalInfo->RegistryPathName)
}
示例11: SoundInitInterrupt
/*****************************************************************************
SoundInitInterrupt()
*****************************************************************************/
NTSTATUS SoundInitInterrupt( IN OUT PGLOBAL_DEVICE_INFO pGDI,
IN OUT PULONG Interrupt )
{
/***** Local Variables *****/
NTSTATUS Status;
/***** Start *****/
dprintf4(("SoundInitInterrupt(): Start"));
//
// See if we can get this interrupt
//
Status = SoundConnectInterrupt(*Interrupt,
pGDI->BusType,
pGDI->BusNumber,
SoundISR,
(PVOID)pGDI,
INTERRUPT_MODE,
IRQ_SHARABLE,
&pGDI->WaveInfo.Interrupt );
if (!NT_SUCCESS(Status))
{
dprintf1(("ERROR: SoundInitInterrupt(): SoundConnectInterrupt() Failed with Status = %XH",
Status));
return Status;
} // End IF (!NT_SUCCESS(Status))
return STATUS_SUCCESS;
} // End SoundInitInterrupt()
示例12: GenerateInterrupt
void GenerateInterrupt(void)
{
/*
* Generate 1 interrupt on the master controller
* (how do devices normally 'detect' the hardware? and
* how can this VDD find a spare interrupt to 'install'
* the device?).
*/
if (/*InterruptAcknowleged*/TRUE) {
/*
* Set to FALSE FIRST to avoid race conditions
*/
InterruptAcknowleged = FALSE;
dprintf2(("Generating interrupt"));
VDDSimulateInterrupt(ICA_MASTER, SB_INTERRUPT, 1);
} else {
dprintf1(("Missed interrupt !"));
}
/*
* Set the status to see if more apps will work
*/
WriteStatus = 0xFF;
}
示例13: journalResetore
int journalResetore(u32 device)
{ // copys apa headers from apal to apa system
int i;
u32 sector;
apa_cache *clink;
dprintf1("ps2hdd: checking log...\n");
if(atadDmaTransfer(device, &journalBuf, APA_SECTOR_APAL, sizeof(apa_journal_t)/512, ATAD_MODE_READ)){
journalReset(device);
return -EIO;
}
if(journalBuf.magic==APAL_MAGIC)
{
if(journalBuf.num==0)
return 0;
clink=cacheGetFree();
for(i=0, sector=APA_SECTOR_APAL_HEADERS;i<journalBuf.num;i++, sector+=2)
{
if(atadDmaTransfer(device, clink->header, sector, 2, ATAD_MODE_READ))
break;
if(atadDmaTransfer(device, clink->header, journalBuf.sectors[i], 2, ATAD_MODE_WRITE))
break;
}
cacheAdd(clink);
return journalReset(device);// only do if journal..
}
memset(&journalBuf, 0, sizeof(apa_journal_t));// safe e
journalBuf.magic=APAL_MAGIC;
return 0;//-EINVAL;
}
示例14: ss_handleUNC
/* UNC handling
*
* client can pass us a SSREQ_UNC: this contains both a password and a server
* name (in the form \\server\share). We make a connection to it here and
* remember the connection so that we can remove it (in ss_cleanconnections)
* when the client session terminates.
*
* We are passed the head of a FNAMELIST in which we should store the connect
* name for later cleanup. We return the new head of this list.
*
* the client will send this request if a unc-style named scan fails
* with the SSRESP_BADPASS error.
*/
PFNAMELIST
ss_handleUNC( HANDLE hpipe, long lVersion
, LPSTR password, LPSTR server, PFNAMELIST connects)
{
NETRESOURCE resource;
int errorcode;
resource.lpRemoteName = server;
resource.lpLocalName = NULL;
resource.dwType = RESOURCETYPE_DISK;
resource.lpProvider = NULL;
errorcode = (int)WNetAddConnection2(&resource, password, NULL, 0);
if (errorcode == NO_ERROR) {
/* remember the connection name */
connects = ss_addtolist(connects, server);
/* report success */
ss_sendnewresp( hpipe, lVersion, SSRESP_END
, 0, 0, 0, 0, NULL);
} else {
Log_Write(hlogErrors, "Connect error %d for server %s", GetLastError(), server);
dprintf1(("connect error %d for server %s\n", GetLastError(), server));
/* report error */
ss_sendnewresp( hpipe, lVersion, SSRESP_ERROR
, 0, 0, 0, 0, NULL);
}
return(connects);
} /* ss_handleUNC */
示例15: EnqueueName
/* Attempt to Queue.Put Path onto Queue as a FILEDETAILS
with default values for all other fields.
Return TRUE or FALSE according as it succeeded.
*/
STATIC BOOL EnqueueName(QUEUE Queue, LPSTR Path, UINT BuffLen)
{
FILEDETAILS fd;
/* unpack Path and LocalName from "superstring" */
strcpy(fd.Path, Path);
BuffLen -= (strlen(Path)+1);
if (BuffLen<0) return FALSE; // Uh oh! strlen just looked at garbage.
Path += strlen(Path)+1;
BuffLen -= (strlen(Path)+1);
if (BuffLen<0) return FALSE; // Uh oh! strlen just looked at garbage.
strcpy(fd.LocalName, Path);
/* set defaults for every field */
fd.ErrorCode = 0;
fd.ft_lastwrite.dwLowDateTime = 0;
fd.ft_lastwrite.dwHighDateTime = 0;
fd.ft_create.dwLowDateTime = 0;
fd.ft_create.dwHighDateTime = 0;
fd.ft_lastaccess.dwLowDateTime = 0;
fd.ft_lastaccess.dwHighDateTime = 0;
fd.fileattribs = 0;
fd.SizeHi = 0;
fd.SizeLo = 0;
fd.Checksum = 0;
fd.TempName[0] = '\0';
if(!Queue_Put(Queue, (LPBYTE)&fd, sizeof(fd))){
dprintf1(("Put to pack queue failed\n"));
return FALSE;
}
return TRUE;
} /* EnqueueName */