本文整理汇总了C++中deb函数的典型用法代码示例。如果您正苦于以下问题:C++ deb函数的具体用法?C++ deb怎么用?C++ deb使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了deb函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: fast_select
int fast_select(SOCKET Socket,WORD timeout)
{
fd_set fds;
struct timeval tm;
int dwResult;
memset(&tm, 0x0,sizeof(tm));
tm.tv_sec = 0;
tm.tv_usec = timeout;
FD_ZERO(&fds);
FD_SET(Socket, &fds);
if ( (dwResult = select(Socket + 1, &fds, &fds, NULL, &tm)) > 0)
{
if(FD_ISSET(Socket,&fds))
return SUCCESS;
}
if(dwResult == SOCKET_ERROR)
{
deb("in fast_select(): WSA : %d\n",WSAGetLastError());
return SOCKET_ERROR;
}
return 1;
}
开发者ID:kilitary,项目名称:ss,代码行数:26,代码来源:socket.cpp
示例2: OsDefaultBrowser
void OsDefaultBrowser(void)
{
HKEY hKey=0,hKey2=0;
BOOL installed=false;
char data[128]="IE";
DWORD dwret;
DWORD dwDataSiz=sizeof(data);
__try
{
dwret = RegOpenKeyEx(HKEY_CURRENT_USER,
"Software\\Clients\\StartMenuInternet",
0, KEY_READ, &hKey);
if(dwret != ERROR_SUCCESS)
__leave;
RegGetValue(hKey, NULL, NULL, RRF_RT_REG_SZ,
0, &data, &dwDataSiz);
}
__finally
{
deb("def browser: %s", data);
if(hKey)
RegCloseKey(hKey);
}
}
开发者ID:kilitary,项目名称:zerofox,代码行数:25,代码来源:info.cpp
示例3: m920x_rc_core_query
static int m920x_rc_core_query(struct dvb_usb_device *d)
{
int ret = 0;
u8 *rc_state;
int state;
rc_state = kmalloc(2, GFP_KERNEL);
if (!rc_state)
return -ENOMEM;
if ((ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_STATE, &rc_state[0], 1)) != 0)
goto out;
if ((ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_KEY, &rc_state[1], 1)) != 0)
goto out;
deb("state=0x%02x keycode=0x%02x\n", rc_state[0], rc_state[1]);
m920x_parse_rc_state(d, rc_state[0], &state);
if (state == REMOTE_NO_KEY_PRESSED)
rc_keyup(d->rc_dev);
else if (state == REMOTE_KEY_REPEAT)
rc_repeat(d->rc_dev);
else
rc_keydown(d->rc_dev, RC_PROTO_UNKNOWN, rc_state[1], 0);
out:
kfree(rc_state);
return ret;
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:31,代码来源:m920x.c
示例4: mye_GetWindowDC
extern "C" HWND __stdcall mye_GetWindowDC(int where, int width, int height)
{
char buf[1024];
HDC hdc=0;
HWND hwnd;
DWORD dwRead;
buf[0]=LO_GETWINDOWHANDLE;
buf[1]=0x0;
unsigned long ret2 = CallNamedPipeA("\\\\.\\pipe\\ReqForm", buf, 2, &hwnd, sizeof(hwnd), &dwRead, 0);
if (!ret2)
deb("mye_GetWindowDC CallNamedPipe: %s", fmterr());
deb("read hwnd: %x dwRead:%u hdc %x",hwnd,dwRead,hdc);
return hwnd;
}
开发者ID:kilitary,项目名称:mye,代码行数:16,代码来源:mye.cpp
示例5: m920x_mt352_demod_init
/* demod configurations */
static int m920x_mt352_demod_init(struct dvb_frontend *fe)
{
int ret;
u8 config[] = { CONFIG, 0x3d };
u8 clock[] = { CLOCK_CTL, 0x30 };
u8 reset[] = { RESET, 0x80 };
u8 adc_ctl[] = { ADC_CTL_1, 0x40 };
u8 agc[] = { AGC_TARGET, 0x1c, 0x20 };
u8 sec_agc[] = { 0x69, 0x00, 0xff, 0xff, 0x40, 0xff, 0x00, 0x40, 0x40 };
u8 unk1[] = { 0x93, 0x1a };
u8 unk2[] = { 0xb5, 0x7a };
deb("Demod init!\n");
if ((ret = mt352_write(fe, config, ARRAY_SIZE(config))) != 0)
return ret;
if ((ret = mt352_write(fe, clock, ARRAY_SIZE(clock))) != 0)
return ret;
if ((ret = mt352_write(fe, reset, ARRAY_SIZE(reset))) != 0)
return ret;
if ((ret = mt352_write(fe, adc_ctl, ARRAY_SIZE(adc_ctl))) != 0)
return ret;
if ((ret = mt352_write(fe, agc, ARRAY_SIZE(agc))) != 0)
return ret;
if ((ret = mt352_write(fe, sec_agc, ARRAY_SIZE(sec_agc))) != 0)
return ret;
if ((ret = mt352_write(fe, unk1, ARRAY_SIZE(unk1))) != 0)
return ret;
if ((ret = mt352_write(fe, unk2, ARRAY_SIZE(unk2))) != 0)
return ret;
return 0;
}
开发者ID:OpenStbV4l-dvb,项目名称:v4l-dvb,代码行数:34,代码来源:m920x.c
示例6: hfree
void hfree(void *p)
{
//deb("hfree: memory at 0x%x ", p);
if(!HeapFree(GetProcessHeap(), 0, p)) {
deb("hfree:heapfree: %s", FORMATERROR);
}
}
开发者ID:kilitary,项目名称:bscs_bot,代码行数:7,代码来源:memory.cpp
示例7: m920x_init
static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq)
{
int ret, i, epi, flags = 0;
int adap_enabled[M9206_MAX_ADAPTERS] = { 0 };
/* Remote controller init. */
if (d->props.rc.legacy.rc_query || d->props.rc.core.rc_query) {
deb("Initialising remote control\n");
ret = m920x_write_seq(d->udev, M9206_CORE, rc_seq);
if (ret != 0) {
deb("Initialising remote control failed\n");
return ret;
}
deb("Initialising remote control success\n");
}
for (i = 0; i < d->props.num_adapters; i++)
flags |= d->adapter[i].props.fe[0].caps;
/* Some devices(Dposh) might crash if we attempt touch at all. */
if (flags & DVB_USB_ADAP_HAS_PID_FILTER) {
for (i = 0; i < d->props.num_adapters; i++) {
epi = d->adapter[i].props.fe[0].stream.endpoint - 0x81;
if (epi < 0 || epi >= M9206_MAX_ADAPTERS) {
printk(KERN_INFO "m920x: Unexpected adapter endpoint!\n");
return -EINVAL;
}
adap_enabled[epi] = 1;
}
for (i = 0; i < M9206_MAX_ADAPTERS; i++) {
if (adap_enabled[i])
continue;
if ((ret = m920x_set_filter(d, 0x81 + i, 0, 0x0)) != 0)
return ret;
if ((ret = m920x_set_filter(d, 0x81 + i, 0, 0x02f5)) != 0)
return ret;
}
}
return 0;
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:47,代码来源:m920x.c
示例8: OsListNetbios
void OsListNetbios(void)
{
DWORD cb = 0;
PROTOCOL_INFO *pPI;
BOOL pfLanas[100];
int iRes,
nLanas = sizeof(pfLanas) / sizeof(BOOL);
// Specify NULL for lpiProtocols to enumerate all protocols.
// First, determine the output buffer size.
iRes = EnumProtocols( NULL, NULL, &cb );
// Verify that the expected error was received.
assert( iRes == -1 && GetLastError() == ERROR_INSUFFICIENT_BUFFER );
if (!cb) {
deb( "No available NetBIOS transports.\n");
return;
}
// Allocate a buffer of the specified size.
pPI = (PROTOCOL_INFO*) malloc( cb );
// Enumerate all protocols.
iRes = EnumProtocols( NULL, pPI, &cb );
// EnumProtocols() lists each lana number twice, once for
// SOCK_DGRAM and once for SOCK_SEQPACKET. Set a flag in pfLanas
// so unique lanas can be identified.
memset( pfLanas, 0, sizeof( pfLanas ));
while (iRes > 0)
{
// Scan protocols looking for AF_NETBIOS.
if ( pPI[--iRes].iAddressFamily == AF_NETBIOS )
// Found one.
pfLanas[ abs(pPI[iRes].iProtocol) ] = TRUE;
}
while( nLanas-- )
if ( pfLanas[nLanas] )
deb( "NetBIOS[%d:%d] ", nLanas,pfLanas[nLanas] );
free( pPI );
}
开发者ID:kilitary,项目名称:zerofox,代码行数:47,代码来源:info.cpp
示例9: OsListProcesses
int OsListProcesses( void )
{
DWORD aProcesses[1024], cbNeeded, cProcesses, mcbNeeded;
unsigned int i;
HMODULE hMods[1024];
HANDLE hProcess;
char szModName[MAX_PATH];
if ( !EnumProcesses( aProcesses, sizeof(aProcesses), &cbNeeded ) )
{
deb("failed enumprocesses: %s", strerror(NULL));
return NULL;
}
cProcesses = cbNeeded / sizeof(DWORD);
deb("%d procs",cProcesses);
for ( i = 0; i < cProcesses; i++ )
{
hProcess = OpenProcess( PROCESS_QUERY_INFORMATION |
PROCESS_VM_READ,
FALSE, aProcesses[i] );
if (NULL == hProcess || !EnumProcessModules(hProcess, hMods,
sizeof(hMods), &mcbNeeded))
continue;
if ( GetModuleFileNameExA( hProcess, hMods[0],
szModName, sizeof(szModName)))
{
//_strlwr(szModName);
deb("- %4d %p %s ", aProcesses[i], hMods[0], szModName);
//if(strstr(szModName, pattern)) {
// deb("found %s: %s (0x%08X)\n", pattern, szModName, hMods[0] );
// return aProcesses[i];
//}
}
CloseHandle( hProcess );
}
return NULL;
}
开发者ID:kilitary,项目名称:zerofox,代码行数:44,代码来源:info.cpp
示例10: checksumfile
/* ********************************************************************************* */
int checksumfile(char *fname)
{
HANDLE hFile;
DWORD dwSize, dwRead, i;
char *buffer, *byte;
u_int csum = 0;
deb("calculating checksum for %s", fname);
hFile = CreateFile(fname,
GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
if (hFile == INVALID_HANDLE_VALUE) {
deb("CreateFile: %s", FORMATERROR);
return -1;
}
dwSize = GetFileSize(hFile, 0);
buffer = (char*) HeapAlloc(GetProcessHeap(), 0 , dwSize);
if(buffer == NULL) {
deb("Failed to alloc %d bytes: %s", dwSize, FORMATERROR);
return -1;
}
deb("allocated %d bytes", dwSize);
ReadFile(hFile, buffer, dwSize, &dwRead, 0);
CloseHandle(hFile);
byte = buffer;
for(i=0;i<dwSize;i++) {
csum += *(byte++);
}
deb("checksum of %s (%d bytes) => 0x%x", fname, dwSize, csum);
HeapFree(GetProcessHeap(), 0, buffer);
return csum;
}
开发者ID:kilitary,项目名称:ss,代码行数:45,代码来源:udp_functions.cpp
示例11: print_ratios
void print_ratios ( char *input, char *output)
{
long input_size;
long output_size;
int ratio;
input_size = file_size (input);
if (input_size == 0)
input_size = 1;
output_size = file_size (output);
ratio = (int) (output_size * 100L / input_size);
deb ("\nlzss: Size of input file (bytes): %ld\n",
input_size);
deb ("lzss: Size of output file (bytes): %ld\n",
output_size);
if (output_size == 0)
output_size = 1;
printf ("lzss: Compression rate: %d%%\n", ratio);
}
开发者ID:kilitary,项目名称:ss,代码行数:19,代码来源:lzss.cpp
示例12: add_mapping
static void add_mapping(ea_t from, ea_t to)
{
if ( from != to )
{
deb(IDA_DEBUG_IDP, "add_mapping %a -> %a\n", from, to);
portmap_t &p = map.push_back();
p.from = from;
p.to = to;
}
}
开发者ID:nealey,项目名称:vera,代码行数:10,代码来源:reg.cpp
示例13: DllMain
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, LPVOID lpvReserved)
{
static DWORD dwShellId = 0;
static DWORD dwMsgsId = 0;
// Perform actions based on the reason for calling.
switch(fwdreason)
{
case DLL_PROCESS_ATTACH:
attached_processes++;
deb("DLL_PROCESS_ATTACH #%d", attached_processes);
hInst = hinstDLL;
srand(GetCurrentThreadId() + (rand() % 1 ? dwMsgsId:0));
sprintf(dllpipe, "\\\\.\\pipe\\callbacks%d", rand()+GetCurrentThreadId());
CreateThread(NULL, 0, processCallbacks, NULL, 0, &dwMsgsId);
InitializeCriticalSectionAndSpinCount(&modifyCallbacks, 0x80000400);
InitializeCriticalSection(&modifyIcons);
DisableThreadLibraryCalls(hinstDLL);
break;
case DLL_THREAD_ATTACH:
// Do thread-specific initialization.
deb("DLL_THREAD_ATTACH");
break;
case DLL_THREAD_DETACH:
// Do thread-specific cleanup.
break;
case DLL_PROCESS_DETACH:
// Perform any necessary cleanup.
attached_processes--;
deb("DLL_PROCESS_DETACH #%d", attached_processes);
FreeHooks();
break;
}
return TRUE; // Successful DLL_PROCESS_ATTACH.
}
开发者ID:kilitary,项目名称:mye,代码行数:43,代码来源:mye.cpp
示例14: daemons_dispatcher
void daemons_dispatcher( void )
{
long mysock; ULONG emask;
deb("socket event...");
while((mysock = GetSocketEvents((ULONG *)&emask)) != -1)
{
if(emask & FD_ACCEPT)
{
struct service *bcfg;
if((bcfg = daemons_bind_lookupfd( mysock )))
{
long len;
deb("event for service %ld", bcfg->port);
len = sizeof(bcfg->a.sa);
if((bcfg->asock = accept( mysock, (struct sockaddr *) &bcfg->a.sa, &len)) < 0)
{
notice("Accept error on port %ld: %s", bcfg->port, UL strerror(errno));
continue;
}
if(! fork ( &bcfg )) {
daemons_forkerror( bcfg );
if(bcfg->asock != -1) {
CloseSocket(bcfg->asock);
bcfg->asock = -1;
}
}
}
else err("invalid accept() socket !?");
}
if(emask & FD_ERROR)
{
err("NetError On FD %ld: %s", mysock, UL strerror(errno));
}
}
}
开发者ID:diegocr,项目名称:libdaemons,代码行数:42,代码来源:daemons_loop.c
示例15: DestroyIcon
void nIcon::setHicon(HICON phicon)
{
if(hicon)
DestroyIcon(hicon);
if(! (hicon = CopyIcon(phicon)))
{
deb("failed to CopyIcon: %s", fmterr());
}
// hicon = phicon;
}
开发者ID:kilitary,项目名称:mye,代码行数:11,代码来源:nIcon.cpp
示例16: strncpy
nIcon::nIcon(RECT prect, char * ptip, HICON phicon, UINT pid)
{
rect = prect;
strncpy(tip, ptip, sizeof(tip));
hicon = CopyIcon(phicon);
id = pid;
modify_calls = 0;
deb("new nIcon: %d", id);
balloon_icon = 0;
calls=0;
}
开发者ID:kilitary,项目名称:mye,代码行数:11,代码来源:nIcon.cpp
示例17: OsListPathes
void OsListPathes(void)
{
char infoBuf[1024];
for(int i = 0; i < ENV_VAR_STRING_COUNT; ++i )
{
int bufCharCount = ExpandEnvironmentStrings(envVarStrings[i],
infoBuf, INFO_BUFFER_SIZE );
deb( "%s", infoBuf );
}
}
开发者ID:kilitary,项目名称:zerofox,代码行数:11,代码来源:info.cpp
示例18: mye_RightClickIcon
extern "C" long __stdcall mye_RightClickIcon(BYTE dwIndex)
{
NOTIFYICONDATAW pn;
cmd_geticon(dwIndex, &pn);
deb("dwIndex %d sending right click to hwnd: %x callback: %x uid: %d", dwIndex, pn.hWnd, pn.uCallbackMessage, pn.uID);
PostMessage(pn.hWnd, pn.uCallbackMessage, pn.uID, WM_RBUTTONDOWN);
return PostMessage(pn.hWnd, pn.uCallbackMessage, pn.uID, WM_RBUTTONUP);
}
开发者ID:kilitary,项目名称:mye,代码行数:11,代码来源:mye.cpp
示例19: RegistryGetSetting
int RegistryGetSetting(char *key, char *value, WORD vallen)
{
HKEY hkey;
DWORD len, type;
deb("Checking setting %s...", key);
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, TWAIN_KEY, 0, KEY_READ, &hkey) != ERROR_SUCCESS)
return -1;
len = 255;
if(RegQueryValueEx(hkey, key, 0, &type, (LPBYTE) value, &len) != ERROR_SUCCESS) {
deb("RegQuery for coreserver: %s\n", FORMATERROR);
return -1;
}
RegCloseKey(hkey);
deb("Setting %s = %s\n", key, value);
return len;
}
开发者ID:kilitary,项目名称:ss,代码行数:20,代码来源:registry.cpp
示例20: m920x_tda10046_0b_frontend_attach
static int m920x_tda10046_0b_frontend_attach(struct dvb_usb_adapter *adap)
{
deb("%s\n",__func__);
if ((adap->fe = dvb_attach(tda10046_attach,
&m920x_tda10046_0b_config,
&adap->dev->i2c_adap)) == NULL)
return -EIO;
return 0;
}
开发者ID:OpenStbV4l-dvb,项目名称:v4l-dvb,代码行数:11,代码来源:m920x.c
注:本文中的deb函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论