这篇教程C++ ErrorPrint函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ErrorPrint函数的典型用法代码示例。如果您正苦于以下问题:C++ ErrorPrint函数的具体用法?C++ ErrorPrint怎么用?C++ ErrorPrint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ErrorPrint函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: MakeDirectoryvoidMakeDirectory(char *OutputFileName){#ifdef PLATFORM_WINDOWS if (!CreateDirectory(OutputFileName, 0)) { if (GetLastError() != ERROR_ALREADY_EXISTS) { ErrorPrint("Create directory %s failed/n", OutputFileName); } }#else if (mkdir(OutputFileName, 0755) < 0) { if (errno != EEXIST) { ErrorPrint("mkdir %s failed, errno = %d/n", OutputFileName, errno); } else { struct stat FileStatus; if (stat(OutputFileName, &FileStatus) < 0) { ErrorPrint("stat %s failed, errno = %d/n", OutputFileName, errno); } // TODO(wheatdog): Support symbolic link? if (!S_ISDIR(FileStatus.st_mode)) { ErrorPrint("%s existed and it is not a folder./n", OutputFileName); } } }#endif}
开发者ID:fierydrake,项目名称:HandmadeCompanion,代码行数:35,
示例2: whilebool NetReceiveOutputPin::addTransSocket(SOCKET sock){ int tryCount = 20 * 100; //尝试20秒 while (--tryCount > 0) { if (m_mt.majortype == GUID_NULL) { Sleep(10); } else break; } if (tryCount == 0) { return false; } if (!sendData(sock, (char*)&m_mt, sizeof(m_mt))) { ErrorPrint("Send media type error"); return false; } if (!sendData(sock, (char*)m_mt.pbFormat, m_mt.cbFormat)) { ErrorPrint("Send media format type error"); return false; } CAutoLock lock(&m_TransSocketListCrit); m_TransSocketList.push_back(sock); return true;}
开发者ID:dalinhuang,项目名称:networkprogram,代码行数:32,
示例3: ErrorPrintbool Connection::acceptConnection(int connfd){ if (mFd >= 0) { ErrorPrint("[acceptConnection] accept connetion error! the conn is in use!"); return false; } mFd = connfd; // set nonblocking if (!core::setNonblocking(mFd)) { ErrorPrint("[acceptConnection] set nonblocking error! %s", coreStrError()); goto err_1; } tryRegReadEvent(); mConnStatus = ConnStatus_Connected; return true;err_1: close(mFd); mFd = -1; return false;}
开发者ID:ruleless,项目名称:fasttun,代码行数:28,
示例4: CalibrationDataWriteAndVerifystatic int CalibrationDataWriteAndVerify(int address, unsigned char *buffer, int many){ int it; unsigned char check; switch(ar9300_calibration_data_get(AH)) { case calibration_data_flash:#ifdef MDK_AP { int fd; // UserPrint("Do block write /n"); // for(it=0;it<many;it++) // printf("a = %x, data = %x /n",(address-it), buffer[it]); if((fd = open("/dev/caldata", O_RDWR)) < 0) { perror("Could not open flash/n"); return 1 ; } for(it=0; it<many; it++) { lseek(fd, address-it, SEEK_SET); if (write(fd, &buffer[it], 1) < 1) { perror("/nwrite/n"); return -1; } } close(fd); } return 0;#endif case calibration_data_eeprom: for(it=0; it<many; it++) { Ar9300EepromWrite(address-it,&buffer[it],1); Ar9300EepromRead(address-it,&check,1); if(check!=buffer[it]) { ErrorPrint(EepromVerify,address-it,buffer[it],check); return -1; } } break; case calibration_data_otp: for(it=0; it<many; it++) { Ar9300OtpWrite(address-it,&buffer[it],1,1); Ar9300OtpRead(address-it,&check,1,1); if(check!=buffer[it]) { ErrorPrint(EepromVerify,address-it,buffer[it],check); return -1; } } break; return -1; } return 0;}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:60,
示例5: closesocketbool NetReceiveOutputPin::setSocket(SOCKET sock){ // CAutoLock lock(&m_SocketCrit); closesocket(m_Socket); m_Socket = sock; if (!receiveData(m_Socket, (char*)&m_mt, sizeof(m_mt))) { ErrorPrint("Receive media type error"); return false; } m_mt.pbFormat = (PBYTE)CoTaskMemAlloc(m_mt.cbFormat); if (!receiveData(m_Socket, (char*)m_mt.pbFormat, m_mt.cbFormat)) { ErrorPrint("Receive media format type error"); return false; } if(m_mt.majortype == MEDIATYPE_Video && m_mt.formattype == FORMAT_VideoInfo) { VIDEOINFOHEADER* videoHeader = (VIDEOINFOHEADER*)m_mt.pbFormat; videoHeader->bmiHeader.biSizeImage = videoHeader->bmiHeader.biWidth * videoHeader->bmiHeader.biHeight * videoHeader->bmiHeader.biBitCount / 8; m_mt.SetSampleSize(videoHeader->bmiHeader.biSizeImage); // tmp.pbFormat = (PBYTE)CoTaskMemAlloc(sizeof(VIDEOINFOHEADER)); // boost::scoped_array<char> formatBufferContainer((char*)tmp.pbFormat); } ReleaseSemaphore(m_SocketSema, 1, NULL); // 通知设置了新的socket return true;}
开发者ID:dalinhuang,项目名称:networkprogram,代码行数:32,
示例6: Helpint Help(char *name, void (*print)(char *buffer)){ char buffer[MBUFFER]; char start[MBUFFER]; int count; int found; if(print!=0) { count=0; found=0; if(HelpFile==0) { HelpOpen("nart.help"); } if(HelpFile!=0) { SformatOutput(start,MBUFFER-1,"<tag=%s>",name); buffer[MBUFFER-1]=0; HelpRewind(); // // look for start of documentation section, <tag=name> // while(HelpRead(buffer,MBUFFER-1)>=0) { if(Smatch(buffer,start)) { found=1; break; } } // // print all lines up to the next <tag=anything> // if(found) { ErrorPrint(ParseHelpDescriptionStart); while(HelpRead(buffer,MBUFFER-1)>=0) { if(strncmp(buffer,"<tag=",5)==0) { break; } ErrorPrint(ParseHelp,buffer); count++; } ErrorPrint(ParseHelpDescriptionEnd); return count; } } } return -1;}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:58,
示例7: shutdownbool Connection::connect(const SA *sa, socklen_t salen){ if (mFd >= 0) shutdown(); if (mFd >= 0) { ErrorPrint("[connect] accept connetion error! the conn is in use!"); return false; } mFd = socket(AF_INET, SOCK_STREAM, 0); if (mFd < 0) { ErrorPrint("[connect] create socket error! %s", coreStrError()); return false; } // set nonblocking if (!core::setNonblocking(mFd)) { ErrorPrint("[connect] set nonblocking error! %s", coreStrError()); goto err_1; } if (::connect(mFd, sa, salen) == 0) // 连接成功 { tryRegReadEvent(); mConnStatus = ConnStatus_Connected; if (mHandler) mHandler->onConnected(this); } else { if (errno == EINPROGRESS) { mConnStatus = ConnStatus_Connecting; tryRegWriteEvent(); } else { goto err_1; } } return true;err_1: close(mFd); mFd = -1; return false;}
开发者ID:ruleless,项目名称:fasttun,代码行数:53,
示例8: mainintmain( int argc, char **argv ){ LOG_FUNCTION_START(); LogPrint( "S2Sim Started" ); GetConnectionManager(); GetMatlabManager(); GetControlManager(); GetSystemManager(); auto iterationNumber = 0; GetControlManager().WaitUntilReady(); while ( 1 ) { try { GetSystemManager().AdvanceTimeStep(); } catch ( ... ) { ErrorPrint( "System Error, Exiting" ); break; } ++iterationNumber; LogPrint( "Time: ", iterationNumber ); } LOG_FUNCTION_END(); return ( EXIT_SUCCESS );}
开发者ID:asakyurek,项目名称:S2Sim,代码行数:32,
示例9: cnpkFlushSendDataint cnpkFlushSendData( CnpkCtx* pCnpk ){ int result = 0; char size_str[32]; if( pCnpk->flgProc ){ if( pCnpk->nBufSize > 0 ){ snprintf(size_str, 31, "%d", pCnpk->nBufSize); if( cnprocWriteCommand(pCnpk->pipe_fds, CNPK_ID_SEND_DATA, size_str, strlen(size_str)+1) == 0 ){ cnprocWriteData(pCnpk->pipe_fds, pCnpk->bufPDLData, pCnpk->nBufSize ); } if( (result = cnprocCheckResponse(pCnpk->pipe_fds, CNPK_ID_SEND_DATA, NULL, NULL)) == 0 ) pCnpk->nBufSize = 0; } if( cnprocWriteCommand(pCnpk->pipe_fds, CNPK_ID_FLUSH_SEND_DATA, NULL, 0) < 0 ){ ErrorPrint( "cnpklib -->cnpkFlushSendData/n"); goto write_error; } result = cnprocCheckResponse(pCnpk->pipe_fds, CNPK_ID_FLUSH_SEND_DATA, NULL, NULL); } return result; write_error: return CNPK_ERROR;}
开发者ID:random3231,项目名称:cndrvcups-lb,代码行数:31,
示例10: ExceptionFilterULONG ExceptionFilter ( _In_ PEXCEPTION_POINTERS ExceptionPointers )/*++Routine Description: ExceptionFilter breaks into the debugger if an exception happens inside the callback.Arguments: ExceptionPointers - unusedReturn Value: Always returns EXCEPTION_CONTINUE_SEARCH--*/{ ErrorPrint("Exception %lx, ExceptionPointers = %p", ExceptionPointers->ExceptionRecord->ExceptionCode, ExceptionPointers); DbgBreakPoint(); return EXCEPTION_EXECUTE_HANDLER;}
开发者ID:0xhack,项目名称:Windows-driver-samples,代码行数:31,
示例11: SformatOutput//// Returns a pointer to the specified function.//static void *CalibrationFunctionFind(char *prefix, char *function){ void *f; char buffer[MBUFFER]; if(osCheckLibraryHandle(CalibrationLibrary)!=0) { // // try adding the prefix in front of the name // SformatOutput(buffer,MBUFFER-1,"%s%s",prefix,function); buffer[MBUFFER-1]=0; f=osGetFunctionAddress(buffer,CalibrationLibrary); if(f==0) { // // try without the prefix in front of the name // f=osGetFunctionAddress(function,CalibrationLibrary); } return f; } ErrorPrint(CalibrationLoadBad,prefix,function); CalibrationUnload(); return 0;}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:35,
示例12: ErrorPrintbool CaptureAndSend::start(){ if (m_CurrentState == Running) { return true; } if (!m_NetSenderFilter->start()) { return false; } HRESULT hr = S_OK; IGraphBuilder* graphBuilder; hr = m_FilterGraph->QueryInterface(IID_IGraphBuilder, (void**)&graphBuilder); if (FAILED(hr)) { ErrorPrint("Get graph builder interface error",hr); return false; } ComReleaser graphBuilderReleaser(graphBuilder); IMediaControl* mediaControl; hr = m_FilterGraph->QueryInterface(IID_IMediaControl, (void**)&mediaControl); if(FAILED(hr)) { ErrorPrint("Get media control error", hr); return false; } ComReleaser mediaControlReleaser(mediaControl); hr = mediaControl->Run(); if(FAILED(hr)) { ErrorPrint("Run error",hr); return false; } if (m_CurrentState == Stopped) { g_StartCount++; } m_CurrentState = Running; return true;}
开发者ID:dalinhuang,项目名称:networkprogram,代码行数:47,
示例13: DetectOSVersionVOIDDetectOSVersion()/*++Routine Description: This routine determines the OS version and initializes some globals used in the sample. Arguments: None Return value: None. On failure, global variables stay at default value--*/{ RTL_OSVERSIONINFOEXW VersionInfo = {0}; NTSTATUS Status; ULONGLONG ConditionMask = 0; // // Set VersionInfo to Win7's version number and then use // RtlVerifVersionInfo to see if this is win8 or greater. // VersionInfo.dwOSVersionInfoSize = sizeof(VersionInfo); VersionInfo.dwMajorVersion = 6; VersionInfo.dwMinorVersion = 1; VER_SET_CONDITION(ConditionMask, VER_MAJORVERSION, VER_LESS_EQUAL); VER_SET_CONDITION(ConditionMask, VER_MINORVERSION, VER_LESS_EQUAL); Status = RtlVerifyVersionInfo(&VersionInfo, VER_MAJORVERSION | VER_MINORVERSION, ConditionMask); if (NT_SUCCESS(Status)) { g_IsWin8OrGreater = FALSE; InfoPrint("DetectOSVersion: This machine is running Windows 7 or an older OS."); } else if (Status == STATUS_REVISION_MISMATCH) { g_IsWin8OrGreater = TRUE; InfoPrint("DetectOSVersion: This machine is running Windows 8 or a newer OS."); } else { ErrorPrint("RtlVerifyVersionInfo returned unexpected error status 0x%x.", Status); // // default action is to assume this is not win8 // g_IsWin8OrGreater = FALSE; } }
开发者ID:HDM1991,项目名称:ExampleLearn,代码行数:58,
示例14: m_FilterGraphCaptureAndSend::CaptureAndSend(IFilterGraph* filterGraph, IPin* capturePin):m_FilterGraph(filterGraph),m_CapturePin(capturePin),m_CurrentState(Stopped){ if (!initialCaptureAndSend()) { ErrorPrint("Initial Capture and send error"); throw std::runtime_error("Initial capture and send error"); }}
开发者ID:dalinhuang,项目名称:networkprogram,代码行数:11,
示例15: CalibrationGetCommandint CalibrationGetCommand(int client){ if(osCheckLibraryHandle(CalibrationLibrary)==0) { ErrorPrint(CalibrationMissing); return -1; } if(_CalGetCommand!=0) { _CalGetCommand(client); } else { ErrorPrint(CalibrationNoFunction,"Calibration_GetCommand"); return -1; } return 0;}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:20,
示例16: print9300_Header_newItemsvoid print9300_Header_newItems(int client, const ar9300_eeprom_t *ahp_Eeprom, int iBand){ char eepItemName[100], eepItemValue[100]; int itemNum; int emptyRight = 1; // print for ar9300Eeprom_switchcomspdt lc=0; itemNum = get_num_switchcomspdt(); if (itemNum>0) { get_switchcomspdt(eepItemName, eepItemValue, itemNum-1, ahp_Eeprom, iBand); print9300_half_Line(eepItemName, eepItemValue, 1);// print9300_lineEnd(emptyRight); // for second item // print9300_half_Line(eepItemName, eepItemValue, 0);// print9300_lineEnd(0); } itemNum = get_num_xLNABiasStrength(); if (itemNum>0) { get_xLNABiasStrength(eepItemName, eepItemValue, itemNum-1, ahp_Eeprom, iBand); print9300_half_Line(eepItemName, eepItemValue, 0); print9300_lineEnd(0); } itemNum = get_num_rfGainCap(); if (itemNum>0) { get_rfGainCap(eepItemName, eepItemValue, itemNum-1, ahp_Eeprom, iBand); print9300_half_Line(eepItemName, eepItemValue, 1); } itemNum = get_num_txGainCap(); if (itemNum>0) { get_txGainCap(eepItemName, eepItemValue, itemNum-1, ahp_Eeprom, iBand); print9300_half_Line(eepItemName, eepItemValue, 0); print9300_lineEnd(0); } if(iBand == band_A){ // print for ar9300Eeprom_tempslopextension lc=0; itemNum = get_num_tempslopextension(); if (itemNum>0) { get_tempslopextension(eepItemName, eepItemValue, itemNum-1, ahp_Eeprom); print9300_whole_Line(eepItemName, eepItemValue); } } // print a space line at the end of header print SformatOutput(buffer, MBUFFER-1," | | |"); ErrorPrint(NartOther,buffer);}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:53,
示例17: HCWarningvoid HCWarning( int err_num, ... ){ ErrString string = err_strings[err_num]; va_list values; fputc( '/n', stderr ); va_start( values, err_num ); ErrorPrint( stderr, string, values ); va_end( values ); return;}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:12,
示例18: UtilOpenDeviceBOOL UtilOpenDevice( _In_ LPTSTR szWin32DeviceName, _Out_ HANDLE *phDevice )/*++Routine Description: Opens a deviceArguments: szWin32DeviceName - name of the device phDevice - pointer to a variable that receives the handle to the deviceReturn Value: TRUE if the device is successfully opened, FALSE otherwise.--*/{ BOOL ReturnValue = FALSE; HANDLE hDevice; // // Open the device // hDevice = CreateFile ( szWin32DeviceName, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hDevice == INVALID_HANDLE_VALUE) { ErrorPrint("CreateFile(%ls) failed, last error 0x%x", szWin32DeviceName, GetLastError() ); goto Exit; } ReturnValue = TRUE;Exit: *phDevice = hDevice; return ReturnValue;}
开发者ID:340211173,项目名称:Windows-driver-samples,代码行数:53,
示例19: SleepModeCommandvoid SleepModeCommand(int client){ int error; char *name; int np, ip, ngot; int value, selection; // // prepare beginning of error message in case we need to use it // error=0; // //parse arguments and do it // np=CommandParameterMany(); for(ip=0; ip<np; ip++) { name=CommandParameterName(ip); if (strlen(name)==0) continue; // sometime there are tab or space at the end count as np with name as "", skip it selection=ParameterSelect(name,SleepModeParameter,sizeof(SleepModeParameter)/sizeof(SleepModeParameter[0])); switch(selection) { case SleepMode: ngot=SformatInput(CommandParameterValue(ip,0)," %d ",&value); if(ngot != 1 || (value < SleepModeMin || value > SleepModeMax)) { ErrorPrint(ParseBadValue, CommandParameterValue(value, 0),"mode"); error++; } break; default: break; } } if (error == 0) { if (CurrentSleepMode == value) { UserPrint("The device is currently in %s mode./n", (value == SLEEP_MODE_SLEEP ? "sleep" : (value == SLEEP_MODE_WAKEUP ? "wakeup" : "deep sleep"))); } else { SendOn(client); DeviceSleepMode(value); SendOff(client); CurrentSleepMode = value; } } SendDone(client);}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:52,
示例20: CalibrationSetCommandint CalibrationSetCommand(int client){ char *name, *calDllName; int np, index; // Check if the command is dll load first. np=CommandParameterMany(); name=CommandParameterName(0); index=ParameterSelectIndex(name,&calDllLoadParameter,1); if(index == 0) { calDllName=CommandParameterValue(0,0); if(CalibrationLoad(calDllName)!=0) { return -1; } return 1; } // Following part will handle different cal parameter set commands // First check if calibration dll was loaded before. if(osCheckLibraryHandle(CalibrationLibrary)==0) { ErrorPrint(CalibrationMissing); return -1; } if(_CalSetCommand!=0) { _CalSetCommand(client); } else { ErrorPrint(CalibrationNoFunction,"Calibration_SetCommand"); return -1; } return 0;}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:39,
示例21: htonsbool Connection::connect(const char *ip, int port){ struct sockaddr_in remoteAddr; remoteAddr.sin_family = AF_INET; remoteAddr.sin_port = htons(port); if (inet_pton(AF_INET, ip, &remoteAddr.sin_addr) < 0) { ErrorPrint("[connect] illegal ip(%s)", ip); return false; } return connect((const SA *)&remoteAddr, sizeof(remoteAddr));}
开发者ID:ruleless,项目名称:fasttun,代码行数:13,
示例22: HCErrorvoid HCError( int err_num, ... ){ ErrString string = err_strings[err_num]; va_list values; fputc( '/n', stderr ); va_start( values, err_num ); ErrorPrint( stderr, string, values ); va_end( values ); // Throw an exception to jump back to main(). throw HCException();}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:13,
示例23: FindAndRemoveCallbackContextPCALLBACK_CONTEXTFindAndRemoveCallbackContext( _In_ LARGE_INTEGER Cookie )/*++Routine Description: Utility method to find a callback context using the cookie value and then remove it. Arguments: Cookie - the cookie value associated with the callback context. The cookie is returned when CmRegisterCallbackEx is called.Return Value: Pointer to the found callback context--*/{ PCALLBACK_CONTEXT CallbackCtx = NULL; PLIST_ENTRY Entry; ExAcquireFastMutex(&g_CallbackCtxListLock); Entry = g_CallbackCtxListHead.Flink; while (Entry != &g_CallbackCtxListHead) { CallbackCtx = CONTAINING_RECORD(Entry, CALLBACK_CONTEXT, CallbackCtxList); if (CallbackCtx->Cookie.QuadPart == Cookie.QuadPart) { RemoveEntryList(&CallbackCtx->CallbackCtxList); g_NumCallbackCtxListEntries--; break; } } ExReleaseFastMutex(&g_CallbackCtxListLock); if (CallbackCtx == NULL) { ErrorPrint("FindAndRemoveCallbackContext failed: No context with specified cookied was found."); } return CallbackCtx; }
开发者ID:0xhack,项目名称:Windows-driver-samples,代码行数:49,
示例24: print9300_lineEndvoid print9300_lineEnd(int emptyRight){ int i=0; // fill the space for right side of the line if (emptyRight==1) { nc = SformatOutput(&buffer[lc],MBUFFER-lc-1,"|"); lc+=nc; for (i=0; i<TOTAL_SPACE; i++) { nc = SformatOutput(&buffer[lc],MBUFFER-lc-1," "); lc+=nc; } } nc = SformatOutput(&buffer[lc],MBUFFER-lc-1,"|/n"); ErrorPrint(NartOther, buffer); lc=0;}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:16,
示例25: cnpkNextPageint cnpkNextPage( CnpkCtx* pCnpk ){ int result = 0;#ifdef DEBUG_MESSAGE fputs("DEBUG: cnpkNextPage/n", stderr);#endif if( pCnpk->flgProc ){ if( pCnpk->nBufSize > 0 ){ char size_str[32]; snprintf(size_str, 31, "%d", pCnpk->nBufSize); if( cnprocWriteCommand(pCnpk->pipe_fds, CNPK_ID_SEND_DATA, size_str, strlen(size_str)+1) == 0 ){ cnprocWriteData(pCnpk->pipe_fds, pCnpk->bufPDLData, pCnpk->nBufSize); if( (result=cnprocCheckResponse(pCnpk->pipe_fds, CNPK_ID_SEND_DATA, NULL, NULL)) == 0 ) pCnpk->nBufSize = 0; else goto flush_error; } } if( cnprocWriteCommand(pCnpk->pipe_fds, CNPK_ID_NEXT_PAGE, NULL, 0) < 0 ){ ErrorPrint( "cnpklib -->cnpkNextPage/n"); goto write_error; } result = cnprocCheckResponse(pCnpk->pipe_fds, CNPK_ID_NEXT_PAGE, NULL, NULL); }else{ pCnpk->numPage++; } return result; flush_error: write_error: return CNPK_ERROR;}
开发者ID:random3231,项目名称:cndrvcups-lb,代码行数:47,
示例26: LOG_FUNCTION_STARTvoidThreadedTCPServer::SetNotificationCallback( TNotification notification ){ LOG_FUNCTION_START(); if ( this->m_notification != nullptr && this->m_started ) { ErrorPrint( "Multiple notification callbacks not allowed" ); } this->m_notification = notification; if ( this->m_notification != nullptr ) { this->m_started = true; this->Listen(); this->m_thread = std::thread( &ThreadedTCPServer::ExecutionBody, this ); this->m_thread.detach(); } LOG_FUNCTION_END();}
开发者ID:asakyurek,项目名称:S2Sim,代码行数:18,
示例27: UtilGetServiceStateBOOL UtilGetServiceState ( _In_ SC_HANDLE hService, _Out_ DWORD* State )/*++Routine Description: Gets the state of the service using QueryServiceStatusExArguments: hService - handle to the service to query State - pointer to a variable that receives the stateReturn Value: TRUE if service is queried successfully.--*/{ SERVICE_STATUS_PROCESS ServiceStatus; DWORD BytesNeeded; BOOL Result; *State = 0; Result = QueryServiceStatusEx ( hService, SC_STATUS_PROCESS_INFO, (LPBYTE)&ServiceStatus, sizeof(ServiceStatus), &BytesNeeded); if (Result == FALSE) { ErrorPrint("QueryServiceStatusEx failed, last error 0x%x", GetLastError()); return FALSE; } *State = ServiceStatus.dwCurrentState; return TRUE;}
开发者ID:340211173,项目名称:Windows-driver-samples,代码行数:44,
示例28: Py_DECREFbool SCA_PythonController::Compile(){ m_bModified= false; // if a script already exists, decref it before replace the pointer to a new script if (m_bytecode) { Py_DECREF(m_bytecode); m_bytecode=NULL; } // recompile the scripttext into bytecode m_bytecode = Py_CompileString(m_scriptText.c_str(), m_scriptName.c_str(), Py_file_input); if (m_bytecode) { return true; } else { ErrorPrint("Python error compiling script"); return false; }}
开发者ID:UPBGE,项目名称:blender,代码行数:20,
注:本文中的ErrorPrint函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ErrorToException函数代码示例 C++ ErrorMessageBox函数代码示例 |