当前位置: 首页>>代码示例>>C++>>正文


C++ GlobalFreePtr函数代码示例

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


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

示例1: GlobalFreePtr

void CSoundFile::FreeSample(LPVOID p)
//-----------------------------------
{
	if (p)
	{
		GlobalFreePtr(((LPSTR)p)-16);
	}
}
开发者ID:AliceLR,项目名称:megazeux,代码行数:8,代码来源:sndfile.cpp

示例2: PlayNavigatingSound

/****************************************************************************
 *                                                                          *
 * Function: PlayNavigatingSound                                            *
 *                                                                          *
 * Purpose : Play system navigating sound.                                  *
 *                                                                          *
 * History : Date      Reason                                               *
 *           00/00/00  Created                                              *
 *                                                                          *
 ****************************************************************************/
static void PlayNavigatingSound(void)
{
	HKEY hKey = NULL;
	ULONG ulBufferSize = MAX_PATH + sizeof(TCHAR);
	LPTSTR lpszBuffer = GlobalAllocPtr(GPTR, ulBufferSize);
	LPTSTR lpszSoundPath = GlobalAllocPtr(GPTR, ulBufferSize);

	if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("AppEvents\\Schemes\\Apps\\Explorer\\Navigating\\.Current"), 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) {
		if (RegQueryValueEx(hKey, NULL, 0, NULL, (LPBYTE) lpszBuffer, &ulBufferSize) == ERROR_SUCCESS) {
			ExpandEnvironmentStrings(lpszBuffer, lpszSoundPath, ulBufferSize);
			PlaySound(lpszSoundPath, NULL, SND_ASYNC | SND_NODEFAULT | SND_NOWAIT);
		}
   		if(hKey) RegCloseKey(hKey);
	}

	if(lpszBuffer) GlobalFreePtr(lpszBuffer);
	if(lpszSoundPath) GlobalFreePtr(lpszSoundPath);
}
开发者ID:469306621,项目名称:Languages,代码行数:28,代码来源:hyperlink.c

示例3: PR_MD_free

/*
** PR_MD_free() -- exported as free()
**
*/
void PR_MD_free( void *ptr )
{
    if( _pr_callback_funcs ) {
        (*_pr_callback_funcs->free)( ptr );
        return;
    } else {
        GlobalFreePtr( ptr );
        return;
    }
} /* end free() */
开发者ID:AbrahamJewowich,项目名称:FreeSWITCH,代码行数:14,代码来源:w16callb.c

示例4: tap_close_adapter

static void tap_close_adapter(LPADAPTER fd)
{
	if (fd) {
		if (fd->hFile) {
			tap_set_status(fd, false);
			CloseHandle(fd->hFile);
		}
		GlobalFreePtr(fd);
	}
}
开发者ID:tycho,项目名称:sheepshaver,代码行数:10,代码来源:ether_windows.cpp

示例5: GlobalFreePtr

DISKS::~DISKS()
{
    for (int i = 0; i < nDiskCount; ++i)
    {
        GlobalFreePtr(fName[i]);
        fName[i] = NULL;
        nMount[i] = 0;
        Dismount(i);
    }
}
开发者ID:norayr,项目名称:kronos,代码行数:10,代码来源:Disks.cpp

示例6: GlobalAllocPtr

bool CBitmapShow::InitialBitmap(int width,int height)
{
     if((Width==width)&&(Height==height)) return true;
	 Width=width;
	 Height=height;
	 if(m_lpBitmapInfo!=NULL) GlobalFreePtr(m_lpBitmapInfo);
	 int colors=GetNumberColors();
	 if(colors==0) colors=256;
	 m_lpBitmapInfo = (LPBITMAPINFO) GlobalAllocPtr(GHND,sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * colors);
	 m_lpBitmapInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
	 m_lpBitmapInfo->bmiHeader.biWidth = Width;
	 m_lpBitmapInfo->bmiHeader.biHeight = Height;
	 m_lpBitmapInfo->bmiHeader.biCompression=GetCompressionKind();
	 m_lpBitmapInfo->bmiHeader.biSizeImage = 0;
	 m_lpBitmapInfo->bmiHeader.biXPelsPerMeter = 0;
	 m_lpBitmapInfo->bmiHeader.biYPelsPerMeter = 0;
	 m_lpBitmapInfo->bmiHeader.biPlanes = 1;
	 m_lpBitmapInfo->bmiHeader.biBitCount =GetBitCount();
	 m_lpBitmapInfo->bmiHeader.biClrUsed = 0;
	 m_lpBitmapInfo->bmiHeader.biClrImportant = 0;
	 ILineBytes=WIDTHBYTES(Width*GetBitCount());
	 m_lpBitmapInfo->bmiHeader.biSizeImage=ILineBytes*Height;
     for(int k=0;k<colors;k++) m_lpBitmapInfo->bmiColors[k].rgbRed=m_lpBitmapInfo->bmiColors[k].rgbGreen=m_lpBitmapInfo->bmiColors[k].rgbBlue=k;
	 if(!CreateDIBPalette())
	 {
         if(m_lpBitmapInfo!=NULL) GlobalFreePtr(m_lpBitmapInfo);
         m_lpBitmapInfo=NULL;
		 return false;
	 }
	 if(lpDIBBits!=NULL) GlobalFreePtr(lpDIBBits);
     lpDIBBits=NULL;
     lpDIBBits=(unsigned char*)GlobalAllocPtr(GHND,ILineBytes*Height);
	 if(lpDIBBits==NULL)
	 {
         if(m_lpBitmapInfo!=NULL) GlobalFreePtr(m_lpBitmapInfo);
         m_lpBitmapInfo=NULL;
         if(Palette!=NULL) delete Palette;
		 Palette=NULL;
		 return false;
	 }
	 return true;
}
开发者ID:libGG,项目名称:dview_bj,代码行数:42,代码来源:BitmapShow.cpp

示例7: PacketCloseAdapter

VOID PacketCloseAdapter( LPADAPTER lpAdapter )
{
  D(bug("Packet32: PacketCloseAdapter\n"));

	if(lpAdapter) {
		if(lpAdapter->hFile) {
			CloseHandle(lpAdapter->hFile);
		}
		GlobalFreePtr(lpAdapter);
	}
}
开发者ID:DavidLudwig,项目名称:macemu,代码行数:11,代码来源:packet32.cpp

示例8: ConverterCleanup

//
// ConverterCleanup
//
// Free anything we ever allocated
//
void ConverterCleanup( void )
    {
    DWORD   idx;

/*    if( hInFile != INVALID_HANDLE_VALUE )
        {
        CloseHandle( hInFile );
    hInFile = INVALID_HANDLE_VALUE;
    }*/

    if( ifs.pitsTracks )
        {
    // De-allocate all our track buffers
    for( idx = 0; idx < ifs.dwTrackCount; idx++ )
        if( ifs.pitsTracks[idx].pTrackStart )
        GlobalFreePtr( ifs.pitsTracks[idx].pTrackStart );

        GlobalFreePtr( ifs.pitsTracks );
    ifs.pitsTracks = NULL;
    }
    }
开发者ID:bsmr-games,项目名称:Hexen2,代码行数:26,代码来源:mstrconv.c

示例9: GlobalFreePtr

void AudioFormat::OnCancel()
{
	// TODO: Add extra cleanup here
	if (pwfxLocal) {

		GlobalFreePtr(pwfxLocal);
		pwfxLocal = NULL;

	}

	CDialog::OnCancel();
}
开发者ID:aisnote,项目名称:camstudio-clone,代码行数:12,代码来源:AudioFormat.cpp

示例10: DisposeHandle

void DisposeHandle (Handle handle)
{

	memError = noErr;

	if (handle)
		{
		Ptr p;

		p = *handle;

		if (p)
			GlobalFreePtr (p);

		GlobalFreePtr ((Ptr)handle);
		}

	else

		memError = nilHandleErr;
}
开发者ID:jxfengzi,项目名称:AirPhoto,代码行数:21,代码来源:PIUtilitiesWin.cpp

示例11: aviaudioCloseDevice

void aviaudioCloseDevice(void)
{
	if (shWaveOut) {
		while (0 < swBuffers) {
			--swBuffers;
			waveOutUnprepareHeader(shWaveOut, salpAudioBuf[swBuffers], sizeof(WAVEHDR));
			GlobalFreePtr((LPSTR) salpAudioBuf[swBuffers]);
		}
		waveOutClose(shWaveOut);

		shWaveOut = NULL;
	}
}
开发者ID:aisnote,项目名称:camstudio-clone,代码行数:13,代码来源:audio.cpp

示例12: DimesPacketCloseAdapter

VOID DimesPacketCloseAdapter(LPADAPTER lpAdapter)
{
	if(!lpAdapter)
	{
        printf("PacketCloseAdapter: attempt to close a NULL adapter\n");
		return;
	}
	
	CloseHandle(lpAdapter->hFile);
	SetEvent(lpAdapter->ReadEvent);
    CloseHandle(lpAdapter->ReadEvent);
    GlobalFreePtr(lpAdapter);
}
开发者ID:NetDimes,项目名称:dimes-agent,代码行数:13,代码来源:DimesPacket.cpp

示例13: DimesPacketSetReadEvt

BOOLEAN DimesPacketSetReadEvt(LPADAPTER AdapterObject)
{
	DWORD BytesReturned;
	char EventName[100];
	DWORD lastError;

	if (LOWORD(GetVersion()) == 4)
	{
		// retrieve the name of the shared event from the driver without the "Global\\" prefix
		if(DeviceIoControl(AdapterObject->hFile,pBIOCEVNAME,NULL,0,EventName,3*13*sizeof(TCHAR),&BytesReturned,NULL)==FALSE) 
			return FALSE;

		EventName[BytesReturned/sizeof(TCHAR)]=0; // terminate the string
	}
	else
	{		
		PCHAR name;
		// this tells the terminal service to retrieve the event from the global namespace
		// retrieve the name of the shared event from the driver with the "Global\\" prefix
		if(DeviceIoControl(AdapterObject->hFile,pBIOCEVNAME,NULL,0,EventName + 7,93,&BytesReturned,NULL)==FALSE) 
			return FALSE;
		void* str2 = (void*)(EventName+7);
		PWCHAR string = (PWCHAR)str2;
		name = WChar2SChar(/*EventName+7*/string);
		name[BytesReturned/2]='\0';
		sprintf(EventName,"Global\\%s",name);
		GlobalFreePtr(name);
	}
	
	JavaLog::javalogf(LEVEL_INFO,"event name :%s" , EventName);

	// open the shared event
	AdapterObject->ReadEvent=CreateEvent(NULL,
		TRUE,
		FALSE,
		EventName);

	lastError = GetLastError();

	if(AdapterObject->ReadEvent==NULL || lastError!=ERROR_ALREADY_EXISTS){
		printf("PacketSetReadEvt: error retrieving the event from the kernel\n");
		printError(lastError);
		return FALSE;
	}
	else
		JavaLog::javalogf(LEVEL_INFO,"Read event success\n");

	AdapterObject->ReadTimeOut=0;

	return TRUE;
}
开发者ID:NetDimes,项目名称:dimes-agent,代码行数:51,代码来源:DimesPacket.cpp

示例14: riffCopyChunk

BOOL riffCopyChunk(HMMIO hmmioSrc, HMMIO hmmioDst, const LPMMCKINFO lpck)
{
    MMCKINFO    ck;
    HPSTR       hpBuf;

    //
    //
    //
    hpBuf = (HPSTR)GlobalAllocPtr(GHND, lpck->cksize);
    if (!hpBuf)
    return (FALSE);

    ck.ckid   = lpck->ckid;
    ck.cksize = lpck->cksize;
    if (mmioCreateChunk(hmmioDst, &ck, 0))
    goto rscc_Error;
    
    if (mmioRead(hmmioSrc, hpBuf, lpck->cksize) != (LONG)lpck->cksize)
    goto rscc_Error;

    if (mmioWrite(hmmioDst, hpBuf, lpck->cksize) != (LONG)lpck->cksize)
    goto rscc_Error;

    if (mmioAscend(hmmioDst, &ck, 0))
    goto rscc_Error;

    if (hpBuf)
    GlobalFreePtr(hpBuf);

    return (TRUE);

rscc_Error:

    if (hpBuf)
    GlobalFreePtr(hpBuf);

    return (FALSE);
} /* RIFFSupCopyChunk() */
开发者ID:henriyl,项目名称:ZShadeSandbox,代码行数:38,代码来源:wave.c

示例15: LoadFile

LPVOID LoadFile(LPCTSTR szFile, DWORD * pFileLength)
{
    LPVOID pFile;
    HANDLE hFile;
    HANDLE h;
    DWORD  FileLength;

#ifdef WIN32
    hFile = CreateFile(szFile, GENERIC_READ, FILE_SHARE_READ, NULL,
        OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);

    if (hFile == INVALID_HANDLE_VALUE)
        return 0;

    FileLength = (LONG)GetFileSize(hFile, NULL);

    if (pFileLength)
       *pFileLength = FileLength ;

    h = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, NULL);
    CloseHandle(hFile);

    if (h == INVALID_HANDLE_VALUE)
        return 0;

    pFile = MapViewOfFile(h, FILE_MAP_READ, 0, 0, 0);
    CloseHandle(h);

    if (pFile == NULL)
        return 0;
#else
    hFile = (HANDLE)_lopen(szFile, OF_READ);

    if (hFile == (HANDLE)-1)
        return 0;

    FileLength = _llseek((int)hFile, 0, SEEK_END);
    _llseek((int)hFile, 0, SEEK_SET);

    pFile = GlobalAllocPtr(GHND, FileLength);

    if (pFile && _hread((int)hFile, pFile, FileLength) != FileLength)
    {
        GlobalFreePtr(pFile);
        pFile = NULL;
    }
    _lclose((int)hFile);
#endif
    return pFile;
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:50,代码来源:rlefile.c


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