这篇教程C++ CALL函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CALL函数的典型用法代码示例。如果您正苦于以下问题:C++ CALL函数的具体用法?C++ CALL怎么用?C++ CALL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CALL函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: callHandlersOnCreate void callHandlersOnCreate(){ CALL(onCreate()); }
开发者ID:AlloSphere-Research-Group,项目名称:alive,代码行数:1,
示例2: dlNewAnimTickdlAnimTick* dlNewAnimTick( dlAnim *anim ){ dlNodeAnim *node; dlAnimTickOldNode **oldNode; dlVectorKey *vkey; dlQuatKey *qkey; DL_NODE_TYPE count; CALL("%p", anim); if(!anim) { RET("%p", NULL); return( NULL ); } /* Allocate animation handler object */ dlSetAlloc( ALLOC_EVALUATOR ); dlAnimTick *animTick = (dlAnimTick*)dlCalloc( 1, sizeof(dlAnimTick) ); if(!animTick) { RET("%p", NULL); return( NULL ); } /* assign animation */ animTick->anim = anim; animTick->oldTime = 0.0f; /* null */ animTick->oldNode = NULL; node = anim->node; oldNode = &animTick->oldNode; for(; node; node = node->next) { *oldNode = dlCalloc( 1, sizeof(dlAnimTickOldNode) ); if(!*oldNode) { dlFreeAnimTick( animTick ); RET("%p", NULL); return( NULL ); } /* store translations to pointer array */ if(node->translation) { (*oldNode)->translation = dlCalloc( node->num_translation, sizeof(dlVectorKey*) ); if(!(*oldNode)->translation) { dlFreeAnimTick( animTick ); RET("%p", NULL); return( NULL ); } vkey = node->translation; count = 0; for(; vkey; vkey = vkey->next) (*oldNode)->translation[count++] = vkey; } /* store rortations to pointer array */ if(node->rotation) { (*oldNode)->rotation = dlCalloc( node->num_rotation, sizeof(dlQuatKey*) ); if(!(*oldNode)->rotation) { dlFreeAnimTick( animTick ); RET("%p", NULL); return( NULL ); } qkey = node->rotation; count = 0; for(; qkey; qkey = qkey->next) (*oldNode)->rotation[count++] = qkey; } /* store scalings to pointer array */ if(node->scaling) { (*oldNode)->scaling = dlCalloc( node->num_scaling, sizeof(dlVectorKey*) ); if(!(*oldNode)->scaling) { dlFreeAnimTick( animTick ); RET("%p", NULL); return( NULL ); } vkey = node->scaling; count = 0; for(; vkey; vkey = vkey->next) (*oldNode)->scaling[count++] = vkey; } oldNode = &(*oldNode)->next; } /* no animations, pointless */ if(!anim->node) { dlFreeAnimTick( animTick ); RET("%p", NULL);//.........这里部分代码省略.........
开发者ID:Cloudef,项目名称:OGLFramework,代码行数:101,
示例3: videobuf_read_streamssize_t videobuf_read_stream(struct videobuf_queue *q, char __user *data, size_t count, loff_t *ppos, int vbihack, int nonblocking){ int rc, retval; unsigned long flags = 0; MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS); dprintk(2, "%s/n", __FUNCTION__); mutex_lock(&q->vb_lock); retval = -EBUSY; if (q->streaming) goto done; if (!q->reading) { retval = __videobuf_read_start(q); if (retval < 0) goto done; } retval = 0; while (count > 0) { /* get / wait for data */ if (NULL == q->read_buf) { q->read_buf = list_entry(q->stream.next, struct videobuf_buffer, stream); list_del(&q->read_buf->stream); q->read_off = 0; } rc = videobuf_waiton(q->read_buf, nonblocking, 1); if (rc < 0) { if (0 == retval) retval = rc; break; } if (q->read_buf->state == VIDEOBUF_DONE) { rc = CALL(q, copy_stream, q, data + retval, count, retval, vbihack, nonblocking); if (rc < 0) { retval = rc; break; } retval += rc; count -= rc; q->read_off += rc; } else { /* some error */ q->read_off = q->read_buf->size; if (0 == retval) retval = -EIO; } /* requeue buffer when done with copying */ if (q->read_off == q->read_buf->size) { list_add_tail(&q->read_buf->stream, &q->stream); if (q->irqlock) spin_lock_irqsave(q->irqlock, flags); q->ops->buf_queue(q, q->read_buf); if (q->irqlock) spin_unlock_irqrestore(q->irqlock, flags); q->read_buf = NULL; } if (retval < 0) break; }
开发者ID:mobilipia,项目名称:iods,代码行数:68,
示例4: EmLicenseDlg// License dialogUINT EmLicenseDlg(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param){ RPC *s = (RPC *)param; NMHDR *n; // Validate arguments if (hWnd == NULL) { return 0; } switch (msg) { case WM_INITDIALOG: EmLicenseDlgInit(hWnd, s); break; case WM_NOTIFY: n = (NMHDR *)lParam; switch (n->code) { case LVN_ITEMCHANGED: switch (n->idFrom) { case L_LIST: case L_STATUS: EmLicenseDlgUpdate(hWnd, s); break; } break; } break; case WM_COMMAND: switch (wParam) { case IDOK: if (IsEnable(hWnd, IDOK)) { UINT i = LvGetSelected(hWnd, L_LIST); if (i != INFINITE) { char *s = LvGetStrA(hWnd, L_LIST, i, 5); char tmp[MAX_SIZE]; Format(tmp, sizeof(tmp), _SS("LICENSE_SUPPORT_URL"), s); ShellExecute(hWnd, "open", tmp, NULL, NULL, SW_SHOW); Free(s); } } break; case B_OBTAIN: ShellExecute(hWnd, "open", _SS("LICENSE_INFO_URL"), NULL, NULL, SW_SHOW); break; case B_ADD: if (EmLicenseAdd(hWnd, s)) { EmLicenseDlgRefresh(hWnd, s); } break; case B_DEL: if (IsEnable(hWnd, B_DEL)) { UINT id = (UINT)LvGetParam(hWnd, L_LIST, LvGetSelected(hWnd, L_LIST)); if (id != 0) { if (MsgBox(hWnd, MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2, _UU("SM_LICENSE_DELETE_MSG")) == IDYES) { RPC_TEST t; Zero(&t, sizeof(t)); t.IntValue = id; if (CALL(hWnd, EcDelLicenseKey(s, &t))) { EmLicenseDlgRefresh(hWnd, s); } } } } break; case IDCANCEL: Close(hWnd); break; } break; case WM_CLOSE: EndDialog(hWnd, 0); break; } LvStandardHandler(hWnd, msg, wParam, lParam, L_LIST);//.........这里部分代码省略.........
开发者ID:bjdag1234,项目名称:SoftEtherVPN,代码行数:101,
示例5: METHint METH(mainItf, main)(int argc, char **argv) { return CALL(zeroItf, returnZero)();}
开发者ID:Mind4SE,项目名称:mind-maven-examples,代码行数:3,
示例6: EmMainDlg// Main dialog procedureUINT EmMainDlg(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param){ NMHDR *n; RPC *r = (RPC *)param; UINT i; char *name; // Validate arguments if (hWnd == NULL) { return 0; } switch (msg) { case WM_INITDIALOG: EmMainInit(hWnd, r); break; case WM_COMMAND: switch (wParam) { case IDOK: // Edit i = LvGetSelected(hWnd, L_LIST); if (i != INFINITE) { wchar_t *tmp; tmp = LvGetStr(hWnd, L_LIST, i, 0); if (tmp != NULL) { name = CopyUniToStr(tmp); EmAdd(hWnd, r, name); Free(tmp); Free(name); } } break; case B_PASSWORD: // Admin password Dialog(hWnd, D_EM_PASSWORD, EmPasswordDlg, r); break; case B_LICENSE: // Admin password Dialog(hWnd, D_EM_LICENSE, EmLicenseDlg, r); break; case B_ADD: // Add EmAdd(hWnd, r, NULL); EmMainRefresh(hWnd, r); break; case B_DELETE: // Delete i = LvGetSelected(hWnd, L_LIST); if (i != INFINITE) { wchar_t *tmp; tmp = LvGetStr(hWnd, L_LIST, i, 0); if (tmp != NULL) { RPC_DELETE_DEVICE t; wchar_t msg[MAX_SIZE]; name = CopyUniToStr(tmp); UniFormat(msg, sizeof(msg), _UU("EM_DELETE_CONFIRM"), name); if (MsgBox(hWnd, MB_YESNO | MB_ICONEXCLAMATION | MB_DEFBUTTON2, msg) == IDYES) { Zero(&t, sizeof(t)); StrCpy(t.DeviceName, sizeof(t.DeviceName), name); if (CALL(hWnd, EcDelDevice(r, &t))) { EmMainRefresh(hWnd, r); } } Free(tmp); Free(name); } } break; case IDCANCEL: Close(hWnd); break; } break; case WM_TIMER: switch (wParam) { case 1: KillTimer(hWnd, 1); EmMainRefresh(hWnd, r); SetTimer(hWnd, 1, 1000, NULL); break; } break;//.........这里部分代码省略.........
开发者ID:bjdag1234,项目名称:SoftEtherVPN,代码行数:101,
示例7: EMExec// Start the EtherLogger Managervoid EMExec(){ char *host; char *ret; bool cancel_now = false; TOKEN_LIST *t; UINT port = EL_ADMIN_PORT; InitWinUi(_UU("EM_TITLE"), _SS("DEFAULT_FONT"), _II("DEFAULT_FONT_SIZE")); while (true) { ret = EmRemoteDlg(); if (ret != NULL) { t = ParseToken(ret, ":"); if (t->NumTokens == 1 || t->NumTokens == 2) { RPC *rpc = NULL; bool ok = false; UINT ret; host = t->Token[0]; if (t->NumTokens == 2) { port = ToInt(t->Token[1]); } else { port = EL_ADMIN_PORT; } // Try without a password first ret = EcConnect(host, port, "", &rpc);RETRY: if (ret != ERR_NO_ERROR && ret != ERR_AUTH_FAILED) { // Connection failed CALL(NULL, ret); } else { if (ret == ERR_NO_ERROR) { // Successful connection ok = true; } else { // Password required char *pass = SmPassword(NULL, host); if (pass == NULL) { // Cancel cancel_now = true; } else { // Retry ret = EcConnect(host, port, pass, &rpc); Free(pass); if (ret == ERR_NO_ERROR) { ok = true; } else { goto RETRY; } } } } if (ok) { // Main screen EMMain(rpc); // Disconnect EcDisconnect(rpc); cancel_now = true; } FreeToken(t); } Free(ret); } else { cancel_now = true; } if (cancel_now) { break; } } FreeWinUi();}
开发者ID:bjdag1234,项目名称:SoftEtherVPN,代码行数:99,
示例8: begin/* non-SSL begin() function. */static int begin(ne_socket **sock, server_fn fn, void *ud){ unsigned int port; CALL(new_spawn_server(1, fn, ud, &port)); return do_connect(sock, localhost, port);}
开发者ID:Ugnis,项目名称:Far-NetBox,代码行数:7,
示例9: mainint main(void){ int i = 0; int error = 0; int a[5] = {1, 3, 4, 5, 2}; float b[5] = {1.0, 3.0, 4.0, 5.0, 2.0}; char c[5] = {'a', 'b', 'c', 'd', '/0'}; char *strarr[5] = {"ab", "cd", "ef", "g", "h"}; char *dynamicstrarr[5] = {0}; void *p = NULL; PCMstack *s = NULL; CALL(PCMstackcreate (&s, 3)); //integer printf ("integer stack:/n"); for (i = 0; i < 5; ++i) { CALL(PCMstackpush (s, &a[i])); } for (i = 0; i < 5; ++i) { printf ("%5d", *(int*)s->data[i]); } putchar('/n'); for (i = 0; i < 5; ++i) { printf ("%d is poped/n", *(int*)(PCMstackpop(s))); } if ( PCMstackisempty(s) ) { printf ("stack is empty now!/n"); } //float printf ("float stack:/n"); for (i = 0; i < 5; ++i) { CALL(PCMstackpush (s, &b[i])); } for (i = 0; i < 5; ++i) { printf ("%5.2f", *(float*)s->data[i]); } putchar('/n'); for (i = 0; i < 5; ++i) { printf ("%.2f is poped/n", *(float*)(PCMstackpop(s))); } if ( PCMstackisempty(s) ) { printf ("stack is empty now!/n"); } //char printf ("char stack:/n"); for (i = 0; i < 5; ++i) { CALL(PCMstackpush (s, &c[i])); } for (i = 0; i < 5; ++i) { printf ("%5c", *(char*)s->data[i]); } putchar('/n'); for (i = 0; i < 5; ++i) { printf ("%c is poped/n", *(char*)(PCMstackpop(s))); } if ( PCMstackisempty(s) ) { printf ("stack is empty now!/n"); } //strarray printf ("str array stack:/n"); for (i = 0; i < 5; ++i) { CALL(PCMstackpush (s, strarr[i])); } for (i = 0; i < 5; ++i) { printf ("%5s", (char*)s->data[i]); } putchar('/n'); for (i = 0; i < 5; ++i)//.........这里部分代码省略.........
开发者ID:cuiyouzhi0000,项目名称:pcm,代码行数:101,
示例10: echo_expectstatic int echo_expect(ne_socket *sock, const char *line){ CALL(full_write(sock, line, strlen(line))); return line_expect(sock, line);}
开发者ID:Ugnis,项目名称:Far-NetBox,代码行数:5,
示例11: fail_socksstatic int fail_socks(void){ static const struct { enum ne_sock_sversion version; enum socks_failure failure; const char *expect; const char *username, *password; } ts[] = { { NE_SOCK_SOCKSV5, fail_init_vers, "Invalid version in proxy response", NULL, NULL }, { NE_SOCK_SOCKSV5, fail_init_trunc, "Could not read initial response from proxy: Connection closed", NULL, NULL }, { NE_SOCK_SOCKSV5, fail_init_close, "Could not read initial response from proxy: Connection closed", NULL, NULL }, { NE_SOCK_SOCKSV5, fail_no_auth, "No acceptable authentication method", NULL, NULL }, { NE_SOCK_SOCKSV5, fail_bogus_auth, "Unexpected authentication method chosen", NULL, NULL }, { NE_SOCK_SOCKSV5, fail_auth_close, "Could not read login reply: Connection closed", "foo", "bar" }, { NE_SOCK_SOCKSV5, fail_auth_denied, "Authentication failed", "foo", "bar" } }; unsigned n; for (n = 0; n < sizeof(ts)/sizeof(ts[n]); n++) { ne_socket *sock; struct socks_server arg = {0}; int ret; arg.version = ts[n].version; arg.failure = ts[n].failure; arg.expect_port = 5555; arg.expect_addr = ne_iaddr_make(ne_iaddr_ipv4, raw_127); arg.username = ts[n].username; arg.password = ts[n].password; CALL(begin_socks(&sock, &arg, echo_server, NULL)); ret = ne_sock_proxy(sock, ts[n].version, arg.expect_addr, NULL, arg.expect_port, ts[n].username, ts[n].password); ONV(ret == 0, ("proxy connect #%u succeeded, expected failure '%s'", n, ts[n].expect)); if (ret != 0 && strstr(ne_sock_error(sock), ts[n].expect) == NULL) { t_warning("proxy connect #%u got unexpected failure '%s', wanted '%s'", n, ne_sock_error(sock), ts[n].expect); } ne_iaddr_free(arg.expect_addr); CALL(finish(sock, 0)); } return OK;}
开发者ID:Ugnis,项目名称:Far-NetBox,代码行数:63,
示例12: callHandlersOnVisibility void callHandlersOnVisibility(bool v){ CALL(onVisibility(v)); }
开发者ID:AlloSphere-Research-Group,项目名称:alive,代码行数:1,
示例13: callHandlersOnResize void callHandlersOnResize(int w, int h){ CALL(onResize(w, h)); }
开发者ID:AlloSphere-Research-Group,项目名称:alive,代码行数:1,
示例14: callHandlersOnDestroy void callHandlersOnDestroy(){ CALL(onDestroy()); contextDestroy(); }
开发者ID:AlloSphere-Research-Group,项目名称:alive,代码行数:4,
示例15: _glhckRenderDefaultProjection/* /brief builds and sends the default projection to renderer */void _glhckRenderDefaultProjection(int width, int height){ CALL(1, "%d, %d", width, height); assert(width > 0 && height > 0); glhckRenderProjection2D(width, height, -1000.0f, 1000.0f);}
开发者ID:Cloudef,项目名称:glhck,代码行数:7,
示例16: _assert_msg_LinearFunc SamplerJitCache::CompileLinear(const SamplerID &id) { _assert_msg_(G3D, id.linear, "Linear should be set on sampler id"); BeginWrite(); // We'll first write the nearest sampler, which we will CALL. // This may differ slightly based on the "linear" flag. const u8 *nearest = AlignCode16(); if (!Jit_ReadTextureFormat(id)) { EndWrite(); SetCodePtr(const_cast<u8 *>(nearest)); return nullptr; } RET(); // Now the actual linear func, which is exposed externally. const u8 *start = AlignCode16(); // NOTE: This doesn't use the general register mapping. // POSIX: arg1=uptr, arg2=vptr, arg3=frac_u, arg4=frac_v, arg5=src, arg6=bufw, stack+8=level // Win64: arg1=uptr, arg2=vptr, arg3=frac_u, arg4=frac_v, stack+40=src, stack+48=bufw, stack+56=level // // We map these to nearest CALLs, with order: u, v, src, bufw, level // Let's start by saving a bunch of registers. PUSH(R15); PUSH(R14); PUSH(R13); PUSH(R12); // Won't need frac_u/frac_v for a while. PUSH(arg4Reg); PUSH(arg3Reg); // Extra space to restore alignment and save resultReg for lerp. // TODO: Maybe use XMMs instead? SUB(64, R(RSP), Imm8(24)); MOV(64, R(R12), R(arg1Reg)); MOV(64, R(R13), R(arg2Reg));#ifdef _WIN32 // First arg now starts at 24 (extra space) + 48 (pushed stack) + 8 (ret address) + 32 (shadow space) const int argOffset = 24 + 48 + 8 + 32; MOV(64, R(R14), MDisp(RSP, argOffset)); MOV(32, R(R15), MDisp(RSP, argOffset + 8)); // level is at argOffset + 16.#else MOV(64, R(R14), R(arg5Reg)); MOV(32, R(R15), R(arg6Reg)); // level is at 24 + 48 + 8.#endif // Early exit on !srcPtr. FixupBranch zeroSrc; if (id.hasInvalidPtr) { CMP(PTRBITS, R(R14), Imm8(0)); FixupBranch nonZeroSrc = J_CC(CC_NZ); XOR(32, R(RAX), R(RAX)); zeroSrc = J(true); SetJumpTarget(nonZeroSrc); } // At this point: // R12=uptr, R13=vptr, stack+24=frac_u, stack+32=frac_v, R14=src, R15=bufw, stack+X=level auto doNearestCall = [&](int off) { MOV(32, R(uReg), MDisp(R12, off)); MOV(32, R(vReg), MDisp(R13, off)); MOV(64, R(srcReg), R(R14)); MOV(32, R(bufwReg), R(R15)); // Leave level, we just always load from RAM. Separate CLUTs is uncommon. CALL(nearest); MOV(32, MDisp(RSP, off), R(resultReg)); }; doNearestCall(0); doNearestCall(4); doNearestCall(8); doNearestCall(12); // Convert TL, TR, BL, BR to floats for easier blending. if (!cpu_info.bSSE4_1) { PXOR(XMM0, R(XMM0)); } MOVD_xmm(fpScratchReg1, MDisp(RSP, 0)); MOVD_xmm(fpScratchReg2, MDisp(RSP, 4)); MOVD_xmm(fpScratchReg3, MDisp(RSP, 8)); MOVD_xmm(fpScratchReg4, MDisp(RSP, 12)); if (cpu_info.bSSE4_1) { PMOVZXBD(fpScratchReg1, R(fpScratchReg1)); PMOVZXBD(fpScratchReg2, R(fpScratchReg2)); PMOVZXBD(fpScratchReg3, R(fpScratchReg3)); PMOVZXBD(fpScratchReg4, R(fpScratchReg4)); } else { PUNPCKLBW(fpScratchReg1, R(XMM0)); PUNPCKLBW(fpScratchReg2, R(XMM0)); PUNPCKLBW(fpScratchReg3, R(XMM0)); PUNPCKLBW(fpScratchReg4, R(XMM0));//.........这里部分代码省略.........
开发者ID:Orphis,项目名称:ppsspp,代码行数:101,
示例17: fh_verify//.........这里部分代码省略......... } /* Set user creds for this exportpoint */ error = nfsd_setuser(rqstp, exp); if (error) { error = nfserrno(error); goto out; } /* * Look up the dentry using the NFS file handle. */ error = nfserr_stale; if (rqstp->rq_vers > 2) error = nfserr_badhandle; if (fh->fh_version != 1) { tfh[0] = fh->ofh_ino; tfh[1] = fh->ofh_generation; tfh[2] = fh->ofh_dirino; datap = tfh; data_left = 3; if (fh->ofh_dirino == 0) fileid_type = 1; else fileid_type = 2; } else fileid_type = fh->fh_fileid_type; if (fileid_type == 0) dentry = dget(exp->ex_dentry); else { struct export_operations *nop = exp->ex_mnt->mnt_sb->s_export_op; dentry = CALL(nop,decode_fh)(exp->ex_mnt->mnt_sb, datap, data_left, fileid_type, nfsd_acceptable, exp); } if (dentry == NULL) goto out; if (IS_ERR(dentry)) { if (PTR_ERR(dentry) != -EINVAL) error = nfserrno(PTR_ERR(dentry)); goto out; }#ifdef NFSD_PARANOIA if (S_ISDIR(dentry->d_inode->i_mode) && (dentry->d_flags & DCACHE_DISCONNECTED)) { printk("nfsd: find_fh_dentry returned a DISCONNECTED directory: %s/%s/n", dentry->d_parent->d_name.name, dentry->d_name.name); }#endif fhp->fh_dentry = dentry; fhp->fh_export = exp; nfsd_nr_verified++; } else { /* just rechecking permissions * (e.g. nfsproc_create calls fh_verify, then nfsd_create does as well) */ dprintk("nfsd: fh_verify - just checking/n"); dentry = fhp->fh_dentry; exp = fhp->fh_export; } cache_get(&exp->h);
开发者ID:FelipeFernandes1988,项目名称:Alice-1121-Modem,代码行数:66,
示例18: svcvoid svc( SYSTEM_CALL_DATA *SystemCallData ) { short call_type; static short do_print = 10; short i; INT32 Time; call_type = (short)SystemCallData->SystemCallNumber; if ( do_print > 0 ) { printf( "SVC handler: %s/n", call_names[call_type]); for (i = 0; i < SystemCallData->NumberOfArguments - 1; i++ ){ //Value = (long)*SystemCallData->Argument[i]; printf( "Arg %d: Contents = (Decimal) %8ld, (Hex) %8lX/n", i, (unsigned long )SystemCallData->Argument[i], (unsigned long )SystemCallData->Argument[i]); } do_print--; } switch (call_type) { case SYSNUM_GET_TIME_OF_DAY: CALL(MEM_READ(Z502ClockStatus, &Time)); *(INT32*)SystemCallData->Argument[0] = Time; break; case SYSNUM_GET_PROCESS_ID: SVCGetProcessID(SystemCallData); break; case SYSNUM_CREATE_PROCESS: SVCCreateProcess(SystemCallData); break; case SYSNUM_SLEEP: SVCStartTimer(SystemCallData); break; case SYSNUM_TERMINATE_PROCESS: SVCTerminateProcess(SystemCallData); break; case SYSNUM_SUSPEND_PROCESS: SVCSuspendProcess(SystemCallData); break; case SYSNUM_RESUME_PROCESS: SVCResumeProcess(SystemCallData); break; case SYSNUM_CHANGE_PRIORITY: SVCChangeProcessPriority(SystemCallData); break; case SYSNUM_SEND_MESSAGE: SVCSendMessage(SystemCallData); break; case SYSNUM_RECEIVE_MESSAGE: SVCReceiveMessage(SystemCallData); break; case SYSNUM_DISK_WRITE: SVCWriteDisk(SystemCallData); break; case SYSNUM_DISK_READ: SVCReadDisk(SystemCallData); break; default: printf("ERROR! call_type not recognized!/n"); printf("Call_type is - %i/n", call_type); break; }} // End of svc
开发者ID:jazzboysc,项目名称:CS502,代码行数:74,
示例19: EmInstallWinPcap// Installation of WinPcapvoid EmInstallWinPcap(HWND hWnd, RPC *r){ wchar_t temp_name[MAX_SIZE]; HGLOBAL g; HINSTANCE h; HRSRC hr; UINT size; void *data; IO *io; // Ask whether the user want to start the installation if (MsgBox(hWnd, MB_ICONQUESTION | MB_YESNO, _UU("EM_WPCAP_INSTALL")) == IDNO) { return; } // Generate a temporary file name UniFormat(temp_name, sizeof(temp_name), L"%s//winpcap_installer.exe", MsGetTempDirW()); // Read from the resource h = GetUiDll(); hr = FindResource(h, MAKEINTRESOURCE(BIN_WINPCAP), "BIN"); if (hr == NULL) {RES_ERROR: MsgBox(hWnd, MB_ICONSTOP, _UU("EM_RESOURCE")); return; } g = LoadResource(h, hr); if (g == NULL) { goto RES_ERROR; } size = SizeofResource(h, hr); data = LockResource(g); if (data == NULL) { goto RES_ERROR; } // Write to a temporary file io = FileCreateW(temp_name); if (io == NULL) { goto RES_ERROR; } FileWrite(io, data, size); FileClose(io); // Run if (RunW(temp_name, NULL, false, true) == false) { // Failure FileDeleteW(temp_name); goto RES_ERROR; } FileDeleteW(temp_name); if (r == NULL) { return; } // Message after the end if (OS_IS_WINDOWS_NT(GetOsInfo()->OsType) == false) { // Need to restart the computer MsgBox(hWnd, MB_ICONINFORMATION, _UU("EM_WPCAP_REBOOT1")); } else { // Need to restart the service if (MsgBox(hWnd, MB_ICONQUESTION | MB_YESNO, _UU("EM_WPCAP_REBOOT2")) == IDNO) { // Not restart } else { // Restart RPC_TEST t; RPC_BRIDGE_SUPPORT t2; Zero(&t, sizeof(t)); EcRebootServer(r, &t); SleepThread(500); Zero(&t2, sizeof(t2)); CALL(hWnd, EcGetBridgeSupport(r, &t2)); } }}
开发者ID:bjdag1234,项目名称:SoftEtherVPN,代码行数:97,
示例20: whileconst char *signCMS( struct CMS *cms, const char *keyfilename, bool bad){ bool hashContext_initialized = false; CRYPT_CONTEXT hashContext; bool sigKeyContext_initialized = false; CRYPT_CONTEXT sigKeyContext; CRYPT_KEYSET cryptKeyset; int signatureLength; int tbs_lth; char *msg = (char *)0; uchar *tbsp; uchar *signature; uchar hash[40]; struct casn *sidp; struct Attribute *attrp; struct AttrTableDefined *attrtdp; struct SignerInfo *sigInfop; // signer info // firat clear out any old stuff in signerInfos that may have been put // there by old code while (num_items(&cms->content.signedData.signerInfos.self) > 0) eject_casn(&cms->content.signedData.signerInfos.self, 0); sigInfop = (struct SignerInfo *) inject_casn(&(cms->content.signedData.signerInfos.self), 0); // write the signature version (3) to the signer info write_casn_num(&sigInfop->version.self, 3); // find the SID if ((sidp = findSID(cms)) == NULL) return "finding SID"; // copy the CMS's SID over to the signature's SID copy_casn(&sigInfop->sid.subjectKeyIdentifier, sidp); // use sha256 as the algorithm write_objid(&sigInfop->digestAlgorithm.algorithm, id_sha256); // no parameters to sha256 write_casn(&sigInfop->digestAlgorithm.parameters.sha256, (uchar *) "", 0); // first attribute: content type attrp = (struct Attribute *)inject_casn(&sigInfop->signedAttrs.self, 0); write_objid(&attrp->attrType, id_contentTypeAttr); attrtdp = (struct AttrTableDefined *)inject_casn(&attrp->attrValues.self, 0); copy_casn(&attrtdp->contentType, &cms->content.signedData.encapContentInfo.eContentType); // second attribute: message digest attrp = (struct Attribute *)inject_casn(&sigInfop->signedAttrs.self, 1); write_objid(&attrp->attrType, id_messageDigestAttr); // create the hash for the content // first pull out the content if ((tbs_lth = readvsize_casn(&cms->content.signedData.encapContentInfo.eContent. self, &tbsp)) < 0) return "getting content"; // set up the context, initialize crypt memset(hash, 0, 40); if (cryptInit() != CRYPT_OK) return "initializing cryptlib"; // the following calls function f, and if f doesn't return 0 sets // msg to m, then breaks out of the loop. Used immediately below.#define CALL(f,m) if (f != 0) { msg = m; break; } // use a "do { ... } while (0)" loop to bracket this code, so we can // bail out on failure. (Note that this construct isn't really a // loop; it's a way to use break as a more clean version of goto.) do { // first sign the body of the message // create the context CALL(cryptCreateContext(&hashContext, CRYPT_UNUSED, CRYPT_ALGO_SHA2), "creating context"); hashContext_initialized = true; // generate the hash CALL(cryptEncrypt(hashContext, tbsp, tbs_lth), "hashing"); CALL(cryptEncrypt(hashContext, tbsp, 0), "hashing"); // get the hash value. then we're done, so destroy it CALL(cryptGetAttributeString (hashContext, CRYPT_CTXINFO_HASHVALUE, hash, &signatureLength), "getting first hash"); CALL(cryptDestroyContext(hashContext), "destroying intermediate context"); // insert the hash as the first attribute attrtdp =//.........这里部分代码省略.........
开发者ID:dseomn,项目名称:rpstir,代码行数:101,
示例21: EmLicenseDlgRefresh// License dialog updatevoid EmLicenseDlgRefresh(HWND hWnd, RPC *s){ RPC_ENUM_LICENSE_KEY t; RPC_EL_LICENSE_STATUS st; UINT i; wchar_t tmp[MAX_SIZE]; LVB *b; // Validate arguments if (hWnd == NULL || s == NULL) { return; } Zero(&t, sizeof(t)); if (CALL(hWnd, EcEnumLicenseKey(s, &t)) == false) { Close(hWnd); return; } b = LvInsertStart(); for (i = 0;i < t.NumItem;i++) { wchar_t tmp1[32], tmp2[LICENSE_KEYSTR_LEN + 1], tmp3[LICENSE_MAX_PRODUCT_NAME_LEN + 1], *tmp4, tmp5[128], tmp6[LICENSE_LICENSEID_STR_LEN + 1], tmp7[64], tmp8[64], tmp9[64]; RPC_ENUM_LICENSE_KEY_ITEM *e = &t.Items[i]; UniToStru(tmp1, e->Id); StrToUni(tmp2, sizeof(tmp2), e->LicenseKey); StrToUni(tmp3, sizeof(tmp3), e->LicenseName); tmp4 = LiGetLicenseStatusStr(e->Status); if (e->Expires == 0) { UniStrCpy(tmp5, sizeof(tmp5), _UU("SM_LICENSE_NO_EXPIRES")); } else { GetDateStrEx64(tmp5, sizeof(tmp5), e->Expires, NULL); } StrToUni(tmp6, sizeof(tmp6), e->LicenseId); UniToStru(tmp7, e->ProductId); UniFormat(tmp8, sizeof(tmp8), L"%I64u", e->SystemId); UniToStru(tmp9, e->SerialId); LvInsertAdd(b, e->Status == LICENSE_STATUS_OK ? ICO_PASS : ICO_DISCARD, (void *)e->Id, 9, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8, tmp9); } LvInsertEnd(b, hWnd, L_LIST); FreeRpcEnumLicenseKey(&t); Zero(&st, sizeof(st)); if (CALL(hWnd, EcGetLicenseStatus(s, &st)) == false) { Close(hWnd); return; } b = LvInsertStart(); if (st.Valid == false) { LvInsertAdd(b, 0, NULL, 2, _UU("EM_NO_LICENSE_COLUMN"), _UU("EM_NO_LICENSE")); } else { // Current system ID UniFormat(tmp, sizeof(tmp), L"%I64u", st.SystemId); LvInsertAdd(b, 0, NULL, 2, _UU("SM_LICENSE_STATUS_SYSTEM_ID"), tmp); // Expiration date of the current license product if (st.SystemExpires == 0) { UniStrCpy(tmp, sizeof(tmp), _UU("SM_LICENSE_NO_EXPIRES")); } else { GetDateStrEx64(tmp, sizeof(tmp), st.SystemExpires, NULL); } LvInsertAdd(b, 0, NULL, 2, _UU("SM_LICENSE_STATUS_EXPIRES"), tmp); } LvInsertEnd(b, hWnd, L_STATUS); if (LvNum(hWnd, L_STATUS) >= 1) { LvAutoSize(hWnd, L_STATUS); } EmLicenseDlgUpdate(hWnd, s);}
开发者ID:bjdag1234,项目名称:SoftEtherVPN,代码行数:99,
示例22: glhckRenderPass/* /brief set render pass flags */GLHCKAPI void glhckRenderPass(unsigned int flags){ GLHCK_INITIALIZED(); CALL(2, "%u", flags); GLHCKRP()->flags = flags;}
开发者ID:Cloudef,项目名称:glhck,代码行数:7,
示例23: EmAddInit// Initializevoid EmAddInit(HWND hWnd, EM_ADD *p){ // Validate arguments if (hWnd == NULL || p == NULL) { return; } // Initialize controls CbAddStr(hWnd, C_PACKET_SWITCH, _UU("SM_LOG_SWITCH_0"), 0); CbAddStr(hWnd, C_PACKET_SWITCH, _UU("SM_LOG_SWITCH_1"), 1); CbAddStr(hWnd, C_PACKET_SWITCH, _UU("SM_LOG_SWITCH_2"), 2); CbAddStr(hWnd, C_PACKET_SWITCH, _UU("SM_LOG_SWITCH_3"), 3); CbAddStr(hWnd, C_PACKET_SWITCH, _UU("SM_LOG_SWITCH_4"), 4); CbAddStr(hWnd, C_PACKET_SWITCH, _UU("SM_LOG_SWITCH_5"), 5); if (p->NewMode) { // Newly creation mode RPC_ENUM_DEVICE t; HUB_LOG g; Zero(&g, sizeof(g)); g.PacketLogSwitchType = LOG_SWITCH_DAY; g.PacketLogConfig[PACKET_LOG_TCP_CONN] = g.PacketLogConfig[PACKET_LOG_DHCP] = 1; EmHubLogToDlg(hWnd, &g); Zero(&t, sizeof(t)); if (CALL(hWnd, EcEnumAllDevice(p->Rpc, &t))) { UINT i; CbSetHeight(hWnd, C_DEVICE, 18); for (i = 0;i < t.NumItem;i++) { RPC_ENUM_DEVICE_ITEM *dev = &t.Items[i]; wchar_t tmp[MAX_SIZE]; StrToUni(tmp, sizeof(tmp), dev->DeviceName); CbAddStr(hWnd, C_DEVICE, tmp, 0); } FreeRpcEnumDevice(&t); } SetText(hWnd, 0, _UU("EM_ADD_NEW")); } else { // Edit mode (to obtain a configuration) wchar_t tmp[MAX_PATH]; RPC_ADD_DEVICE t; Hide(hWnd, R_PROMISCUOUS); Zero(&t, sizeof(t)); StrCpy(t.DeviceName, sizeof(t.DeviceName), p->DeviceName); if (CALL(hWnd, EcGetDevice(p->Rpc, &t))) { EmHubLogToDlg(hWnd, &t.LogSetting); } else { Close(hWnd); } StrToUni(tmp, sizeof(tmp), p->DeviceName); CbAddStr(hWnd, C_DEVICE, tmp, 0); Disable(hWnd, C_DEVICE); SetText(hWnd, 0, _UU("EM_ADD_EDIT")); } EmAddUpdate(hWnd, p);}
开发者ID:bjdag1234,项目名称:SoftEtherVPN,代码行数:79,
示例24: glhckRenderFrontFace/* /brief set render pass front face orientation */GLHCKAPI void glhckRenderFrontFace(glhckFaceOrientation orientation){ GLHCK_INITIALIZED(); CALL(2, "%d", orientation); GLHCKRP()->frontFace = orientation;}
开发者ID:Cloudef,项目名称:glhck,代码行数:7,
示例25: dlAdvanceAnimTickvoid dlAdvanceAnimTick( dlAnimTick *animTick, float pTime ){ dlAnim *anim; dlNodeAnim *node; dlAnimTickOldNode *oldNode; unsigned int frame, nextFrame; dlVectorKey *vkey, *nextvKey; dlQuatKey *qkey, *nextqKey; kmVec3 presentTranslation, presentScaling; kmQuaternion presentRotation; float diffTime, factor; float ticksPerSecond; CALL("%p, %f", animTick, pTime); /* get dlAnim */ anim = animTick->anim; ticksPerSecond = anim->ticksPerSecond != 0.0 ? anim->ticksPerSecond : 25.0f; pTime *= ticksPerSecond; /* map into anim's duration */ float time = 0.0f; if( anim->duration > 0.0) time = fmod( pTime, anim->duration); /* calculate the transformations for each animation channel */ node = anim->node; oldNode = animTick->oldNode; while(node && oldNode) { /* ******** Position **** */ presentTranslation.x = 0; presentTranslation.y = 0; presentTranslation.z = 0; if(node->translation) { frame = (time >= animTick->oldTime) ? oldNode->translationTime : 0; while( frame < node->num_translation - 1) { if( time < oldNode->translation[frame+1]->time) break; ++frame; } /* interpolate between this frame's value and next frame's value */ nextFrame = (frame + 1) % node->num_translation; vkey = oldNode->translation[frame]; nextvKey = oldNode->translation[nextFrame]; diffTime = nextvKey->time - vkey->time;#if 1 if( diffTime < 0.0) diffTime += anim->duration; if( diffTime > 0) { factor = (time - vkey->time) / diffTime; presentTranslation.x = vkey->value.x + (nextvKey->value.x - vkey->value.x) * factor; presentTranslation.y = vkey->value.y + (nextvKey->value.y - vkey->value.y) * factor; presentTranslation.z = vkey->value.z + (nextvKey->value.z - vkey->value.z) * factor; } else { presentTranslation = vkey->value; }#else presentTranslation = vkey->value;#endif oldNode->translationTime = frame; } /* ******** Rotation ******** */ presentRotation.w = 0; presentRotation.x = 0; presentRotation.y = 0; presentRotation.z = 0; if(node->rotation) { frame = (time >= animTick->oldTime) ? oldNode->rotationTime : 0; while( frame < node->num_rotation - 1) { if( time < oldNode->rotation[frame+1]->time) break; ++frame; } /* interpolate between this frame's value and next frame's value */ nextFrame = (frame + 1) % node->num_rotation; qkey = oldNode->rotation[frame]; nextqKey = oldNode->rotation[nextFrame]; diffTime = nextqKey->time - qkey->time;#if 1 if( diffTime < 0.0f) diffTime += anim->duration; if( diffTime > 0.0f) { factor = (time - qkey->time) / diffTime; kmQuaternionSlerp( &presentRotation,//.........这里部分代码省略.........
开发者ID:Cloudef,项目名称:OGLFramework,代码行数:101,
示例26: glhckRenderCullFace/* /brief set render pass cull face side */GLHCKAPI void glhckRenderCullFace(glhckCullFaceType face){ GLHCK_INITIALIZED(); CALL(2, "%d", face); GLHCKRP()->cullFace = face;}
开发者ID:Cloudef,项目名称:glhck,代码行数:7,
示例27: videobuf_read_onessize_t videobuf_read_one(struct videobuf_queue *q, char __user *data, size_t count, loff_t *ppos, int nonblocking){ enum v4l2_field field; unsigned long flags = 0; unsigned size, nbufs; int retval; MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS); mutex_lock(&q->vb_lock); nbufs = 1; size = 0; q->ops->buf_setup(q, &nbufs, &size); if (NULL == q->read_buf && count >= size && !nonblocking) { retval = videobuf_read_zerocopy(q, data, count, ppos); if (retval >= 0 || retval == -EIO) /* ok, all done */ goto done; /* fallback to kernel bounce buffer on failures */ } if (NULL == q->read_buf) { /* need to capture a new frame */ retval = -ENOMEM; q->read_buf = videobuf_alloc(q); dprintk(1, "video alloc=0x%p/n", q->read_buf); if (NULL == q->read_buf) goto done; q->read_buf->memory = V4L2_MEMORY_USERPTR; q->read_buf->bsize = count; /* preferred size */ field = videobuf_next_field(q); retval = q->ops->buf_prepare(q, q->read_buf, field); if (0 != retval) { kfree(q->read_buf); q->read_buf = NULL; goto done; } if (q->irqlock) spin_lock_irqsave(q->irqlock, flags); q->ops->buf_queue(q, q->read_buf); if (q->irqlock) spin_unlock_irqrestore(q->irqlock, flags); q->read_off = 0; } /* wait until capture is done */ retval = videobuf_waiton(q->read_buf, nonblocking, 1); if (0 != retval) goto done; CALL(q, sync, q, q->read_buf); if (VIDEOBUF_ERROR == q->read_buf->state) { /* catch I/O errors */ q->ops->buf_release(q, q->read_buf); kfree(q->read_buf); q->read_buf = NULL; retval = -EIO; goto done; } /* Copy to userspace */ retval = CALL(q, video_copy_to_user, q, data, count, nonblocking); if (retval < 0) goto done; q->read_off += retval; if (q->read_off == q->read_buf->size) { /* all data copied, cleanup */ q->ops->buf_release(q, q->read_buf); kfree(q->read_buf); q->read_buf = NULL; } done: mutex_unlock(&q->vb_lock); return retval;}
开发者ID:mobilipia,项目名称:iods,代码行数:86,
示例28: glhckRenderFlip/* /brief set vertically flipped rendering mode */GLHCKAPI void glhckRenderFlip(int flip){ GLHCK_INITIALIZED(); CALL(2, "%d", flip); GLHCKRD()->view.flippedProjection = flip;}
开发者ID:Cloudef,项目名称:glhck,代码行数:7,
示例29: main//.........这里部分代码省略......... RET())() ); check_same("Macro simple loop", 30, Asm<int>( MOV(eax, 0_d), do_x_times(5_d, ADD(eax, 6_d)), RET())() ); check_same("Access arg using esp", 1, Asm<int>( MOV(eax, _[esp + 28_d]), RET())(1, 2, 3) ); check_same("Access arg using ebp", 1, Asm<int>( MOV(eax, _[ebp - 0xc_b]), RET())(1, 2, 3) ); check_same("Index ebp", 1, Asm<int>( MOV(ecx, 2_d), MOV(eax, _[ebp + ecx * 2_b - 0x10_d]), RET())(1, 2, 3) ); check_same("Access args using ebp", 5, Asm<int>( MOV(edx, 0_d), MOV(eax, _[ebp - 0xc_b]), MOV(ecx, _[ebp - 0x10_b]), DIV(ecx), MOV(ecx, _[ebp - 0x14_b]), DIV(ecx), RET())(100, 5, 4) ); check_same("Access arg with 64 bit reg", 2, Asm<int>( MOV(rax, _[rsp + 24_d]), RET())(1, 2, 3) ); check_same("Access second register zero", 1, Asm<int>( MOV(ecx, 0_d), MOV(eax, _[esp + 28_d + ecx]), RET())(1, 2, 3) ); check_same("Access second register with offset", 1, Asm<int>( MOV(ecx, 8_d), MOV(eax, _[esp + 20_d + ecx]), RET())(1, 2, 3) ); check_same("Access second register with offset and 1 scale", 1, Asm<int>( MOV(ecx, 8_d), MOV(eax, _[esp + 20_d + ecx * 1_b]), RET())(1, 2, 3) ); check_same("Access second register with offset and 4 scale", 1, Asm<int>( MOV(ecx, 2_d), MOV(eax, _[esp + 20_d + ecx * 4_b]), RET())(1, 2, 3) ); check_same("Call c function from assembly", 66, Asm<int>( MOV(rbx, _[rsp + 8_d]), CALL(rbx), RET())(&ret66) ); check_same("Call c function from esp directly", 66, Asm<int>( CALL(_[rsp + 8_d]), RET())(&ret66) ); check_same("Call c function from ebp directly", 66, Asm<int>( CALL(_[rbp - 0x10_d]), RET())(&ret66) ); // auto p = Asm<int>(CALL(_[rbp - 0xc_d])); // Print<decltype(p)::program> x{}; std::cout << "done" << std::endl; return 0;}
开发者ID:8l,项目名称:Template-Assembly,代码行数:101,
示例30: callHandlersOnFrame void callHandlersOnFrame() { CALL(onFrame()); }
开发者ID:AlloSphere-Research-Group,项目名称:alive,代码行数:1,
注:本文中的CALL函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ CALLBACK_WITH_FAILURE函数代码示例 C++ CALCULATE_Z_FLAG函数代码示例 |