本文整理汇总了C++中GlobalAllocPtr函数的典型用法代码示例。如果您正苦于以下问题:C++ GlobalAllocPtr函数的具体用法?C++ GlobalAllocPtr怎么用?C++ GlobalAllocPtr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GlobalAllocPtr函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: NewHandle
Handle NewHandle ( long size )
{
Handle mHand;
char *p;
memError = noErr;
mHand = (Handle) GlobalAllocPtr (GHND, (sizeof (Handle) + signatureSize));
if (mHand)
*mHand = (Ptr) GlobalAllocPtr (GHND, size);
if (!mHand || !(*mHand))
{
memError = memFullErr;
return NULL;
}
// put the signature after the pointer
p = (char *) mHand;
p += sizeof (Handle);
memcpy (p,cSig, signatureSize);
return mHand;
}
开发者ID:jxfengzi,项目名称:AirPhoto,代码行数:26,代码来源:PIUtilitiesWin.cpp
示例2: PacketAllocatePacket
LPPACKET PacketAllocatePacket( LPADAPTER AdapterObject, UINT Length )
{
LPPACKET lpPacket;
lpPacket = (LPPACKET)GlobalAllocPtr( GMEM_MOVEABLE|GMEM_ZEROINIT, sizeof(PACKET) );
if(lpPacket==NULL) {
D(bug("Packet32: PacketAllocatePacket: GlobalAlloc Failed\n"));
return NULL;
}
lpPacket->OverLapped.hEvent = CreateEvent(NULL,FALSE,FALSE,NULL);
if(!lpPacket->OverLapped.hEvent) {
D(bug("Packet32: PacketAllocatePacket: CreateEvent Failed\n"));
GlobalFreePtr(lpPacket);
return NULL;
}
lpPacket->Buffer = GlobalAllocPtr(GMEM_MOVEABLE,2048); // 1514
if(!lpPacket->Buffer) {
D(bug("Packet32: PacketAllocatePacket: GlobalAllocPtr Failed\n"));
if(lpPacket->OverLapped.hEvent) CloseHandle(lpPacket->OverLapped.hEvent);
GlobalFreePtr(lpPacket);
return NULL;
}
lpPacket->OverLapped.Offset = 0;
lpPacket->OverLapped.OffsetHigh = 0;
lpPacket->Length = Length;
lpPacket->BytesReceived = 0;
lpPacket->bIoComplete = FALSE;
lpPacket->free = TRUE;
return lpPacket;
}
开发者ID:DavidLudwig,项目名称:macemu,代码行数:34,代码来源:packet32.cpp
示例3: LuminanceChrominance
void LuminanceChrominance(SImageRGB ImageRGB, SImage Y, SImage C0, SImage C1)
{
rgb RGB;
long l = 0;
int lum;
long i,j;
unsigned char * ImY = (unsigned char *) Y.Image;
unsigned char * ImC0 = (unsigned char *) C0.Image;
unsigned char * ImC1 = (unsigned char *) C1.Image;
int * Chromi0 = (int * ) GlobalAllocPtr(GMEM_FIXED | GMEM_ZEROINIT,(ImageRGB.Lmax-ImageRGB.Lmin+1)*(ImageRGB.Hmax-ImageRGB.Hmin+1)*sizeof(int));
int * Chromi1 = (int *) GlobalAllocPtr(GMEM_FIXED | GMEM_ZEROINIT,(ImageRGB.Lmax-ImageRGB.Lmin+1)*(ImageRGB.Hmax-ImageRGB.Hmin+1)*sizeof(int));
int MaxRouge=-255,MaxBleu=-255;
int MinRouge=255,MinBleu=255;
for (j= ImageRGB.Hmin;j<=ImageRGB.Hmax;j++)
{
for (i=ImageRGB.Lmin;i<=ImageRGB.Lmax;i++)
{
RGB = ImageRGB.Image[j*ImageRGB.Larg+i];
lum = (int)(0.3*RGB.r + 0.59*RGB.g + 0.11*RGB.b);
((unsigned char * )ImY)[l] = (unsigned char) lum;
Chromi0[l] = (int)RGB.r-lum;
Chromi1[l] = (int)RGB.b-lum;
if (Chromi0[l] > MaxRouge) MaxRouge =Chromi0[l];
if (Chromi1[l] > MaxBleu) MaxBleu = Chromi1[l] ;
if (Chromi0[l] < MinRouge) MinRouge = Chromi0[l] ;
if (Chromi1[l] < MinBleu) MinBleu = Chromi1[l] ;
l++;
}
}
l = 0;
// normalisation des chrominances
int normR,normB,norm;
if (MaxRouge==MinRouge) normR= 1; else normR = (MaxRouge-MinRouge)/255;
if (MaxBleu==MinBleu) normB= 1; else normB = (MaxBleu-MinBleu)/255;
if (normR>normB) norm = normR; else norm = normB;
for (j= ImageRGB.Hmin;j<=ImageRGB.Hmax;j++)
{
for (i=ImageRGB.Lmin;i<=ImageRGB.Lmax;i++)
{
RGB = ImageRGB.Image[j*ImageRGB.Larg+i];
((unsigned char * )ImC0)[l] = (unsigned char) (Chromi0[l]-MinRouge)/norm;
((unsigned char * )ImC1)[l] = (unsigned char) (Chromi1[l] -MinBleu)/norm;
l++;
}
}
GlobalFreePtr(Chromi0);
GlobalFreePtr(Chromi1);
}
开发者ID:clemaitre58,项目名称:CRDAorta,代码行数:52,代码来源:COLOR.CPP
示例4: sizeof
void CDib::LoadStream(IStream *pStr)
{
BITMAPFILEHEADER bitmapFileHeader;
ULONG ReadSize = 0;
HRESULT hr = S_OK;
hr = pStr->Read((void*)&bitmapFileHeader,sizeof(BITMAPFILEHEADER),&ReadSize);
if (SUCCEEDED(hr)&&(bitmapFileHeader.bfType == 0x4d42))
{
DWORD fileLength = bitmapFileHeader.bfSize;
DWORD size = fileLength - sizeof(BITMAPFILEHEADER);
BYTE* pDib = (BYTE*)GlobalAllocPtr(GMEM_MOVEABLE, size);
hr = pStr->Read((void*)pDib, size,&ReadSize);
if(SUCCEEDED(hr))
{
m_pBitmapInfo = (BITMAPINFO*)pDib;
m_pBitmapInfoHeader = (BITMAPINFOHEADER*) pDib;
m_pRGB = (RGBQUAD*)(pDib + m_pBitmapInfoHeader->biSize);
int m_numberOfColors = GetNumberOfColors();
if (m_pBitmapInfoHeader->biClrUsed == 0)
m_pBitmapInfoHeader->biClrUsed = m_numberOfColors;
DWORD colorTableSize = m_numberOfColors * sizeof(RGBQUAD);
m_pData = pDib + m_pBitmapInfoHeader->biSize + colorTableSize;
if (m_pRGB == (RGBQUAD*)m_pData) // No color table
m_pRGB = NULL;
m_pBitmapInfoHeader->biSizeImage = GetSize();
m_valid = TRUE;
return ;
}
}
m_valid = FALSE;
#ifdef _DEVELOVER_VERSION_L1
AfxMessageBox(_T("This isn't a bitmap file in Stream!"));
#endif
}
开发者ID:0anion0,项目名称:IBN,代码行数:35,代码来源:cdib.cpp
示例5: strcpy
void CDib::LoadFile(const char* dibFileName)
{
strcpy(m_fileName,dibFileName);
CFile dibFile(m_fileName, CFile::modeRead);
dibFile.Read((void*)&bitmapFileHeader,sizeof(BITMAPFILEHEADER));
if (bitmapFileHeader.bfType == 0x4d42)
{
DWORD fileLength = dibFile.GetLength();
size = fileLength -sizeof(BITMAPFILEHEADER);
pDib =(BYTE*)GlobalAllocPtr(GMEM_MOVEABLE, size);
dibFile.Read((void*)pDib, size);
dibFile.Close();
m_pBitmapInfo = (BITMAPINFO*) pDib;
m_pBitmapInfoHeader = (BITMAPINFOHEADER*) pDib;
m_pRGB = (RGBQUAD*)(pDib +
m_pBitmapInfoHeader->biSize);
int m_numberOfColors = GetNumberOfColors();
if (m_pBitmapInfoHeader->biClrUsed == 0)
m_pBitmapInfoHeader->biClrUsed =
m_numberOfColors;
DWORD colorTableSize = m_numberOfColors *
sizeof(RGBQUAD);
m_pData = pDib + m_pBitmapInfoHeader->biSize
+ colorTableSize;
if (m_pRGB == (RGBQUAD*)m_pData) // No color table
m_pRGB = NULL;
m_pBitmapInfoHeader->biSizeImage = GetSize();
m_valid = TRUE;
}
else
{
m_valid = FALSE;
AfxMessageBox("This isn't a bitmap file!");
}
}
开发者ID:qiupyu,项目名称:DIP,代码行数:35,代码来源:Cdib.cpp
示例6:
CModelFrame::CModelFrame()
{
m_Limited=600;
m_iDem=512;
m_bArroy=new BYTE[m_iDem];
Pallete=(LPBITMAPINFO)GlobalAllocPtr(GHND,
(sizeof (BITMAPINFO)+
(sizeof (RGBQUAD)*255 )));
Pallete->bmiHeader.biSize = 40;
Pallete->bmiHeader.biWidth = m_iDem;
Pallete->bmiHeader.biHeight = m_iDem;
Pallete->bmiHeader.biPlanes = 1;
Pallete->bmiHeader.biBitCount = 8;
Pallete->bmiHeader.biCompression=BI_RGB;
Pallete->bmiHeader.biSizeImage = 0;
Pallete->bmiHeader.biXPelsPerMeter = 0;
Pallete->bmiHeader.biYPelsPerMeter = 0;
Pallete->bmiHeader.biClrUsed = 0;
Pallete->bmiHeader.biClrImportant = 0;
for(int i=0;i<256;i++)
{
Pallete->bmiColors[i].rgbRed =
Pallete->bmiColors[i].rgbGreen =
Pallete->bmiColors[i].rgbBlue = i;
}
GetModel();
}
开发者ID:mclnsharma,项目名称:Multislice,代码行数:28,代码来源:ModelFrame.cpp
示例7: GetBITMAPINFOSize
///////////////////////////////////////
// member function CreateBITMAPINFO
///////////////////////////////////////
BOOL CDib::CreateBITMAPINFO()
{
UINT biSize;
// determine the amount of memory needed to hold BITMAPINFO
biSize = GetBITMAPINFOSize();
// Allocate the BITMAPINFO data structure
if (lpbinfo != NULL)
GlobalFreePtr(lpbinfo);
lpbinfo = (LPBITMAPINFO) GlobalAllocPtr(GMEM_MOVEABLE,biSize);
if (lpbinfo == NULL)
{
SetCDibState(FAIL_LPBI_ALLOC);
return FALSE;
}
// initialize the values to ZERO
memset(lpbinfo, 0, biSize);
return TRUE;
}
开发者ID:WWAWing,项目名称:WinWwaWingmk,代码行数:28,代码来源:CDIB.CPP
示例8: PacketGetNetType
//---------------------------------------------------------------------------
BOOLEAN PacketGetNetType (LPADAPTER AdapterObject,NetType *type)
{
BOOLEAN Status;
ULONG IoCtlBufferLength = (sizeof (PACKET_OID_DATA) + sizeof (ULONG) - 1);
PPACKET_OID_DATA OidData;
ODS ("Packet32: PacketSetFilter\n");
_ASSERTE (AdapterObject != NULL);
OidData = GlobalAllocPtr (
GMEM_MOVEABLE | GMEM_ZEROINIT,
IoCtlBufferLength
);
if (OidData == NULL)
{
return FALSE;
}
//get the link-layer type
OidData->Oid = OID_GEN_MEDIA_IN_USE;
OidData->Length = sizeof (ULONG);
Status = PacketRequest(AdapterObject,FALSE,OidData);
if(Status==FALSE)return FALSE;
type->LinkType=*((UINT*)OidData->Data);
//get the link-layer speed
OidData->Oid = OID_GEN_LINK_SPEED;
OidData->Length = sizeof (ULONG);
Status = PacketRequest(AdapterObject,FALSE,OidData);
type->LinkSpeed=*((UINT*)OidData->Data)*100;
GlobalFreePtr (OidData);
return Status;
}
开发者ID:OPEXGroup,项目名称:winpcap,代码行数:33,代码来源:Packet32.c
示例9: AllocateSample
signed char* CSoundFile::AllocateSample(UINT nbytes)
//-------------------------------------------
{
signed char * p = (signed char *)GlobalAllocPtr(GHND, (nbytes+39) & ~7);
if (p) p += 16;
return p;
}
开发者ID:Distrotech,项目名称:libmodplug,代码行数:7,代码来源:sndfile.cpp
示例10: PacketOpenAdapter
LPADAPTER PacketOpenAdapter( LPCTSTR AdapterName, int16 mode )
{
LPADAPTER lpAdapter;
BOOLEAN Result = TRUE;
D(bug("Packet32: PacketOpenAdapter\n"));
// May fail if user is not an Administrator.
StartPacketDriver( TEXT("B2ether") );
lpAdapter = (LPADAPTER)GlobalAllocPtr( GMEM_MOVEABLE|GMEM_ZEROINIT, sizeof(ADAPTER) );
if (lpAdapter==NULL) {
D(bug("Packet32: PacketOpenAdapter GlobalAlloc Failed\n"));
return NULL;
}
TCHAR device_name[256];
_sntprintf(lpAdapter->SymbolicLink, lengthof(lpAdapter->SymbolicLink), TEXT("\\\\.\\B2ether_%s"), AdapterName );
_sntprintf(device_name, lengthof(device_name), TEXT("\\Device\\B2ether_%s"), AdapterName );
// Work around one subtle NT4 bug.
DefineDosDevice(
DDD_REMOVE_DEFINITION,
&lpAdapter->SymbolicLink[4],
NULL
);
DefineDosDevice(
DDD_RAW_TARGET_PATH,
&lpAdapter->SymbolicLink[4],
device_name
);
packet_filter = NDIS_PACKET_TYPE_DIRECTED |
NDIS_PACKET_TYPE_MULTICAST |
NDIS_PACKET_TYPE_BROADCAST;
if(mode == ETHER_MULTICAST_ALL) packet_filter |= NDIS_PACKET_TYPE_ALL_MULTICAST;
if(mode == ETHER_MULTICAST_PROMISCUOUS) packet_filter |= NDIS_PACKET_TYPE_PROMISCUOUS;
if (Result) {
lpAdapter->hFile = CreateFile(lpAdapter->SymbolicLink,
GENERIC_WRITE | GENERIC_READ,
0,
NULL,
// (os == VER_PLATFORM_WIN32_NT) ? CREATE_ALWAYS : OPEN_EXISTING,
OPEN_EXISTING,
FILE_FLAG_OVERLAPPED,
0
);
if (lpAdapter->hFile != INVALID_HANDLE_VALUE) {
if(*AdapterName && _tcscmp(AdapterName,TEXT("<None>")) != 0) {
PacketSetFilter( lpAdapter, packet_filter );
}
return lpAdapter;
}
}
D(bug("Packet32: PacketOpenAdapter Could not open adapter\n"));
GlobalFreePtr( lpAdapter );
return NULL;
}
开发者ID:DavidLudwig,项目名称:macemu,代码行数:60,代码来源:packet32.cpp
示例11: 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:Ghosthunt7,项目名称:feos-tas,代码行数:30,代码来源:wave.c
示例12: PlaceMenuMRUItem
//*************************************************************
//
// PlaceMenuMRUItem()
//
// Purpose:
// Add MRU at the end of a menu
//
// Parameters:
// LPMRUMENU lpMruMenu - pointer on MRUMENU
// HMENU hMenu - Handle of menu where MRU must be added
// UINT uiItem - Item of menu entry where MRU must be added
//
// Return: void
//
//
// Comments:
// Used MRU is modified, for refresh the File menu
//
// History: Date Author Comment
// 09/24/94 G. Vollant Created
//
//*************************************************************
void PlaceMenuMRUItem( LPMRUMENU lpMruMenu, HMENU hMenu, UINT uiItem )
{
int i;
WORD wNbShow;
if ( lpMruMenu == NULL )
return;
// remove old MRU in menu
for ( i = 0; i <= ( int )( lpMruMenu->wNbLruMenu ); i++ )
RemoveMenu( hMenu, i + lpMruMenu->wIdMru, MF_BYCOMMAND );
if ( lpMruMenu->wNbItemFill == 0 )
return;
// If they are item, insert a separator before the files
InsertMenu( hMenu, uiItem, MF_SEPARATOR, lpMruMenu->wIdMru, NULL );
wNbShow = min( lpMruMenu->wNbItemFill, lpMruMenu->wNbLruShow );
for ( i = ( int )wNbShow - 1; i >= 0; i-- )
{
LPSTR lpTxt;
if ( lpTxt = ( LPSTR )GlobalAllocPtr( GHND, lpMruMenu->wMaxSizeLruItem + 20 ) )
{
wsprintf( lpTxt, "&%lu %s",
( DWORD )( i + 1 ), lpMruMenu->lpMRU + ( lpMruMenu->wMaxSizeLruItem * ( UINT )i ) );
InsertMenu( hMenu, ( ( ( WORD )i ) != ( wNbShow - 1 ) ) ? ( lpMruMenu->wIdMru + i + 2 ) : lpMruMenu->wIdMru,
MF_STRING, lpMruMenu->wIdMru + i + 1, lpTxt );
GlobalFreePtr( lpTxt );
}
}
}
开发者ID:OnlyTheGhosts,项目名称:OWEngine,代码行数:53,代码来源:MRU.cpp
示例13: SaveMruInReg
//*************************************************************
//
// SaveMruInReg()
//
// Purpose:
// Save MRU in the registry
//
// Parameters:
// LPMRUMENU lpMruMenu - pointer on MRUMENU
// LPSTR lpszKey - Points to a null-terminated string
// specifying the name of a key that
// this function opens or creates.
//
// Return: (BOOL)
// TRUE - Function run successfully
// FALSE - Function don't run successfully
//
//
// Comments:
// Win32 function designed for Windows NT and Windows 95
// See RegCreateKeyEx API for more info on lpszKey
//
// History: Date Author Comment
// 09/24/94 G. Vollant Created
//
//*************************************************************
BOOL SaveMruInReg( LPMRUMENU lpMruMenu, LPSTR lpszKey )
{
LPSTR lpTxt;
WORD i;
HKEY hCurKey;
DWORD dwDisp;
lpTxt = ( LPSTR )GlobalAllocPtr( GHND, lpMruMenu->wMaxSizeLruItem + 20 );
if ( lpTxt == NULL )
return FALSE;
RegCreateKeyEx( HKEY_CURRENT_USER, lpszKey, 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hCurKey, &dwDisp );
for ( i = 0; i < lpMruMenu->wNbLruMenu; i++ )
{
char szEntry[16];
wsprintf( szEntry, "File%lu", ( DWORD )i + 1 );
if ( !GetMenuItem( lpMruMenu, i, FALSE, lpTxt, lpMruMenu->wMaxSizeLruItem + 10 ) )
*lpTxt = '\0';
RegSetValueEx( hCurKey, szEntry, 0, REG_SZ, ( unsigned char* )lpTxt, lstrlen( lpTxt ) );
}
RegCloseKey( hCurKey );
GlobalFreePtr( lpTxt );
return TRUE;
}
开发者ID:OnlyTheGhosts,项目名称:OWEngine,代码行数:52,代码来源:MRU.cpp
示例14: LoadMruInReg
//*************************************************************
//
// LoadMruInReg()
//
// Purpose:
// Load MRU from the registry
//
// Parameters:
// LPMRUMENU lpMruMenu - pointer on MRUMENU
// LPSTR lpszKey - Points to a null-terminated string
// specifying the name of a key that
// this function opens or creates.
//
// Return: (BOOL)
// TRUE - Function run successfully
// FALSE - Function don't run successfully
//
//
// Comments:
// Win32 function designed for Windows NT and Windows 95
// See RegOpenKeyEx API for more info on lpszKey
//
// History: Date Author Comment
// 09/24/94 G. Vollant Created
//
//*************************************************************
BOOL LoadMruInReg( LPMRUMENU lpMruMenu, LPSTR lpszKey )
{
LPSTR lpTxt;
WORD i;
HKEY hCurKey;
DWORD dwType;
lpTxt = ( LPSTR )GlobalAllocPtr( GHND, lpMruMenu->wMaxSizeLruItem + 20 );
if ( lpTxt == NULL )
return FALSE;
RegOpenKeyEx( HKEY_CURRENT_USER, lpszKey, 0, KEY_READ, &hCurKey );
for ( i = 0; i < lpMruMenu->wNbLruMenu; i++ )
{
char szEntry[16];
DWORD dwSizeBuf;
wsprintf( szEntry, "File%lu", ( DWORD )i + 1 );
*lpTxt = '\0';
dwSizeBuf = lpMruMenu->wMaxSizeLruItem + 10;
RegQueryValueEx( hCurKey, szEntry, NULL, &dwType, ( LPBYTE )lpTxt, &dwSizeBuf );
*( lpTxt + dwSizeBuf ) = '\0';
if ( *lpTxt == '\0' )
break;
SetMenuItem( lpMruMenu, i, lpTxt );
}
RegCloseKey( hCurKey );
GlobalFreePtr( lpTxt );
return TRUE;
}
开发者ID:OnlyTheGhosts,项目名称:OWEngine,代码行数:56,代码来源:MRU.cpp
示例15: PacketSetMaxLookaheadsize
//---------------------------------------------------------------------------
BOOLEAN PacketSetMaxLookaheadsize (LPADAPTER AdapterObject)
{
BOOLEAN Status;
ULONG IoCtlBufferLength = (sizeof (PACKET_OID_DATA) + sizeof (ULONG) - 1);
PPACKET_OID_DATA OidData;
ODS ("Packet32: PacketSetFilter\n");
_ASSERTE (AdapterObject != NULL);
OidData = GlobalAllocPtr (
GMEM_MOVEABLE | GMEM_ZEROINIT,
IoCtlBufferLength
);
if (OidData == NULL)
{
return FALSE;
}
//set the size of the lookahead buffer to the maximum available by the the NIC driver
OidData->Oid=OID_GEN_MAXIMUM_LOOKAHEAD;
OidData->Length=sizeof(ULONG);
Status=PacketRequest(AdapterObject,FALSE,OidData);
OidData->Oid=OID_GEN_CURRENT_LOOKAHEAD;
Status=PacketRequest(AdapterObject,TRUE,OidData);
GlobalFreePtr(OidData);
return Status;
}
开发者ID:OPEXGroup,项目名称:winpcap,代码行数:26,代码来源:Packet32.c
示例16: PacketSetHwFilter
//---------------------------------------------------------------------------
BOOLEAN PacketSetHwFilter (LPADAPTER AdapterObject,
ULONG Filter)
{
BOOLEAN Status;
ULONG IoCtlBufferLength = (sizeof (PACKET_OID_DATA) + sizeof (ULONG) - 1);
PPACKET_OID_DATA OidData;
ODS ("Packet32: PacketSetFilter\n");
_ASSERTE (AdapterObject != NULL);
OidData = GlobalAllocPtr (
GMEM_MOVEABLE | GMEM_ZEROINIT,
IoCtlBufferLength
);
if (OidData == NULL)
{
return FALSE;
}
OidData->Oid = OID_GEN_CURRENT_PACKET_FILTER;
OidData->Length = sizeof (ULONG);
*((PULONG) OidData->Data) = Filter;
Status = PacketRequest (
AdapterObject,
TRUE,
OidData
);
GlobalFreePtr (OidData);
return Status;
}
开发者ID:OPEXGroup,项目名称:winpcap,代码行数:29,代码来源:Packet32.c
示例17: PacketAllocatePacket
//---------------------------------------------------------------------------
LPPACKET PacketAllocatePacket (void)
{
LPPACKET lpPacket;
lpPacket = (LPPACKET) GlobalAllocPtr (
GMEM_MOVEABLE | GMEM_ZEROINIT,
sizeof (PACKET));
if (lpPacket == NULL)
{
ODS ("Packet32: PacketAllocatePacket: GlobalAlloc Failed\n");
return NULL;
}
lpPacket->OverLapped.hEvent = CreateEvent (NULL,
FALSE,
FALSE,
NULL);
if (lpPacket->OverLapped.hEvent == NULL)
{
ODS ("Packet32: PacketAllocatePacket: CreateEvent Failed\n");
GlobalFreePtr (lpPacket);
return NULL;
}
lpPacket->Buffer=NULL;
lpPacket->Length=0;
lpPacket->ulBytesReceived = 0;
lpPacket->bIoComplete = FALSE;
return lpPacket;
}
开发者ID:OPEXGroup,项目名称:winpcap,代码行数:30,代码来源:Packet32.c
示例18: CreatePallete
void CSpectrumFrame::CreatePallete()
{
Pallete=(LPBITMAPINFO)GlobalAllocPtr(GHND,
(sizeof (BITMAPINFO)+
(sizeof (RGBQUAD)*255 )));
Pallete->bmiHeader.biSize = 40;
Pallete->bmiHeader.biWidth = m_iDem;
Pallete->bmiHeader.biHeight = m_iDem;
Pallete->bmiHeader.biPlanes = 1;
Pallete->bmiHeader.biBitCount = 8;
Pallete->bmiHeader.biCompression=BI_RGB;
Pallete->bmiHeader.biSizeImage = 0;
Pallete->bmiHeader.biXPelsPerMeter = 0;
Pallete->bmiHeader.biYPelsPerMeter = 0;
Pallete->bmiHeader.biClrUsed = 0;
Pallete->bmiHeader.biClrImportant = 0;
for(int i=0;i<256;i++)
{
Pallete->bmiColors[i].rgbRed =
Pallete->bmiColors[i].rgbGreen =
Pallete->bmiColors[i].rgbBlue = i;
}
}
开发者ID:mclnsharma,项目名称:Multislice,代码行数:25,代码来源:SpectrumFrame.cpp
示例19: AllocLocalCompressFormat
void AllocLocalCompressFormat() {
if (pwfxLocal) {
//Do nothing....already allocated
}
else {
MMRESULT mmresult = acmMetrics(NULL, ACM_METRIC_MAX_SIZE_FORMAT, &cbwfxLocal);
if (MMSYSERR_NOERROR != mmresult)
{
CString msgstr;
msgstr.Format("Metrics failed mmresult=%u!", mmresult);
::MessageBox(NULL,msgstr,"Note", MB_OK | MB_ICONEXCLAMATION);
return ;
}
if (cbwfxLocal < cbwfx) cbwfxLocal = cbwfx;
pwfxLocal = (LPWAVEFORMATEX)GlobalAllocPtr(GHND, cbwfxLocal);
if (NULL == pwfxLocal)
{
CString msgstr;
msgstr.Format("GlobalAllocPtr(%lu) failed!", cbwfxLocal);
::MessageBox(NULL,msgstr,"Note", MB_OK | MB_ICONEXCLAMATION);
return ;
}
}
}
开发者ID:aisnote,项目名称:camstudio-clone,代码行数:34,代码来源:AudioFormat.cpp
示例20: return
/*
** PR_MD_malloc() -- exported as malloc()
**
*/
void *PR_MD_malloc( size_t size )
{
if( _pr_callback_funcs ) {
return (*_pr_callback_funcs->malloc)( size );
} else {
return GlobalAllocPtr(GPTR, (DWORD)size);
}
} /* end malloc() */
开发者ID:AbrahamJewowich,项目名称:FreeSWITCH,代码行数:12,代码来源:w16callb.c
注:本文中的GlobalAllocPtr函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论