您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ DebugMsg函数代码示例

51自学网 2021-06-01 20:25:44
  C++
这篇教程C++ DebugMsg函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中DebugMsg函数的典型用法代码示例。如果您正苦于以下问题:C++ DebugMsg函数的具体用法?C++ DebugMsg怎么用?C++ DebugMsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了DebugMsg函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: IsPackageTrusted

itvEnum IsPackageTrusted(LPCSTR szSetupExe, LPCSTR szPackage, HWND hwndParent){    WCHAR *szwSetup   = 0;    WCHAR *szwPackage = 0;    int   cchWide     = 0;    bool    fPackageIsTrusted = false;    bool    fSetupExeIsSigned = false;    bool    fPackageIsSigned  = false;    itvEnum itv               = itvUnTrusted;    DWORD dwUILevel = 0;    char szDebugOutput[MAX_STR_LENGTH] = {0};    PCCERT_CONTEXT pcExeSigner = 0;    PCCERT_CONTEXT pcMsiSigner = 0;    HMODULE hCrypt32 = LoadLibrary(CRYPT32_DLL);    if (!hCrypt32)    {        // no crypto on the machine        return itvWintrustNotOnMachine;    }    PFnCertCompareCertificate pfnCertCompareCertificate = (PFnCertCompareCertificate)GetProcAddress(hCrypt32, CRYPTOAPI_CertCompareCertificate);    PFnCertFreeCertificateContext pfnCertFreeCertificateContext = (PFnCertFreeCertificateContext)GetProcAddress(hCrypt32, CRYPTOAPI_CertFreeCertificateContext);    if (!pfnCertCompareCertificate || !pfnCertFreeCertificateContext)    {        // no crypt on the machine        FreeLibrary(hCrypt32);        return itvWintrustNotOnMachine;    }    // convert szSetupExe to WIDE    cchWide = MultiByteToWideChar(CP_ACP, 0, szSetupExe, -1, 0, 0);    szwSetup = new WCHAR[cchWide];    if (!szwSetup)    {        // out of memory        FreeLibrary(hCrypt32);        return itvUnTrusted;    }    if (0 == MultiByteToWideChar(CP_ACP, 0, szSetupExe, -1, szwSetup, cchWide))    {        // failed to convert string        FreeLibrary(hCrypt32);        delete [] szwSetup;        return itvUnTrusted;    }    //    // step 1: silently call WinVerifyTrust on szSetupExe, ignore return value - except for ivtWintrustNotOnMachine    //    DebugMsg("[WVT] step 1: silently call WinVerifyTrust on szSetupExe, ignoring return value/n");    if (itvWintrustNotOnMachine == (itv = IsFileTrusted(szwSetup, hwndParent, WTD_UI_NONE, &fSetupExeIsSigned, &pcExeSigner)))    {        goto CleanUp;    }    DebugMsg("[WVT] fSetupExeIsSigned = %s/n", fSetupExeIsSigned ? "TRUE" : "FALSE");    // convert szPackage to WIDE    cchWide = MultiByteToWideChar(CP_ACP, 0, szPackage, -1, 0, 0);    szwPackage = new WCHAR[cchWide];    if (!szwPackage)    {        // out of memory        FreeLibrary(hCrypt32);        return itvUnTrusted;    }    if (0 == MultiByteToWideChar(CP_ACP, 0, szPackage, -1, szwPackage, cchWide))    {        // failed to convert string        FreeLibrary(hCrypt32);        return itvUnTrusted;    }    //    // step 2: silently call WinVerifyTrust on szPackage, ignore return value - except for ivtWintrustNotOnMachine    //    if (fSetupExeIsSigned)    {        DebugMsg("[WVT] step2: silently call WinVerifyTrust on szPackage, ignoring return value/n");        if (itvWintrustNotOnMachine == (itv = IsFileTrusted(szwPackage, hwndParent, WTD_UI_NONE, &fPackageIsSigned, &pcMsiSigner)))        {            goto CleanUp;        }        DebugMsg("[WVT] fPackageIsSigned = %s/n", fPackageIsSigned ? "TRUE" : "FALSE");    }    //    // step 3: call WinVerifyTrust on szPackage, return value matters; use proper UI-level    //    if ( !fSetupExeIsSigned  // exe is not signed        || !fPackageIsSigned // package is not signed//.........这里部分代码省略.........
开发者ID:Ippei-Murofushi,项目名称:WindowsSDK7-Samples,代码行数:101,


示例2: WriteNativeRecord

intWriteNativeRecord(FieldSpec **fields,                  FILE      *file){   long    i;   long    nopt;   Uchar   flags;   if (file == NULL || fields == NULL)      {         DebugMsg(1, "WriteNativeRecord: NULL argument.");         return FALSE;      }   /*! If FieldOrder & TypeOrder returned a linear array of OPTIONAL    * fields as well as the array of REQUIRED & OPTIONAL, we could    * avoid scanning all of "fields" checking for OPTIONAL entries    * for every record written. */   nopt = 0;   flags = 0;   for (i = 0; fields[i] != NULL; i++)      {         if (fields[i]->occurrence == OPTIONAL)            {               flags |= fields[i]->present;               nopt++;               if (nopt % 8 == 0)                  {                     if (fwrite(&flags, 1, 1, file) != 1)                        {                           DebugMsg(1, ("WriteNativeRecord:  couldn't write "                                        "/"presence/" flag for OPTIONAL field."));                           return FALSE;                        }                     flags = 0;                  }               else                  flags <<= 1;            }      }   if (nopt % 8 != 0)      {         flags <<= (7 - nopt % 8);         if (fwrite(&flags, 1, 1, file) != 1)            {               DebugMsg(1, ("WriteNativeRecord: couldn't write "                            "/"presence/" flags for OPTIONAL fields."));               return FALSE;            }      }   for (i = 0; fields[i] != NULL; i++)      {         if (fields[i]->occurrence == REQUIRED || fields[i]->present)            {               if (!WriteNativeData(fields[i], file))                  {                     DebugMsg(1, "WriteNativeRecord: couldn't write field data.");                     return FALSE;                  }            }      }   return TRUE;}
开发者ID:lovecpp2014,项目名称:htk-kenlm,代码行数:72,


示例3: DebugMsg

// ---------------------------------------------------------------------------// VComponentManager::RegisterComponentLibrary						[static]// ---------------------------------------------------------------------------// Load all component creators from a given library. Make sure that the// library exports the VComponentLibrary interface.//VError VComponentManager::RegisterComponentLibrary( const VFilePath& inLibraryFile){	DebugMsg("VComponentManager load %V/n", &inLibraryFile.GetPath());	if (!IsInitialized())		return vThrowError(VE_COMP_UNITIALISED);		VError	error = VE_OK;		VLibrary*	library;	VArrayIteratorOf<VLibrary*>	iterator(*sComponentLibraries);		// Iterate through libraries	while ((library = iterator.Next()) != NULL)	{		if (library->IsSameFile(inLibraryFile))		{			error = vThrowError(VE_COMP_ALLREADY_REGISTRED);			break;		}	}		if (library == NULL)	{		library = new VLibrary(inLibraryFile);				if (library != NULL)		{			if (!library->Load())			{				error = vThrowError(VE_COMP_CANNOT_LOAD_LIBRARY);				library->Release();				library = NULL;			}		}				if (library != NULL)		{			// Make sure the library export the needed interface			MainProcPtr	mainPtr = (MainProcPtr) library->GetProcAddress(kDEFAULT_MAIN_SYMBOL);			GetNthComponentTypeProcPtr	fetchPtr = (GetNthComponentTypeProcPtr) library->GetProcAddress(kDEFAULT_GET_TYPES_SYMBOL);			CreateComponentProcPtr	creatorPtr = (CreateComponentProcPtr) library->GetProcAddress(kDEFAULT_CREATE_SYMBOL);						// Fetch all implemented components			if (creatorPtr != NULL && fetchPtr != NULL && mainPtr != NULL)			{				sAccessingTypes->Lock();				sAccessingChecked->Lock();								(mainPtr)(kDLL_EVENT_REGISTER, library);									CType	newType;				sLONG	index = 1;				while ((fetchPtr)(index, newType))				{					VIndex	oldPos = sComponentTypes->FindPos(newType);					if (oldPos > 0)					{						// Assumes its allready installed using ProcPtr						assert(sComponentProcs->GetNth(oldPos) != NULL);						assert(sComponentLibraries->GetNth(oldPos) == NULL);												sComponentLibraries->SetNth(library, oldPos);					}					else					{						// Add entries						sComponentLibraries->AddTail(library);						sComponentProcs->AddTail(NULL);						sComponentTypes->AddTail(newType);					}										// Increment library refcount for each type					library->Retain();										index++;							// Reset checking for unavailable components					ResetComponentRequirements(newType, false);				}								sAccessingChecked->Unlock();				sAccessingTypes->Unlock();			}			else			{				error = VE_COMP_BAD_LIBRARY_TYPE;			}						// Release library ('new' balance)			library->Release();		}		else		{			error = VE_MEMORY_FULL;//.........这里部分代码省略.........
开发者ID:sanyaade-iot,项目名称:core-XToolbox,代码行数:101,


示例4: F3D_Reserved0

void F3D_Reserved0( u32 w0, u32 w1 ){#ifdef DEBUG	DebugMsg( DEBUG_MEDIUM | DEBUG_IGNORED | DEBUG_UNKNOWN, "G_RESERVED0: w0=0x%08lX w1=0x%08lX/n", w0, w1 );#endif}
开发者ID:DusterTheThief2,项目名称:mupen64gc,代码行数:6,


示例5: ReadInClothesStats

BOOLEAN ReadInClothesStats(STR fileName){	HWFILE		hFile;	UINT32		uiBytesRead;	UINT32		uiFSize;	CHAR8 *		lpcBuffer;	XML_Parser	parser = XML_ParserCreate(NULL);	clothesParseData pData;	DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading Clothes.xml" );	// Open clothess file	hFile = FileOpen( fileName, FILE_ACCESS_READ, FALSE );	if ( !hFile )		return( FALSE );	uiFSize = FileGetSize(hFile);	lpcBuffer = (CHAR8 *) MemAlloc(uiFSize+1);	//Read in block	if ( !FileRead( hFile, lpcBuffer, uiFSize, &uiBytesRead ) )	{		MemFree(lpcBuffer);		return( FALSE );	}	lpcBuffer[uiFSize] = 0; //add a null terminator	FileClose( hFile );	XML_SetElementHandler(parser, clothesStartElementHandle, clothesEndElementHandle);	XML_SetCharacterDataHandler(parser, clothesCharacterDataHandle);	memset(&pData,0,sizeof(pData));	pData.curArray = Clothes;	pData.maxArraySize = CLOTHES_MAX;	XML_SetUserData(parser, &pData);	if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))	{		CHAR8 errorBuf[511];		sprintf(errorBuf, "XML Parser Error in Clothes.xml: %s at line %d", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser));		LiveMessage(errorBuf);		MemFree(lpcBuffer);		return FALSE;	}	MemFree(lpcBuffer);	XML_ParserFree(parser);	return( TRUE );}
开发者ID:RadekSimkanic,项目名称:JA2-1.13,代码行数:62,


示例6: RSP_ProcessDList

void RSP_ProcessDList(){    VI_UpdateSize();    OGL_UpdateScale();    RSP.PC[0] = *(u32*)&DMEM[0x0FF0];    RSP.PCi = 0;    RSP.count = 0;    RSP.halt = FALSE;    RSP.busy = TRUE;    gSP.matrix.stackSize = min( 32, *(u32*)&DMEM[0x0FE4] >> 6 );    gSP.matrix.modelViewi = 0;    gSP.changed |= CHANGED_MATRIX;    for (int i = 0; i < 4; i++)        for (int j = 0; j < 4; j++)            gSP.matrix.modelView[0][i][j] = 0.0f;    gSP.matrix.modelView[0][0][0] = 1.0f;    gSP.matrix.modelView[0][1][1] = 1.0f;    gSP.matrix.modelView[0][2][2] = 1.0f;    gSP.matrix.modelView[0][3][3] = 1.0f;    u32 uc_start = *(u32*)&DMEM[0x0FD0];    u32 uc_dstart = *(u32*)&DMEM[0x0FD8];    u32 uc_dsize = *(u32*)&DMEM[0x0FDC];    if ((uc_start != RSP.uc_start) || (uc_dstart != RSP.uc_dstart))        gSPLoadUcodeEx( uc_start, uc_dstart, uc_dsize );    gDPSetAlphaCompare( G_AC_NONE );    gDPSetDepthSource( G_ZS_PIXEL );    gDPSetRenderMode( 0, 0 );    gDPSetAlphaDither( G_AD_DISABLE );    gDPSetColorDither( G_CD_DISABLE );    gDPSetCombineKey( G_CK_NONE );    gDPSetTextureConvert( G_TC_FILT );    gDPSetTextureFilter( G_TF_POINT );    gDPSetTextureLUT( G_TT_NONE );    gDPSetTextureLOD( G_TL_TILE );    gDPSetTextureDetail( G_TD_CLAMP );    gDPSetTexturePersp( G_TP_PERSP );    gDPSetCycleType( G_CYC_1CYCLE );    gDPPipelineMode( G_PM_NPRIMITIVE );    while (!RSP.halt)    {        if ((RSP.PC[RSP.PCi] + 8) > RDRAMSize)        {#ifdef DEBUG            switch (Debug.level)            {            case DEBUG_LOW:                DebugMsg( DEBUG_LOW | DEBUG_ERROR, "ATTEMPTING TO EXECUTE RSP COMMAND AT INVALID RDRAM LOCATION/n" );                break;            case DEBUG_MEDIUM:                DebugMsg( DEBUG_MEDIUM | DEBUG_ERROR, "Attempting to execute RSP command at invalid RDRAM location/n" );                break;            case DEBUG_HIGH:                DebugMsg( DEBUG_HIGH | DEBUG_ERROR, "// Attempting to execute RSP command at invalid RDRAM location/n" );                break;            }#endif            break;        }//		printf( "!!!!!! RDRAM = 0x%8.8x/n", RDRAM );//RSP.PC[RSP.PCi] );        /*		{        			static u8 *lastRDRAM = 0;        			if (lastRDRAM == 0)        				lastRDRAM = RDRAM;        			if (RDRAM != lastRDRAM)        			{        				__asm__( "int $3" );        			}        		}*/        u32 w0 = *(u32*)&RDRAM[RSP.PC[RSP.PCi]];        u32 w1 = *(u32*)&RDRAM[RSP.PC[RSP.PCi] + 4];        RSP.cmd = _SHIFTR( w0, 24, 8 );#ifdef DEBUG        DebugRSPState( RSP.PCi, RSP.PC[RSP.PCi], _SHIFTR( w0, 24, 8 ), w0, w1 );        DebugMsg( DEBUG_LOW | DEBUG_HANDLED, "0x%08lX: CMD=0x%02lX W0=0x%08lX W1=0x%08lX/n", RSP.PC[RSP.PCi], _SHIFTR( w0, 24, 8 ), w0, w1 );#endif        RSP.PC[RSP.PCi] += 8;        RSP.nextCmd = _SHIFTR( *(u32*)&RDRAM[RSP.PC[RSP.PCi]], 24, 8 );        GBI.cmd[RSP.cmd]( w0, w1 );    }    /*	if (OGL.frameBufferTextures && gDP.colorImage.changed)    	{    		FrameBuffer_SaveBuffer( gDP.colorImage.address, gDP.colorImage.size, gDP.colorImage.width, gDP.colorImage.height );    		gDP.colorImage.changed = FALSE;    	}*/    RSP.busy = FALSE;//.........这里部分代码省略.........
开发者ID:purplemarshmallow,项目名称:glN64-history,代码行数:101,


示例7: RSP_ProcessDList

void RSP_ProcessDList(void){   int i, j;   u32 uc_start, uc_dstart, uc_dsize;   __RSP.PC[0] = *(u32*)&gfx_info.DMEM[0x0FF0];   __RSP.PCi   = 0;   __RSP.count = -1;   __RSP.halt  = FALSE;   __RSP.busy  = TRUE;   gSP.matrix.stackSize = min( 32, *(u32*)&gfx_info.DMEM[0x0FE4] >> 6 );   gSP.matrix.modelViewi = 0;   gSP.changed &= ~CHANGED_CPU_FB_WRITE;   gSP.changed |= CHANGED_MATRIX;   gDPSetTexturePersp(G_TP_PERSP);   for (i = 0; i < 4; i++)      for (j = 0; j < 4; j++)         gSP.matrix.modelView[0][i][j] = 0.0f;   gSP.matrix.modelView[0][0][0] = 1.0f;   gSP.matrix.modelView[0][1][1] = 1.0f;   gSP.matrix.modelView[0][2][2] = 1.0f;   gSP.matrix.modelView[0][3][3] = 1.0f;   uc_start = *(u32*)&gfx_info.DMEM[0x0FD0];   uc_dstart = *(u32*)&gfx_info.DMEM[0x0FD8];   uc_dsize = *(u32*)&gfx_info.DMEM[0x0FDC];   if ((uc_start != __RSP.uc_start) || (uc_dstart != __RSP.uc_dstart))      gSPLoadUcodeEx( uc_start, uc_dstart, uc_dsize );   gDPSetCombineKey(G_CK_NONE);   gDPSetTextureLUT(G_TT_NONE);   gDPSetTexturePersp(G_TP_PERSP);   gDPSetCycleType(G_CYC_1CYCLE);#ifdef NEW	depthBufferList().setNotCleared();#endif   if (GBI_GetCurrentMicrocodeType() == Turbo3D)	   RunTurbo3D();   else      while (!__RSP.halt)      {         u32 w0, w1, pc;         pc = __RSP.PC[__RSP.PCi];         if ((pc + 8) > RDRAMSize)         {#ifdef DEBUG            DebugMsg( DEBUG_LOW | DEBUG_ERROR, "ATTEMPTING TO EXECUTE RSP COMMAND AT INVALID RDRAM LOCATION/n" );#endif            break;         }         w0 = *(u32*)&gfx_info.RDRAM[pc];         w1 = *(u32*)&gfx_info.RDRAM[pc+4];         __RSP.cmd = _SHIFTR( w0, 24, 8 );#ifdef DEBUG         DebugRSPState( RSP.PCi, RSP.PC[RSP.PCi], _SHIFTR( w0, 24, 8 ), w0, w1 );         DebugMsg( DEBUG_LOW | DEBUG_HANDLED, "0x%08lX: CMD=0x%02lX W0=0x%08lX W1=0x%08lX/n", RSP.PC[RSP.PCi], _SHIFTR( w0, 24, 8 ), w0, w1 );#endif         __RSP.PC[__RSP.PCi] += 8;         __RSP.nextCmd = _SHIFTR( *(u32*)&gfx_info.RDRAM[pc+8], 24, 8 );         GBI.cmd[__RSP.cmd]( w0, w1 );         RSP_CheckDLCounter();      }   if (config.frameBufferEmulation.copyToRDRAM)	   FrameBuffer_CopyToRDRAM( gDP.colorImage.address );   if (config.frameBufferEmulation.copyDepthToRDRAM)	   FrameBuffer_CopyDepthBuffer( gDP.colorImage.address );   __RSP.busy = FALSE;   gSP.changed |= CHANGED_COLORBUFFER;}
开发者ID:a1rwulf,项目名称:mupen64plus-libretro,代码行数:83,


示例8: xbox_assert

XBOX::VError VHTTPWebsocketHandler::ReadMessage( void* inData, uLONG* ioLength, bool* outIsTerminated ){	bool			l_header_found;	uLONG			length;	VError			l_err;	if (!fEndpt)	{		xbox_assert((fEndpt != NULL));		return VE_INVALID_PARAMETER;	}	l_err = VE_OK;	if (!fBytesToRead)	{		l_err = ReadHeader(&l_header_found);		if (l_err)		{			DebugMsg("ERR2/n");		}		if (!l_err && !l_header_found)		{			*ioLength = 0;		}		// not fragmented ?		if (!l_err && (*ioLength) && (fFrame.header[0] & 0x80))		{			fBytesToRead = fFrame.len;			fCurt = XBOX_LONG8(0);			switch(fFrame.opcode)			{				case CONTINUATION_FRAME:					DebugMsg("ERR3/n");					l_err = VE_UNIMPLEMENTED;					break;				case CONNEXION_CLOSE:					if (fFrame.len >= 126)					{						DebugMsg("ERR4/n");						l_err = VE_INVALID_PARAMETER;					}					else					{						l_err = VE_STREAM_EOF;					/*// close the socket					goto NOK;					while (!l_err && (fBytesToRead > 0))					{						length = (uLONG)( *ioLength >=fBytesToRead ? fBytesToRead : *ioLength);						l_err = ReadBytes(inData,&length);						if (l_err)						{							DebugMsg("ERR 5/n");						}						else						{							fBytesToRead -= length;							*ioLength = length;						}					}*/					}					break;				case TEXT_FRAME:				case BIN_FRAME:					break;				default:					break;			}		}		else		{			if (!l_err && *(ioLength) )			{				DebugMsg("Fragmentation not handled ERR6/n");			}		}	}	//DebugMsg("ReadMessage req_len=%d ToRead=%lld/n",*ioLength,fBytesToRead);	if (!l_err && fBytesToRead)	{//printf("...... bef ReadMessage req_len=%d ToRead=%lld/n",*ioLength,fBytesToRead);		*ioLength = ( *ioLength >=fBytesToRead ? ((uLONG)fBytesToRead) : *ioLength);//printf("...... aft ReadMessage req_len=%d ToRead=%lld/n",*ioLength,fBytesToRead);		l_err = ReadBytes(inData,ioLength);		if (l_err)		{			DebugMsg("ERR1/n");		}		else		{			fBytesToRead -= *ioLength;//printf("...... ....... aft ReadMessage read_len=%d ToRead=%lld/n",*ioLength,fBytesToRead);			if (fFrame.masked)			{				for(uLONG l_i=0; l_i<*ioLength; l_i++)				{					((unsigned char *)inData)[l_i] ^= fFrame.msk[fCurt % 4];//.........这里部分代码省略.........
开发者ID:sanyaade-webdev,项目名称:core-Components,代码行数:101,


示例9: WriteBytes

XBOX::VError VHTTPWebsocketHandler::WriteMessage( const void* inData, VSize inLength, bool inIsTerminated  ){	XBOX::VError	l_err;	unsigned char	l_header[10];	l_err = VE_OK;	if (fOutputIsTerminated)	{		fOutputIsTerminated = inIsTerminated;		if (inIsTerminated)		{			l_header[0] = 0x81;		}		else		{			l_header[0] = 0x01;		}	}	else	{		fOutputIsTerminated = inIsTerminated;		l_header[0] = (inIsTerminated ? 0x80 : 0x00 );	}//SEND_COMPLETE_FRAME:	if (!l_err)	{		if (inLength <= 125)		{			l_header[1] = (unsigned char)inLength;			l_err = WriteBytes(l_header,2);			if (l_err)			{				DebugMsg("WriteBytes ERR/n");			}		}		else		{			if (inLength < 65536)			{				l_header[1] = 126;				l_header[2] = (uLONG)inLength / 256;				l_header[3] = (uLONG)inLength % 256;				l_err = WriteBytes(l_header,4);				if (l_err)				{					DebugMsg("Write3 ERR/n");				}			}			else			{				DebugMsg("WriteMessage ERR/n");				l_err = VE_INVALID_PARAMETER;			}		}//SEND_ALL_DATA:		if (!l_err)		{			l_err = WriteBytes(inData,inLength);			if (l_err)			{				DebugMsg("WriteBytes ERR/n");			}			}	}	if (l_err)	{		/*fEndpt = NULL;*/		Close();	}	return l_err;}
开发者ID:sanyaade-webdev,项目名称:core-Components,代码行数:74,


示例10: TestUtilityMessages

VOIDTestUtilityMessages (  VOID  ){  CHAR8 *ArgStr = "ArgString";  int   ArgInt;  ArgInt  = 0x12345678;  //  // Test without setting utility name  //  fprintf (stdout, "* Testing without setting utility name/n");  fprintf (stdout, "** Test debug message not printed/n");  DebugMsg (NULL, 0, 0x00000001, NULL, NULL);  fprintf (stdout, "** Test warning with two strings and two args/n");  Warning (NULL, 0, 1234, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);  fprintf (stdout, "** Test error with two strings and two args/n");  Warning (NULL, 0, 1234, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);  fprintf (stdout, "** Test parser warning with nothing/n");  ParserWarning (0, NULL, NULL);  fprintf (stdout, "** Test parser error with nothing/n");  ParserError (0, NULL, NULL);  //  // Test with utility name set now  //  fprintf (stdout, "** Testingin with utility name set/n");  SetUtilityName ("MyUtilityName");  //  // Test debug prints  //  SetDebugMsgMask (2);  fprintf (stdout, "** Test debug message with one string/n");  DebugMsg (NULL, 0, 0x00000002, "Text1", NULL);  fprintf (stdout, "** Test debug message with one string/n");  DebugMsg (NULL, 0, 0x00000002, NULL, "Text2");  fprintf (stdout, "** Test debug message with two strings/n");  DebugMsg (NULL, 0, 0x00000002, "Text1", "Text2");  fprintf (stdout, "** Test debug message with two strings and two args/n");  DebugMsg (NULL, 0, 0x00000002, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);  //  // Test warning prints  //  fprintf (stdout, "** Test warning with no strings/n");  Warning (NULL, 0, 1234, NULL, NULL);  fprintf (stdout, "** Test warning with one string/n");  Warning (NULL, 0, 1234, "Text1", NULL);  fprintf (stdout, "** Test warning with one string/n");  Warning (NULL, 0, 1234, NULL, "Text2");  fprintf (stdout, "** Test warning with two strings and two args/n");  Warning (NULL, 0, 1234, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);  //  // Test error prints  //  fprintf (stdout, "** Test error with no strings/n");  Error (NULL, 0, 1234, NULL, NULL);  fprintf (stdout, "** Test error with one string/n");  Error (NULL, 0, 1234, "Text1", NULL);  fprintf (stdout, "** Test error with one string/n");  Error (NULL, 0, 1234, NULL, "Text2");  fprintf (stdout, "** Test error with two strings and two args/n");  Error (NULL, 0, 1234, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);  //  // Test parser prints  //  fprintf (stdout, "** Test parser errors/n");  ParserSetPosition (__FILE__, __LINE__ + 1);  ParserError (1234, NULL, NULL);  ParserSetPosition (__FILE__, __LINE__ + 1);  ParserError (1234, "Text1", NULL);  ParserSetPosition (__FILE__, __LINE__ + 1);  ParserError (1234, NULL, "Text2");  ParserSetPosition (__FILE__, __LINE__ + 1);  ParserError (1234, "Text1", "Text2");  ParserSetPosition (__FILE__, __LINE__ + 1);  ParserError (1234, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);  fprintf (stdout, "** Test parser warnings/n");  ParserSetPosition (__FILE__, __LINE__ + 1);  ParserWarning (4321, NULL, NULL);  ParserSetPosition (__FILE__, __LINE__ + 1);  ParserWarning (4321, "Text1", NULL);  ParserSetPosition (__FILE__, __LINE__ + 1);  ParserWarning (4321, NULL, "Text2");  ParserSetPosition (__FILE__, __LINE__ + 1);  ParserWarning (4321, "Text1", "Text2");  ParserSetPosition (__FILE__, __LINE__ + 1);  ParserWarning (4321, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);}
开发者ID:Acidburn0zzz,项目名称:buildtools-BaseTools,代码行数:89,


示例11: memset

XBOX::VError VHTTPWebsocketHandler::ReadHeader(bool* found){	VError			l_err;	memset(&fFrame,0,sizeof(ws_frame_t));	*found = false;	fFrame.buf_len = 2;//printf("ReadHeader called/n");	l_err = ReadBytes((void *)fFrame.header, &fFrame.buf_len);	if (!l_err && fFrame.buf_len)	{		// extensions not handled		if (fFrame.header[0] & 0x70)		{			DebugMsg("VHTTPWebsocketHandler::ReadHeader RFC6455 EXTENSIONS NOT HANDLED!!!!/n");			l_err = VE_INVALID_PARAMETER;		}		if (!l_err)		{			fFrame.opcode = (ws_opcode_t)(fFrame.header[0] & 0x0F);					fFrame.masked = (fFrame.header[1] & 0x80);			fFrame.len = (sLONG8)(fFrame.header[1] & 0x7F);			if (fFrame.len == 127)			{				fFrame.buf_len = 8;				l_err = ReadBytes((void *)(fFrame.header+2), &fFrame.buf_len);				if ( !l_err && (fFrame.buf_len != 8) )				{					l_err = VE_STREAM_CANNOT_READ;				}				if (!l_err)				{					fFrame.len = 0;					for(int l_i=0;l_i<8;l_i+=2)					{						fFrame.len = 65536*fFrame.len + (256*fFrame.header[2+l_i]+fFrame.header[3+l_i]);					}					DebugMsg("ReadHeader frame.len=%lld/n",fFrame.len);				}			}			else			{				if (fFrame.len == 126)				{					fFrame.buf_len = 2;					l_err = ReadBytes((void *)(fFrame.header+2), &fFrame.buf_len);					if ( !l_err && (fFrame.buf_len != 2) )					{						l_err = VE_STREAM_CANNOT_READ;					}					if (!l_err)					{						fFrame.len = 256*fFrame.header[2]+fFrame.header[3];						DebugMsg("ReadHeader frame.len=%d/n",fFrame.len);					}				}				else				{					DebugMsg("ReadHeader frame.len=%d/n",fFrame.len);				}			}			if (!l_err && fFrame.masked)			{				fFrame.buf_len = 4;				l_err = ReadBytes((void *)fFrame.msk, &fFrame.buf_len);				if ( !l_err && (fFrame.buf_len != 4) )				{					l_err = VE_STREAM_CANNOT_READ;				}			}			*found = true;		}	}	return l_err;}
开发者ID:sanyaade-webdev,项目名称:core-Components,代码行数:77,


示例12: main

int main( int argc, char **argv )/*******************************/{    char    *pEnv;    int     numArgs = 0;    int     numFiles = 0;    int     rc = 0;#if WILDCARDS    long    fh; /* _findfirst/next/close() handle, must be long! */    struct  _finddata_t finfo;    char    drv[_MAX_DRIVE];    char    dir[_MAX_DIR];    char    fname[_MAX_PATH];#endif#if 0 //def DEBUG_OUT    /* DebugMsg() cannot be used that early */    int i;    for ( i = 1; i < argc; i++ ) {        printf("argv[%u]=>%s</n", i, argv[i] );    }#endif    pEnv = getenv( "JWASM" );    if ( pEnv == NULL )        pEnv = "";    argv[0] = pEnv;#ifndef DEBUG_OUT    signal(SIGSEGV, genfailure);#endif#if CATCHBREAK    signal(SIGBREAK, genfailure);#else    signal(SIGTERM, genfailure);#endif    MsgInit();    while ( 1 ) {        if ( ParseCmdline( (const char **)argv, &numArgs ) == NULL )            break;  /* exit if no source file name supplied */        numFiles++;        write_logo();#if WILDCARDS        if ((fh = _findfirst( Options.names[ASM], &finfo )) == -1 ) {            DebugMsg(("main: _findfirst(%s) failed/n", Options.names[ASM] ));            EmitErr( CANNOT_OPEN_FILE, Options.names[ASM], ErrnoStr() );            break;        }        _splitpath( Options.names[ASM], drv, dir, NULL, NULL );        DebugMsg(("main: _splitpath(%s): drv=/"%s/" dir=/"%s/"/n", Options.names[ASM], drv, dir ));        do {            _makepath( fname, drv, dir, finfo.name, NULL );            DebugMsg(("main: _makepath(/"%s/", /"%s/", /"%s/")=/"%s/"/n", drv, dir, finfo.name, fname ));            rc = AssembleModule( fname );  /* assemble 1 module */        } while ( ( _findnext( fh, &finfo ) != -1 ) );        _findclose( fh );#else        rc = AssembleModule( Options.names[ASM] );#endif    };    CmdlineFini();    if ( numArgs == 0 ) {        write_logo();        printf( MsgGetEx( MSG_USAGE ) );    } else if ( numFiles == 0 )        EmitError( NO_FILENAME_SPECIFIED );    MsgFini();    return( 1 - rc ); /* zero if no errors */}
开发者ID:tonylazarew,项目名称:jwasm,代码行数:72,


示例13: InitJA2SplashScreen

//Simply create videosurface, load image, and draw it to the screen.void InitJA2SplashScreen(){	UINT32 uiLogoID = 0;	STRING512			CurrentDir;	STRING512			DataDir;	HVSURFACE hVSurface;	VSURFACE_DESC VSurfaceDesc;	INT32 i = 0;	InitializeJA2Clock();	//InitializeJA2TimerID();	// Get Executable Directory	GetExecutableDirectory( CurrentDir );	// Adjust Current Dir	sprintf( DataDir, "%s//Data", CurrentDir );	if ( !SetFileManCurrentDirectory( DataDir ) )	{		DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "Could not find data directory, shutting down");		return;	}	//Initialize the file database	InitializeFileDatabase( gGameLibaries, NUMBER_OF_LIBRARIES );#if !defined( ENGLISH ) && defined( JA2TESTVERSION )	memset( &VSurfaceDesc, 0, sizeof( VSURFACE_DESC ) );	VSurfaceDesc.fCreateFlags = VSURFACE_CREATE_FROMFILE | VSURFACE_SYSTEM_MEM_USAGE;	sprintf( VSurfaceDesc.ImageFile, "LOADSCREENS//Notification.sti" );	if( !AddVideoSurface( &VSurfaceDesc, &uiLogoID ) )	{			AssertMsg( 0, String( "Failed to load %s", VSurfaceDesc.ImageFile ) );		return;	}	GetVideoSurface(&hVSurface, uiLogoID );			BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, 0, 0, 0, NULL );	DeleteVideoSurfaceFromIndex( uiLogoID );	InvalidateScreen();	RefreshScreen( NULL );	guiSplashStartTime = GetJA2Clock();	while( i < 60 * 15 )//guiSplashStartTime + 15000 > GetJA2Clock() )	{		//Allow the user to pick his bum.		InvalidateScreen();		RefreshScreen( NULL );		i++;	}#endif		#ifdef ENGLISH		ClearMainMenu();	#else		{			memset( &VSurfaceDesc, 0, sizeof( VSURFACE_DESC ) );			VSurfaceDesc.fCreateFlags = VSURFACE_CREATE_FROMFILE | VSURFACE_SYSTEM_MEM_USAGE;			GetMLGFilename( VSurfaceDesc.ImageFile, MLG_SPLASH );			if( !AddVideoSurface( &VSurfaceDesc, &uiLogoID ) )			{					AssertMsg( 0, String( "Failed to load %s", VSurfaceDesc.ImageFile ) );				return;			}			GetVideoSurface( &hVSurface, uiLogoID );			BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, 0, 0, 0, NULL );			DeleteVideoSurfaceFromIndex( uiLogoID );		}	#endif	InvalidateScreen();	RefreshScreen( NULL );	guiSplashStartTime = GetJA2Clock();}
开发者ID:bowlofstew,项目名称:ja2,代码行数:79,


示例14: IsFileTrusted

/////////////////////////////////////////////////////////////////////////////// IsFileTrusted//itvEnum IsFileTrusted(LPCWSTR lpwFile, HWND hwndParent, DWORD dwUIChoice, bool *pfIsSigned, PCCERT_CONTEXT *ppcSigner){    char szDebugOutput[MAX_STR_LENGTH] = {0};    itvEnum itv = itvUnTrusted;    if (pfIsSigned)        *pfIsSigned = false;    if (ppcSigner)        *ppcSigner  = 0;    GUID guidAction = WINTRUST_ACTION_GENERIC_VERIFY_V2;    WINTRUST_FILE_INFO sWintrustFileInfo;    WINTRUST_DATA      sWintrustData;    HRESULT            hr;    memset((void*)&sWintrustFileInfo, 0x00, sizeof(WINTRUST_FILE_INFO)); // zero out    memset((void*)&sWintrustData, 0x00, sizeof(WINTRUST_DATA)); // zero out    sWintrustFileInfo.cbStruct = sizeof(WINTRUST_FILE_INFO);    sWintrustFileInfo.pcwszFilePath = lpwFile;    sWintrustFileInfo.hFile = NULL;    sWintrustData.cbStruct            = sizeof(WINTRUST_DATA);    sWintrustData.dwUIChoice          = dwUIChoice;    sWintrustData.fdwRevocationChecks = WTD_REVOKE_NONE;    sWintrustData.dwUnionChoice       = WTD_CHOICE_FILE;    sWintrustData.pFile               = &sWintrustFileInfo;    sWintrustData.dwStateAction       = (ppcSigner) ? WTD_STATEACTION_VERIFY : 0;    HMODULE hWinTrust = LoadLibrary(WINTRUST_DLL);    if (!hWinTrust)    {        // WinTrust is unavailable on the machine        return itvWintrustNotOnMachine;    }    PFnWinVerifyTrust pfnWinVerifyTrust = (PFnWinVerifyTrust)GetProcAddress(hWinTrust, WINTRUSTAPI_WinVerifyTrust);    PFnWTHelperProvDataFromStateData pfnWTHelperProvDataFromStateData= (PFnWTHelperProvDataFromStateData)GetProcAddress(hWinTrust, WINTRUSTAPI_WTHelperProvDataFromStateData);    PFnWTHelperGetProvSignerFromChain pfnWTHelperGetProvSignerFromChain = (PFnWTHelperGetProvSignerFromChain)GetProcAddress(hWinTrust, WINTRUSTAPI_WTHelperGetProvSignerFromChain);    PFnWTHelperGetProvCertFromChain pfnWTHelperGetProvCertFromChain = (PFnWTHelperGetProvCertFromChain)GetProcAddress(hWinTrust, WINTRUSTAPI_WTHelperGetProvCertFromChain);    if (!pfnWinVerifyTrust || !pfnWTHelperProvDataFromStateData || !pfnWTHelperGetProvSignerFromChain || !pfnWTHelperGetProvCertFromChain)    {        // WinTrust is unavailable on the machine        FreeLibrary(hWinTrust);        return itvWintrustNotOnMachine;    }    hr = pfnWinVerifyTrust(/* UI Window Handle */ (dwUIChoice == WTD_UI_NONE) ? (HWND)INVALID_HANDLE_VALUE : hwndParent, &guidAction, &sWintrustData);    DebugMsg("[WVT] WVT returned 0x%X/n", hr);    itv = (TRUST_E_PROVIDER_UNKNOWN == hr) ? itvWintrustNotOnMachine : ((S_OK == hr) ? itvTrusted : itvUnTrusted);     if (itvWintrustNotOnMachine == itv)    {        // release state data        sWintrustData.dwUIChoice = WTD_UI_NONE;        sWintrustData.dwStateAction = WTD_STATEACTION_CLOSE;        pfnWinVerifyTrust((HWND)INVALID_HANDLE_VALUE, &guidAction, &sWintrustData);        FreeLibrary(hWinTrust);        return itv; // return immediately    }    if (pfIsSigned)        *pfIsSigned = (TRUST_E_NOSIGNATURE == hr) ? false : true;    if (TRUST_E_NOSIGNATURE == hr)    {        // release state data        sWintrustData.dwUIChoice = WTD_UI_NONE;        sWintrustData.dwStateAction = WTD_STATEACTION_CLOSE;        pfnWinVerifyTrust((HWND)INVALID_HANDLE_VALUE, &guidAction, &sWintrustData);        FreeLibrary(hWinTrust);        return itv;    }    if (ppcSigner)    {        CRYPT_PROVIDER_DATA const *psProvData     = NULL;        CRYPT_PROVIDER_SGNR       *psProvSigner   = NULL;        CRYPT_PROVIDER_CERT       *psProvCert     = NULL;        // grab the provider data        psProvData = pfnWTHelperProvDataFromStateData(sWintrustData.hWVTStateData);        if (psProvData)        {            // grab the signer data from the CRYPT_PROV_DATA            psProvSigner = pfnWTHelperGetProvSignerFromChain((PCRYPT_PROVIDER_DATA)psProvData, 0 /*first signer*/, FALSE /* not a counter signer */, 0);            if (psProvSigner)            {                // grab the signer cert from CRYPT_PROV_SGNR (pos 0 = signer cert; pos csCertChain-1 = root cert)                psProvCert = pfnWTHelperGetProvCertFromChain(psProvSigner, 0);            }        }    //.........这里部分代码省略.........
开发者ID:Ippei-Murofushi,项目名称:WindowsSDK7-Samples,代码行数:101,


示例15: SHGetTaskAllocator

LPMALLOC SHGetTaskAllocator(HRESULT *phres){    HRESULT hres = NOERROR;    //    // Check if the task allocator is already initialized or not.    //    if (g_pmemTask == NULL)    {        //        //  Check if OLE32 is loaded in this process or not.        //        HMODULE hmod = GetModuleHandle(c_szOLE32);#ifdef DONTUSE_TASKALLOCATOR        // We don't use OLE's task allocator if this is a low-memory machine        // AND OLE32.DLL is retail.        //        // WARNING:        //   We don't use OLE's task allocator unless OLE32.DLL is a debug        //  version. To find it out, we call GetProcAddress of DumpMEMSTM.        //  Note that retail version of OLE just allocate memory from        //  the default process heap (which LocalAlloc uses).        //        BOOL fSlow = (GetSystemMetrics(SM_SLOWMACHINE) & 0x0002);        if (hmod && !(fSlow && !_IsDebugOLE(hmod)))#else#ifdef DEBUG        if (TRUE)#else        if (hmod)#endif#endif // DONTUSE_TASKALLOCATOR        {            //            // Yes, get the task allocator from OLE.            //            LPFNCOGETMALLOC pfnGetMalloc;            //            // Bump the reference count of OLE32.DLL            //  Notes:            //   We don't know when we can safely call _UnloadOLE, but            //   that's ok -- it will just stay in this process until            //   the process terminate.            //            STDAPI _LoadOLE(BOOL fRegisterTargets);     // BUGBUG - BobDay - Move this into a headerfile#ifndef WINNT            _LoadOLE(FALSE);#else            //            // On NT, if we're going to go about loading OLE we might as well            // hand off drop targets, etc, right now.             //            // BUGBUG If _LoadOLE(FALSE) is ever called before _LoadOLE(TRUE)            // (as would be case if SHGetTaskAllocator() was called before a            // view was openend), Ole will never be initialized.  So, we call            // with TRUE here in case that happens.            _LoadOLE(TRUE);#endif#ifdef DEBUG            hmod = GetModuleHandle(c_szOLE32);#endif            pfnGetMalloc=(LPFNCOGETMALLOC)GetProcAddress(hmod, c_szCoGetMalloc);            if (pfnGetMalloc)            {                hres=pfnGetMalloc(MEMCTX_TASK, &g_pmemTask);                if (FAILED(hres))                {                    //                    //  CoGetMalloc failed. It means (typically) a shell                    // extension called SHAlloc from within LibMain before                    // the main app calls OleInitialize().                    //                    DebugMsg(DM_WARNING, TEXT("sh WR - CoGetMalloc failed (%x)"), hres);                    Assert(g_pmemTask==NULL);                }            }            else            {                hres = ResultFromScode(E_UNEXPECTED);            }        }        else        {            //            // No, use the shell task allocator (which is LocalAlloc).            //            g_pmemTask = &c_mem;        }    }    if (phres) {//.........这里部分代码省略.........
开发者ID:mingpen,项目名称:OpenNT,代码行数:101,


示例16: SetUtilityName

VOIDCVfrCompiler::OptionInitialization (  IN INT32      Argc,   IN CHAR8      **Argv  ){  INT32         Index;  EFI_STATUS    Status;  Status = EFI_SUCCESS;  SetUtilityName ((CHAR8*) PROGRAM_NAME);  mOptions.VfrFileName[0]                = '/0';  mOptions.RecordListFile[0]             = '/0';  mOptions.CreateRecordListFile          = FALSE;  mOptions.CreateIfrPkgFile              = FALSE;  mOptions.PkgOutputFileName[0]          = '/0';  mOptions.COutputFileName[0]            = '/0';  mOptions.OutputDirectory[0]            = '/0';  mOptions.PreprocessorOutputFileName[0] = '/0';  mOptions.VfrBaseFileName[0]            = '/0';  mOptions.IncludePaths                  = NULL;  mOptions.SkipCPreprocessor             = TRUE;  mOptions.CPreprocessorOptions          = NULL;  mOptions.CompatibleMode                = FALSE;  mOptions.HasOverrideClassGuid          = FALSE;  mOptions.WarningAsError                = FALSE;  memset (&mOptions.OverrideClassGuid, 0, sizeof (EFI_GUID));    if (Argc == 1) {    Usage ();    SET_RUN_STATUS (STATUS_DEAD);    return;  }  for (Index = 1; (Index < Argc) && (Argv[Index][0] == '-'); Index++) {    if ((stricmp(Argv[Index], "-h") == 0) || (stricmp(Argv[Index], "--help") == 0)) {      Usage ();      SET_RUN_STATUS (STATUS_DEAD);      return;    } else if (stricmp(Argv[Index], "--version") == 0) {      Version ();      SET_RUN_STATUS (STATUS_DEAD);      return;    } else if (stricmp(Argv[Index], "-l") == 0) {      mOptions.CreateRecordListFile = TRUE;      gCIfrRecordInfoDB.TurnOn ();    } else if (stricmp(Argv[Index], "-i") == 0) {      Index++;      if ((Index >= Argc) || (Argv[Index][0] == '-')) {        DebugError (NULL, 0, 1001, "Missing option", "-i missing path argument");         goto Fail;      }      AppendIncludePath(Argv[Index]);    } else if (stricmp(Argv[Index], "-o") == 0 || stricmp(Argv[Index], "--output-directory") == 0 || stricmp(Argv[Index], "-od") == 0) {      Index++;      if ((Index >= Argc) || (Argv[Index][0] == '-')) {        DebugError (NULL, 0, 1001, "Missing option", "-o missing output directory name");        goto Fail;      }      strcpy (mOptions.OutputDirectory, Argv[Index]);            CHAR8 lastChar = mOptions.OutputDirectory[strlen(mOptions.OutputDirectory) - 1];      if ((lastChar != '/') && (lastChar != '//')) {        if (strchr(mOptions.OutputDirectory, '/') != NULL) {          strcat (mOptions.OutputDirectory, "/");        } else {          strcat (mOptions.OutputDirectory, "//");        }      }      DebugMsg (NULL, 0, 9, (CHAR8 *) "Output Directory", mOptions.OutputDirectory);    } else if (stricmp(Argv[Index], "-b") == 0 || stricmp(Argv[Index], "--create-ifr-package") == 0 || stricmp(Argv[Index], "-ibin") == 0) {      mOptions.CreateIfrPkgFile = TRUE;    } else if (stricmp(Argv[Index], "-n") == 0 || stricmp(Argv[Index], "--no-pre-processing") == 0 || stricmp(Argv[Index], "-nopp") == 0) {      mOptions.SkipCPreprocessor = TRUE;    } else if (stricmp(Argv[Index], "-f") == 0 || stricmp(Argv[Index], "--pre-processing-flag") == 0 || stricmp(Argv[Index], "-ppflag") == 0) {      Index++;      if ((Index >= Argc) || (Argv[Index][0] == '-')) {        DebugError (NULL, 0, 1001, "Missing option", "-od - missing C-preprocessor argument");        goto Fail;      }      AppendCPreprocessorOptions (Argv[Index]);    } else if (stricmp(Argv[Index], "-c") == 0 || stricmp(Argv[Index], "--compatible-framework") == 0) {      mOptions.CompatibleMode = TRUE;    } else if (stricmp(Argv[Index], "-s") == 0|| stricmp(Argv[Index], "--string-db") == 0) {      Index++;      if ((Index >= Argc) || (Argv[Index][0] == '-')) {        DebugError (NULL, 0, 1001, "Missing option", "-s missing input string file name");        goto Fail;      }      gCVfrStringDB.SetStringFileName(Argv[Index]);      DebugMsg (NULL, 0, 9, (CHAR8 *) "Input string file path", Argv[Index]);    } else if ((stricmp (Argv[Index], "-g") == 0) || (stricmp (Argv[Index], "--guid") == 0)) {      Index++;      Status = StringToGuid (Argv[Index], &mOptions.OverrideClassGuid);      if (EFI_ERROR (Status)) {        DebugError (NULL, 0, 1000, "Invalid format:", "%s", Argv[Index]);        goto Fail;//.........这里部分代码省略.........
开发者ID:AbnerChang,项目名称:edk2-staging,代码行数:101,


示例17: CalcOffset

static void CalcOffset( struct dsym *curr, bool firstseg )/********************************************************/{    uint_32 align;    uint_32 alignbytes;    uint_32 offset;    struct dsym *grp;    if ( curr->e.seginfo->segtype == SEGTYPE_ABS ) {        curr->e.seginfo->start_offset = curr->e.seginfo->abs_frame << 4;        DebugMsg(("CalcOffset(%s): abs seg, offset=%" FX32 "h/n",                  curr->sym.name, curr->e.seginfo->start_offset ));        return;    }    grp = (struct dsym *)curr->e.seginfo->group;    align = 1 << curr->e.seginfo->alignment;    //alignbytes = ((offset + (align - 1)) & (-align)) - offset;    alignbytes = ((fileoffset + (align - 1)) & (-align)) - fileoffset;    fileoffset += alignbytes;    if ( grp == NULL ) {        offset = fileoffset - sizehdr; // + alignbytes;        DebugMsg(("CalcOffset(%s): fileofs=%" FX32 "h, ofs=%" FX32 "h/n", curr->sym.name, fileoffset, offset ));    } else {        if ( grp->sym.total_size == 0 ) {            grp->sym.offset = fileoffset - sizehdr;            offset = 0;        } else            offset = grp->sym.total_size + alignbytes;        DebugMsg(("CalcOffset(%s): fileofs=%" FX32 "h, alignbytes=%lu, ofs=%" FX32 "h, group=%s, grp.ofs=%" FX32 "h/n",                  curr->sym.name, fileoffset, alignbytes, offset, grp->sym.name, grp->sym.offset ));    }    /* v2.04: added */    /* v2.05: this addition did mess sample Win32_5.asm, because the     * "empty" alignment sections are now added to <fileoffset>.     * todo: VA in binary map is displayed wrong.     */    if ( firstseg == FALSE ) {        /* v2.05: do the reset more carefully.         * Do reset start_loc only if         * - segment is in a group and         * - group isn't FLAT or segment's name contains '$'         */        if ( grp && ( grp != ModuleInfo.flat_grp ||                     strchr( curr->sym.name, '$' ) ) )            curr->e.seginfo->start_loc = 0;    }    curr->e.seginfo->fileoffset = fileoffset;    //if ( firstseg && ModuleInfo.header_format == HFORMAT_NONE ) {    if ( ModuleInfo.header_format == HFORMAT_NONE ) {        fileoffset += curr->sym.max_offset - curr->e.seginfo->start_loc;        if ( firstseg )            imagestart = curr->e.seginfo->start_loc;    } else {        /* v2.05: changed, removed */        //curr->e.seginfo->fileoffset += curr->e.seginfo->start_loc;        //fileoffset += curr->sym.max_offset;        fileoffset += curr->sym.max_offset - curr->e.seginfo->start_loc;    }    curr->e.seginfo->start_offset = offset;    /* there's no real entry address for BIN, therefore the     start label must be at the very beginning of the file */    if (entryoffset == -1) {        entryoffset = offset;        entryseg = (struct asym *)curr;    }    //offset += curr->sym.max_offset - curr->e.seginfo->start_loc;    offset += curr->sym.max_offset;    if ( grp ) {        //grp->sym.total_size = offset + curr->e.seginfo->start_loc;        grp->sym.total_size = offset;        /* v2.07: for 16-bit groups, ensure that it fits in 64 kB */        if ( grp->sym.total_size > 0x10000 && grp->sym.Ofssize == USE16 ) {            EmitWarn( 2, GROUP_EXCEEDS_64K, grp->sym.name );        }    }    DebugMsg(("CalcOffset(%s) exit: seg.fileofs=%" FX32 "h, seg.start_offset=%" FX32 "h, endofs=%" FX32 "h fileoffset=%" FX32 "h/n",              curr->sym.name, curr->e.seginfo->fileoffset, curr->e.seginfo->start_offset, offset, fileoffset ));    return;}
开发者ID:tonylazarew,项目名称:jwasm,代码行数:86,


示例18: UpdateInfoForDynamicOpcode

VOIDCVfrCompiler::AdjustBin (  VOID  ){  EFI_VFR_RETURN_CODE Status;  if (!IS_RUN_STATUS(STATUS_COMPILEED)) {    return;  }  UpdateInfoForDynamicOpcode ();  //  // Check Binary Code consistent between Form and IfrRecord  //  //  // Get Package Data and IfrRecord Data  //  gCFormPkg.BuildPkg (gCBuffer);  gCIfrRecordInfoDB.IfrRecordOutput (gRBuffer);   //  // Compare Form and Record data  //  if (gCBuffer.Buffer != NULL && gRBuffer.Buffer != NULL) {    UINT32 Index;    if (gCBuffer.Size != gRBuffer.Size) {      DebugError (NULL, 0, 0001, "Error parsing vfr file", " %s. FormBinary Size 0x%X is not same to RecordBuffer Size 0x%X", mOptions.VfrFileName, gCBuffer.Size, gRBuffer.Size);    }    for (Index = 0; Index < gCBuffer.Size; Index ++) {      if (gCBuffer.Buffer[Index] != gRBuffer.Buffer[Index]) {        break;      }    }    if (Index != gCBuffer.Size) {      DebugError (NULL, 0, 0001, "Error parsing vfr file", " %s. the 0x%X byte is different between Form and Record", mOptions.VfrFileName, Index);    }    DebugMsg (NULL, 0, 9, (CHAR8 *) "IFR Buffer", (CHAR8 *) "Form Buffer same to Record Buffer and Size is 0x%X", Index);  } else if (gCBuffer.Buffer == NULL && gRBuffer.Buffer == NULL) {    //ok  } else {    DebugError (NULL, 0, 0001, "Error parsing vfr file", " %s.Buffer not allocated.", mOptions.VfrFileName);  }  //  // For UEFI mode, not do OpCode Adjust  //  if (mOptions.CompatibleMode) {    //    // Adjust Opcode to be compatible with framework vfr    //    Status = gCIfrRecordInfoDB.IfrRecordAdjust ();    if (Status != VFR_RETURN_SUCCESS) {      //      // Record List Adjust Failed      //      SET_RUN_STATUS (STATUS_FAILED);      return;    }    //    // Re get the IfrRecord Buffer.    //    gCIfrRecordInfoDB.IfrRecordOutput (gRBuffer);   }  return;}
开发者ID:AbnerChang,项目名称:edk2-staging,代码行数:69,


示例19: my_gui_main_task

// Replaces the gui_main_taskstatic voidmy_gui_main_task( void ){	gui_init_end();	uint32_t * obj = 0;	while(1)	{		struct event * event;		msg_queue_receive(			gui_main_struct.msg_queue,			&event,			0		);		if( !event )			goto event_loop_bottom;		if (!magic_is_off() && event->type == 0)		{			if (handle_buttons(event) == 0) // ML button/event handler				goto event_loop_bottom;		}        if (IS_FAKE(event)) {           event->arg = 0;      /* do not pass the "fake" flag to Canon code */        }        if (event->type == 0 && event->param < 0) {            goto event_loop_bottom;           /* do not pass internal ML events to Canon code */        }		switch( event->type )		{		case 0:			if( gui_main_struct.obj != obj			   &&  event->param != 0x29			   &&  event->param != 0x2A			   &&  event->param != 0x2B			   &&  event->param != 0x2C			   &&  event->param != 0x2D			   &&  event->param != 0x2E			   &&  event->param != 0x23			   &&  event->param != 0x2F			   &&  event->param != 0x27			   &&  event->param != 0x30			   &&  event->param != 0x31			   &&  event->param != 0x32			   &&  event->param != 0x33			   &&  event->param != 0x34			   &&  event->param != 0x35			   &&  event->param != 0x36			   &&  event->param != 0x3F			)				goto queue_clear;			DebugMsg( DM_MAGIC, 2, "GUI_CONTROL:%d", event->param );			gui_massive_event_loop( event->param, event->obj, event->arg );			break;		case 1:			if( gui_main_struct.obj != obj			&&  event->param != 0x00			&&  event->param != 0x07			&&  event->param != 0x05			)				goto queue_clear;			DebugMsg( 0x84, 2, "GUI_CHANGE_MODE:%d", event->param );			if( event->param == 0 )			{				gui_local_post( 0x12, 0, 0 );				if( gui_timer_struct.obj )					gui_timer_something( gui_timer_struct.obj, 4 );			}			gui_change_mode( event->param );			break;		case 2:			if( gui_main_struct.obj != obj			   &&  event->param != 0x17			   &&  event->param != 0x18			   &&  event->param != 0x14			   &&  event->param != 0x1B			   &&  event->param != 0x32			   &&  event->param != 0x33			)				goto queue_clear;			gui_local_post( event->param, event->obj, event->arg );			break;		case 3:			if( event->param == 0x11 )			{				DebugMsg( 0x84, 2, "GUIOTHER_CANCEL_ALL_EVENT" );				obj = event->obj;				break;//.........这里部分代码省略.........
开发者ID:HulaSamsquanch,项目名称:1100d_lantern,代码行数:101,


示例20: memset

void CCopyThread::DoCopyDir(string source, string dest){	WIN32_FIND_DATA findFileData;	memset(&findFileData,0,sizeof(WIN32_FIND_DATA));	string searchcmd = source + "//*.*";	searchcmd = str_replaceallA(searchcmd,"////","//");	HANDLE hFind = FindFirstFile(searchcmd.c_str(), &findFileData);	if (hFind == INVALID_HANDLE_VALUE)	{		if (Action == CDA_MOVEFILES || Action == CDA_SDMODE || Action == CDA_DELETE)		{			source = str_replaceallA(source,"////","//");			//DebugMsg("rmdir %s",source.c_str());			int res = _rmdir(source.c_str());			if (res != 0)				DebugMsg("CopyThread","rmdir error %d - %d",res,GetLastError());		}		return;	}	do {		if (Cancel)		{			FindClose(hFind);			return;		}		if (findFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)		{			string newdest = dest + "//" + findFileData.cFileName;			newdest = str_replaceallA(newdest,"////","//");			if (Action != CDA_DELETE)			{				//DebugMsg("Make dir %s",newdest.c_str());                /*if(Action == CDA_COPYDVD && newdest.find("$SystemUpdate") )                {                    continue;                }*/                _mkdir(newdest.c_str());			}			DoCopyDir(source + "//" + findFileData.cFileName,newdest);		}         else         {			if (Action == CDA_COPYDVD && make_lowercaseA(string(findFileData.cFileName)) == "default.xex")            {				continue;            }                        if (Action == CDA_DELETE)			{				string filename = source + "//" + findFileData.cFileName;				filename = str_replaceallA(filename,"////","//");				//DebugMsg("unlink %s",filename.c_str());				_unlink(filename.c_str());				Total_FilesCopied++;			}             else             {				DoCopyFile(source + "//" + findFileData.cFileName,dest + "//" + findFileData.cFileName);			}		}	}     while (FindNextFile(hFind, &findFileData));	    FindClose(hFind);	if (Action == CDA_MOVEFILES || Action == CDA_SDMODE || Action == CDA_DELETE)	{		source = str_replaceallA(source,"////","//");		//DebugMsg("rmdir %s",source.c_str());		int res = _rmdir(source.c_str());		if (res != 0)			DebugMsg("CopyThread","rmdir error %d - %d",res,GetLastError());	}}
开发者ID:DeezNuts12,项目名称:freestyledash,代码行数:76,


示例21: DoPatch

static ret_code DoPatch( struct asym *sym, struct fixup *fixup )/**************************************************************/{    long                disp;    long                max_disp;    unsigned            size;    struct dsym         *seg;#if LABELOPT    struct asym         *sym2;    struct fixup        *fixup2;#endif    /* all relative fixups should occure only at first pass and they signal forward references     * they must be removed after patching or skiped ( next processed as normal fixup )     */    DebugMsg(("DoPatch(%u, %s): fixup sym=%s type=%u ofs=%" FX32 "h loc=%" FX32 "h opt=%u def_seg=%s/n",              Parse_Pass + 1, sym->name,              fixup->sym ? fixup->sym->name : "NULL",              fixup->type,              fixup->offset,              fixup->location,              fixup->option,              fixup->def_seg ? fixup->def_seg->sym.name : "NULL" ));    seg = GetSegm( sym );    if( seg == NULL || fixup->def_seg != seg ) {        /* if fixup location is in another segment, backpatch is possible, but         * complicated and it's a pretty rare case, so nothing's done.         */        DebugMsg(("DoPatch: skipped due to seg incompat: %s - %s/n",                  fixup->def_seg ? fixup->def_seg->sym.name : "NULL",                  seg ? seg->sym.name : "NULL" ));        SkipFixup();        return( NOT_ERROR );    }    if( Parse_Pass == PASS_1 ) {        if( sym->mem_type == MT_FAR && fixup->option == OPTJ_CALL ) {            /* convert near call to push cs + near call,             * (only at first pass) */            DebugMsg(("DoPatch: Phase error! caused by far call optimization/n"));            ModuleInfo.PhaseError = TRUE;            sym->offset++;  /* a PUSH CS will be added */            /* todo: insert LABELOPT block here */            OutputByte( 0 ); /* it's pass one, nothing is written */            FreeFixup( fixup );            return( NOT_ERROR );            //} else if( sym->mem_type == MT_NEAR ) {        } else {            /* forward reference, only at first pass */            switch( fixup->type ) {            case FIX_RELOFF32:            case FIX_RELOFF16:                FreeFixup( fixup );                DebugMsg(("DoPatch: FIX_RELOFF32/FIX_RELOFF16, return/n"));                return( NOT_ERROR );            case FIX_OFF8:  /* push <forward reference> */                if ( fixup->option == OPTJ_PUSH ) {                    size = 1;    /* size increases from 2 to 3/5 */                    DebugMsg(("DoPatch: FIX_OFF8/n"));                    goto patch;                }            }        }    }    size = 0;    switch( fixup->type ) {    case FIX_RELOFF32:        size = 2; /* will be 4 finally */    /* fall through */    case FIX_RELOFF16:        size++; /* will be 2 finally */    /* fall through */    case FIX_RELOFF8:        size++;        /* calculate the displacement */        // disp = fixup->offset + GetCurrOffset() - fixup->location - size;        disp = fixup->offset + fixup->sym->offset - fixup->location - size - 1;        max_disp = (1UL << ((size * 8)-1)) - 1;        if( disp > max_disp || disp < (-max_disp-1) ) {patch:            DebugMsg(("DoPatch(%u): Phase error, disp=%X, fixup=%s(%X), loc=%X!/n", Parse_Pass + 1, disp, fixup->sym->name, fixup->sym->offset, fixup->location ));            ModuleInfo.PhaseError = TRUE;            /* ok, the standard case is: there's a forward jump which             * was assumed to be SHORT, but it must be NEAR instead.             */            switch( size ) {            case 1:                size = 0;                switch( fixup->option ) {                case OPTJ_EXPLICIT:#if 0 /* don't display the error at the destination line! */                    sym->fixup = NULL;                    DebugMsg(("DoPatch: jump out of range, disp=%d/n", disp ));                    EmitErr( JUMP_OUT_OF_RANGE, disp - max_disp );                    return( ERROR );#else                    return( NOT_ERROR ); /* nothing to do */#endif                case OPTJ_EXTEND: /* Jxx for 8086 *///.........这里部分代码省略.........
开发者ID:tonylazarew,项目名称:jwasm,代码行数:101,


示例22: EndProgress

/* This routine should be called after a transfer finishes, even if no * progress reports were done.  Besides cleaning up the progress stuff, * we also do our logging here. */void EndProgress(XferSpecPtr xp){	double elapsedTime, xRate, xferred;	char *unitStr;	char *shortName;	string statMsg;	longstring fullRemote;	long kb, hsecs;	int wantStats;	int localFileIsStdout;	wantStats = 0;	if ((xp->doReports) && (xp->bytesTransferred > 0) && (gVerbosity != kQuiet)) {		ProgressReport(xp, kPrLastUpdateMsg);		wantStats = (InForeGround()) &&			((*xp->prProc)(xp, kPrEndMsg) == kPrWantStatsMsg);	}	(void) Gettimeofday(&xp->endTime);	/* Compute transfer stats. */	xRate = TransferRate(		xp->bytesTransferred,		&xp->startTime,		&xp->endTime,		&unitStr,		&elapsedTime	);	/* Print the stats, if requested. */	if (wantStats) {		shortName = strrchr(xp->localFileName, '/');		if (shortName == NULL)			shortName = xp->localFileName;		else			shortName++;		sprintf(statMsg, "%s:  %ld bytes %s%s in %.2f seconds",			shortName,			xp->bytesTransferred,			NETREADING(xp) ? "received" : "sent",			xp->startPoint ? " and appended to existing file" : "",			elapsedTime		);		if (xRate > 0.0) {			sprintf(statMsg + strlen(statMsg), ", %.2f %s",				xRate,				unitStr			);		}		STRNCAT(statMsg, ".");			/* Make sure echoing is back on! */		Echo(stdin, 1);		/* Make sure the rest of the line is padded with spaces, so it will		 * erase junk that may have been leftover from a progress meter.		 */		EPrintF("%-79s/n", statMsg);		FlushListWindow();	} else {		if (xRate > 0.0) {			DebugMsg("%ld bytes transferred in %.2f seconds, %.2f %s./n",				xp->bytesTransferred,				elapsedTime,				xRate,				unitStr			);		} else {			DebugMsg("%ld bytes transferred in %.2f seconds./n",				xp->bytesTransferred,				elapsedTime			);		}	}	/* Only log stuff if there was a remote filename specified.	 * We don't want to log directory listings or globbings.	 */	if ((xp->remoteFileName != NULL)) {		/* Get kilobytes transferred, rounding to the nearest kB. */		kb = ((long) xp->bytesTransferred + 512L) / 1024L;		OverflowAdd(&gTotalXferKiloBytes, kb);		OverflowAdd(&gRmtInfo.xferKbytes, kb);		/* Get hundredths of seconds, rounded up to nearest. */		hsecs = (long) (100.0 * (elapsedTime + 0.0050));		OverflowAdd(&gTotalXferHSeconds, hsecs);		OverflowAdd(&gRmtInfo.xferHSeconds, hsecs);		if (gTotalXferHSeconds < 0)			gTotalXferHSeconds = 1L;		if (gRmtInfo.xferHSeconds <= 0)			gRmtInfo.xferHSeconds = 1L;		localFileIsStdout =			(STREQ(xp->remoteFileName, kLocalFileIsStdout));	    /* If a simple path is given, try to log the full path. */		if ((xp->remoteFileName[0] == '/') || (localFileIsStdout)) {//.........这里部分代码省略.........
开发者ID:aosm,项目名称:ncftp,代码行数:101,


示例23: handleAssetUpload

//.........这里部分代码省略.........					if(obj.post_chunks.at(nChunks).Entries.at(nEntries).Parameters["name"] == "GameDeveloper") {												// Grab the Developer 						szGameDeveloper = getEntryContent(obj, nChunks);					}					if(obj.post_chunks.at(nChunks).Entries.at(nEntries).Parameters["name"] == "GameExecutable") {												// Grab the Executable						szGameExecutable = getEntryContent(obj, nChunks);					}					if(obj.post_chunks.at(nChunks).Entries.at(nEntries).Parameters["name"] == "GameIcon") {						if(strcmp(obj.post_chunks.at(nChunks).Entries.at(nEntries).Parameters["filename"].c_str(), "") != 0) {														// Extract image data							assetIcon = obj.post_chunks.at(nChunks).FileData;							hasIconData = true;						}					}					if(obj.post_chunks.at(nChunks).Entries.at(nEntries).Parameters["name"] == "GameBanner") {						// check to make sure that a file was uploaded						if(strcmp(obj.post_chunks.at(nChunks).Entries.at(nEntries).Parameters["filename"].c_str(), "") != 0) {														// Extract image data							assetBanner = obj.post_chunks.at(nChunks).FileData;							hasBannerData = true;						}					}					if(obj.post_chunks.at(nChunks).Entries.at(nEntries).Parameters["name"] == "GameBoxart") {						// check to make sure that a file was uploaded						if(strcmp(obj.post_chunks.at(nChunks).Entries.at(nEntries).Parameters["filename"].c_str(), "") != 0) {														// Extract image data							assetBoxart = obj.post_chunks.at(nChunks).FileData;							hasBoxartData = true;						}					}					if(obj.post_chunks.at(nChunks).Entries.at(nEntries).Parameters["name"] == "GameBackground") {						// check to make sure that a file was uploaded						if(strcmp(obj.post_chunks.at(nChunks).Entries.at(nEntries).Parameters["filename"].c_str(), "") != 0) {														// Extract image data							assetBackground = obj.post_chunks.at(nChunks).FileData;							hasBackgroundData = true;						}					}				}			}		}	}	// Verify that the session Id matches before applying changes.	if(strcmp(szSessionId.c_str(), HTTPServer::getInstance().g_mGlobalSessionId.c_str()) != 0)		return 0;	// We have officially received all of our posted data- now let's update our database and send out our messages to the ContentObservers	ContentItemNew * pContentItem = NULL;	pContentItem = ContentManager::getInstance().GetContentByContentId(dwContentId);	if(pContentItem != NULL) 	{		if(pContentItem->getTitleId() != dwTitleId) 			DebugMsg("HTTPServer", "WARNING:  Extracted ContentItem TitleID does not match uploaded content");		// First we'll update our our text items		pContentItem->setDisplayInfo(szGameTitle, szGameDescription, szGameGenre, szGameDeveloper);		// Now we can start on the images		if(hasIconData == true) {			DebugMsg("HTTPServer", "GameIcon Path Found, Updating Content.");			pContentItem->AddAsset(ITEM_UPDATE_TYPE_THUMBNAIL, assetIcon.Data, assetIcon.Length);		}		if(hasBannerData == true) {			DebugMsg("HTTPServer", "GameBanner Path Found, Updating Content.");			pContentItem->AddAsset(ITEM_UPDATE_TYPE_BANNER, assetBanner.Data, assetBanner.Length);		}		if(hasBoxartData == true) {			DebugMsg("HTTPServer", "GameBoxart Path Found, Updating Content.");			pContentItem->AddAsset(ITEM_UPDATE_TYPE_BOXART, assetBoxart.Data, assetBoxart.Length);		}		if(hasBackgroundData == true) {			DebugMsg("HTTPServer", "GameBackground Path Found, Updating Content.");			pContentItem->AddAsset(ITEM_UPDATE_TYPE_BACKGROUND, assetBackground.Data, assetBackground.Length);		}	}	// Standard link was clicked- let's submit our session data and load the next page	HTTP_SESSION_DATA * pData = new HTTP_SESSION_DATA;	pData->Username = "";	pData->Password = "";	pData->SessionId = szSessionId;	int ret = handleGetRequest( obj, (void*)pData );	return ret;}
开发者ID:DeezNuts12,项目名称:freestyledash,代码行数:101,


示例24: ReadInLBEPocketPopups

BOOLEAN ReadInLBEPocketPopups(STR fileName){	HWFILE		hFile;	UINT32		uiBytesRead;	UINT32		uiFSize;	CHAR8 *		lpcBuffer;	XML_Parser	parser = XML_ParserCreate(NULL);		pocketPopupParseData pData;	DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading pocketPopups.xml" );	hFile = FileOpen( fileName, FILE_ACCESS_READ, FALSE );	if ( !hFile )		return( FALSE );		uiFSize = FileGetSize(hFile);	lpcBuffer = (CHAR8 *) MemAlloc(uiFSize+1);	//Read in block	if ( !FileRead( hFile, lpcBuffer, uiFSize, &uiBytesRead ) )	{		MemFree(lpcBuffer);		return( FALSE );	}	lpcBuffer[uiFSize] = 0; //add a null terminator	FileClose( hFile );		XML_SetElementHandler(parser, pocketPopupStartElementHandle, pocketPopupEndElementHandle);	XML_SetCharacterDataHandler(parser, pocketPopupCharacterDataHandle);		memset(&pData,0,sizeof(pData));	XML_SetUserData(parser, &pData);		XML_SetUserData(parser, &pData);	if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))	{		CHAR8 errorBuf[511];		sprintf(errorBuf, "XML Parser Error in Pocket.xml: %s at line %d", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser));		LiveMessage(errorBuf);		MemFree(lpcBuffer);		return FALSE;	}	/*	// dummy popup	 popupDef* popup = new popupDef();	 popup->addOption(new std::wstring(L"Option one"),NULL,NULL);	 popup->addOption(new std::wstring(L"Option two"),NULL,NULL);	 popup->addOption(new std::wstring(L"Option three"),NULL,NULL);	LBEPocketPopup[5] = *popup;	*/	MemFree(lpcBuffer);	XML_ParserFree(parser);	return( TRUE );}
开发者ID:RadekSimkanic,项目名称:JA2-1.13,代码行数:70,


示例25: ReadInEmailOther

BOOLEAN ReadInEmailOther(STR fileName, BOOLEAN localizedVersion){	HWFILE		hFile;	UINT32		uiBytesRead;	UINT32		uiFSize;	CHAR8 *		lpcBuffer;	XML_Parser	parser = XML_ParserCreate(NULL);	EmailOtherParseData pData;	DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading EmailOther.xml" );	EmailOther_TextOnly = localizedVersion;		// Open file	hFile = FileOpen( fileName, FILE_ACCESS_READ, FALSE );	if ( !hFile )		return( localizedVersion );	uiFSize = FileGetSize(hFile);	lpcBuffer = (CHAR8 *) MemAlloc(uiFSize+1);	//Read in block	if ( !FileRead( hFile, lpcBuffer, uiFSize, &uiBytesRead ) )	{		MemFree(lpcBuffer);		return( FALSE );	}	lpcBuffer[uiFSize] = 0; //add a null terminator	FileClose( hFile );	XML_SetElementHandler(parser, EmailOtherStartElementHandle, EmailOtherEndElementHandle);	XML_SetCharacterDataHandler(parser, EmailOtherCharacterDataHandle);	memset(&pData,0,sizeof(pData));	XML_SetUserData(parser, &pData);	if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))	{		CHAR8 errorBuf[511];		sprintf(errorBuf, "XML Parser Error in EmailOther.xml: %s at line %d", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser));		LiveMessage(errorBuf);		MemFree(lpcBuffer);		return FALSE;	}	MemFree(lpcBuffer);	XML_ParserFree(parser);	return( TRUE );}
开发者ID:RadekSimkanic,项目名称:JA2-1.13,代码行数:61,


示例26: DebugMsg

void VDebugMsgAttachment::DoExecute(OsType /*inEventType*/, const void* /*inData*/){	if (fDebugString != NULL)		DebugMsg(*fDebugString);}
开发者ID:StephaneH,项目名称:core-XToolbox,代码行数:5,


示例27: DebugMsg

//staticVFileKind* XLinuxFile::CreatePublicFileKindFromExtension(const VString& inExtension){  DebugMsg(VString("Try to create new file kind from extension : ").AppendString(inExtension).AppendCString("/n"));  return NULL;}
开发者ID:sanyaade-iot,项目名称:core-XToolbox,代码行数:7,


示例28: WinMain

//.........这里部分代码省略.........    PFnMsiQueryProductState pfnMsiQueryProductState = 0;    PFnMsiOpenDatabase pfnMsiOpenDatabase = 0;    PFnMsiDatabaseOpenView pfnMsiDatabaseOpenView = 0;    PFnMsiViewExecute pfnMsiViewExecute = 0;    PFnMsiViewFetch pfnMsiViewFetch = 0;    PFnMsiRecordGetString pfnMsiRecordGetString = 0;    PFnMsiCloseHandle pfnMsiCloseHandle = 0;    MSIHANDLE hDatabase = 0;    MSIHANDLE hView = 0;    MSIHANDLE hRec = 0;    INSTALLSTATE isProduct = INSTALLSTATE_UNKNOWN;        const char * szAdminImagePath = 0;//-----------------------------------------------------------------------------------------------------------------//-----------------------------------------------------------------------------------------------------------------    // create our UI object    CDownloadUI DownloadUI;    // Load our AppTitle (caption)    WIN::LoadString(hInst, IDS_APP_TITLE, szAppTitle, sizeof(szAppTitle)/sizeof(char));    // Obtain path we are running from    if (0 == WIN::GetModuleFileName(hInst, szModuleFile, dwModuleFileSize))    {        // No UI displayed. Silent failure.        uiRet = GetLastError();        goto CleanUp;    }    DebugMsg("[Info] we are running from --> %s/n", szModuleFile);    // Figure out what we want to do    emExecMode = GetExecutionMode (lpszCmdLine);        if (emVerify == emExecMode)    {        //        // We don't want any UI to be displayed in this case. The return value        // from the exe is the result of the verification. Therefore, this        // should be done before initializing the UI.        //        uiRet = VerifyFileSignature (szModuleFile, lpszCmdLine);        if (ERROR_BAD_ARGUMENTS != uiRet)            goto CleanUp;    }        if (ERROR_BAD_ARGUMENTS == uiRet || emHelp == emExecMode)    {        DisplayUsage(hInst, NULL, szAppTitle);        goto CleanUp;    }        //    // NOTE:    // Delay handling admin. installs until we have determined if we are    // patching an existing install or if we are doing a default install.    //     // initialize our UI object with desktop as parent    DownloadUI.Initialize(hInst, /* hwndParent = */ 0, szAppTitle);    // Check if we are installing on an OS that supports Windows Installer 3.0
开发者ID:Ippei-Murofushi,项目名称:WindowsSDK7-Samples,代码行数:67,



注:本文中的DebugMsg函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ DebugRoutine函数代码示例
C++ DebugLogger函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。