本文整理匯總了C++中GETWORD函數的典型用法代碼示例。如果您正苦於以下問題:C++ GETWORD函數的具體用法?C++ GETWORD怎麽用?C++ GETWORD使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GETWORD函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: IT_REGSERVERDOC
void
IT_REGSERVERDOC (ENV *envp, LONGPROC f)
{
LHSERVER lhHandle;
LPSTR lpString1;
LPOLESERVERDOC lpdoc;
LPBYTE lpStr;
LHSERVERDOC lhdoc;
DWORD retcode;
lhHandle = (LHSERVER)GETDWORD(SP+16);
lpString1 = (LPSTR)GetAddress(GETWORD(SP+14),GETWORD(SP+12));
#ifdef LATER
translate the LPOLESERVERDOC and the structures behind it
#endif
lpdoc = (LPOLESERVERDOC)GETDWORD(SP+8);
lpStr = (LPBYTE)GetAddress(GETWORD(SP+6),GETWORD(SP+4));
retcode = OleRegisterServerDoc(lhHandle,
lpString1,
lpdoc,
&lhdoc);
PUTDWORD(lpStr,lhdoc);
envp->reg.sp += 2*DWORD_86 + 2*LP_86 + RET_86;
envp->reg.ax = LOWORD(retcode);
envp->reg.dx = HIWORD(retcode);
}
示例2: IT_LOADACCEL
void
IT_LOADACCEL (ENV *envp,LONGPROC f)
{
LPSTR lpString;
HGLOBAL hGlobal;
WORD wSel = 0;
MEMORYINFO *lpMemory;
HINSTANCE hInst;
lpString = (LPSTR)GetAddress(GETWORD(SP+6),GETWORD(SP+4));
hInst = GetSelectorHandle(GETWORD(SP+8));
hGlobal = (f)((HANDLE) hInst,lpString);
if (hGlobal && (lpMemory = GETHANDLEINFO(hGlobal))) {
if (lpMemory->lpData == NULL)
lpMemory->lpData = (LPSTR)ConvertResourceToBin
((LPBYTE)lpMemory->lpCore,lpMemory->wIndex);
if (lpMemory->lpData) {
wSel = AssignSelector((LPBYTE)lpMemory->lpData + 4,0,
TRANSFER_DATA,lpMemory->dwBinSize);
SetSelectorHandle(wSel,hGlobal);
}
}
envp->reg.ax = wSel & 0xfffe;
envp->reg.dx = 0;
envp->reg.sp += HANDLE_86 + LP_86 + RET_86;
if (lpMemory)
RELEASEHANDLEINFO(lpMemory);
}
示例3: IT_WINEXEC
void
IT_WINEXEC (ENV *envp,LONGPROC f)
{
char buf[0x100];
LPSTR lpCmdLine,lpTemp;
LPSTR lpString;
DWORD retcode;
lpCmdLine = (LPSTR)GetAddress(GETWORD(SP+8),GETWORD(SP+6));
if (!lpCmdLine || !strlen(lpCmdLine))
retcode = 0;
else {
lpString = (LPSTR)WinStrdup(lpCmdLine);
lpTemp = strchr(lpString,' ');
if (lpTemp)
*lpTemp = '\0';
xdoscall(XDOS_GETALTNAME,0,(void *) buf,(void *) lpString);
if (strlen(buf) == 0)
strcpy(buf,lpString);
if (lpTemp) {
strcat(buf," ");
strcat(buf,++lpTemp);
}
retcode = (DWORD)WinExec(buf,(UINT)GETWORD(SP+4));
WinFree(lpString);
}
if (retcode > 32)
retcode = GetDataSelectorFromInstance(retcode);
envp->reg.ax = LOWORD(retcode);
envp->reg.dx = HIWORD(retcode);
envp->reg.sp += LP_86 + UINT_86 + RET_86;
}
示例4: IT_SIZEOFRESOURCE
void
IT_SIZEOFRESOURCE (ENV *envp,LONGPROC f)
{
DWORD retcode;
HINSTANCE hInst;
HRSRC hrsrc;
NAMEINFO *lpni = NULL;
MEMORYINFO *lpMemory;
hInst = (HINSTANCE)GetSelectorHandle(GETWORD(SP+6));
hrsrc = (HRSRC)GETWORD(SP+4);
lpMemory = GETHANDLEINFO(hrsrc);
if (lpMemory)
lpni = (NAMEINFO *)lpMemory->lpCore;
if (lpni) {
if (lpni->hGlobal) {
lpMemory = GETHANDLEINFO(lpni->hGlobal);
if (lpMemory && lpMemory->wType)
retcode = lpMemory->dwBinSize;
else
retcode = lpni->rcslength;
}
else
retcode = lpni->rcslength;
}
else
retcode = 0L;
envp->reg.ax = LOWORD(retcode);
envp->reg.dx = HIWORD(retcode);
envp->reg.sp += 2*HANDLE_86 + RET_86;
if (lpMemory)
RELEASEHANDLEINFO(lpMemory);
}
示例5: GETWORD
/**
* \brief This function loads some constants, this normally happens when the game is loaded
* and the values change depending on what is read for the mods
*/
void CPhysicsSettings::loadGameConstants(int episode, byte* data)
{
if(episode >= 4 && episode <= 6 )
{
// Galaxy Engine
fallspeed_increase = 7;
max_fallspeed = 175; // Factor 2.5 to the original assembly it is
misc.visibility = 7;
}
else
{
// Vorticon Engine
misc.visibility = 3;
fallspeed_increase = 4;
max_fallspeed = 104;
if(episode == 1)
{ // Code for Episode 1.
// player
byte pogo = *(data+0x900E);
player.pogostickonstart = pogo;
player.start_with_shots = *(data+0x9008);
// vorticon
vorticon.default_hp = *(data+0x180D)+1;
vorticon.commander_hp = *(data+0x1819)+1;
// tank bot
tankbot.shot_height_from_top = *(data+0x4900);
misc.ctspace_ammo = GETWORD(data+0xE03);
misc.ctspace_keys = GETWORD(data+0xE11);
misc.one_eyed_tile = GETWORD(data+0x4547);
misc.joy_tile = GETWORD(data+0x992A);
misc.bat_tile = GETWORD(data+0x995D);
misc.vac_tile = GETWORD(data+0x9990);
misc.wsk_tile = GETWORD(data+0x99C3);
misc.raygun_tile = GETWORD(data+0x1166);
misc.pogo_tile = GETWORD(data+0x11A7);
misc.changestoneblock = GETWORD(data+0x2414);
// TODO: ... More stuff will come here
}
else if(episode == 2)
{ // Code for Episode 2.
player.pogostickonstart = true;
player.start_with_shots = *(data+0x8AA2);
// TODO: ... More stuff will come here
}
else if(episode == 3)
{ // Code for Episode 3.
player.pogostickonstart = true;
player.start_with_shots = 5;
// TODO: ... More stuff will come here
}
}
}
示例6: GETOPEN
static const char *config_access(struct access **ls)
{
struct access *l;
GETOPEN();
while (NOTCLOSE()) {
REQWORD();
MAKE(l, struct access);
l->next = *ls;
*ls = l;
if (strceq(tokbuf, c_allow))
l->type = ALLOW;
else if (strceq(tokbuf, c_deny))
l->type = DENY;
else if (strceq(tokbuf, c_apply))
l->type = APPLY;
else
return e_keyword;
GETWORD();
if (*tokbuf == '*')
l->mask = l->addr = 0;
else {
if (strceq(tokbuf, c_exact))
l->mask = (unsigned long) -1;
else if ((l->mask = inet_addr(tokbuf))
== (unsigned long) -1)
return e_bad_addr;
GETWORD();
if ((l->addr = inet_addr(tokbuf))
== (unsigned long) -1)
return e_bad_addr;
}
}
return 0;
}
示例7: IT_GLOBALFREE
void
IT_GLOBALFREE (ENV *envp,LONGPROC f)
{
DWORD retcode;
WORD wSel;
HGLOBAL hGlobal;
wSel = GETWORD(SP+4) | 1;
if (wSel == 1)
{
envp->reg.sp += HANDLE_86 + RET_86;
envp->reg.ax = GETWORD(SP+4);
envp->reg.dx = 0;
return;
}
hGlobal = GetSelectorHandle(wSel);
ZapSegRegs(envp,wSel);
/* for HUGE objects */
while ((GetSelectorHandle((UINT)(wSel-8))==hGlobal))
wSel -= 8;
while (GetSelectorHandle(wSel) == hGlobal) {
FreeSelector(wSel);
wSel += 8;
}
retcode = (f)(hGlobal);
envp->reg.sp += HANDLE_86 + RET_86;
envp->reg.ax = LOWORD(retcode);
envp->reg.dx = HIWORD(retcode);
}
示例8: IT_COPYMETAFILE
void
IT_COPYMETAFILE(ENV *envp,LONGPROC f)
{
char buf[0x100];
WORD wSel;
HGLOBAL hGlobal;
LPSTR lpszFile;
LPBYTE lpData;
wSel = GETWORD(SP+8);
hGlobal = GetSelectorHandle(wSel);
lpszFile = GetAddress(GETWORD(SP+6),GETWORD(SP+4));
if (lpszFile && strchr(lpszFile,'\\')) {
xdoscall(XDOS_GETALTNAME,0,(void *) buf,(void *) lpszFile); lpszFile = buf;
}
hGlobal = CopyMetaFile(hGlobal,lpszFile);
if (hGlobal) {
lpData = (LPBYTE)GlobalLock(hGlobal);
wSel = AssignSelector(lpData,0,TRANSFER_DATA,
GlobalSize(hGlobal));
SetSelectorHandle(wSel,hGlobal);
GlobalUnlock(hGlobal);
}
else
wSel = 0;
envp->reg.sp += HANDLE_86 + LP_86 + RET_86;
envp->reg.ax = wSel & 0xfffe;
envp->reg.dx = 0;
}
示例9: h3600_micro_asset_read
int h3600_micro_asset_read( struct h3600_asset *asset )
{
unsigned char buf[2];
int retval = -1; // TODO: fix this to "no such asset"
if (0) printk("%s (%d)\n", __FUNCTION__, asset->type);
switch (asset->type) {
case ASSET_HM_VERSION:
retval = h3600_micro_eeprom_read( 0, asset->a.tchar, 10 );
break;
case ASSET_SERIAL_NUMBER:
retval = h3600_micro_eeprom_read( 10, asset->a.tchar, 40 );
break;
case ASSET_MODULE_ID:
retval = h3600_micro_eeprom_read( 50, asset->a.tchar, 20 );
break;
case ASSET_PRODUCT_REVISION:
retval = h3600_micro_eeprom_read( 70, asset->a.tchar, 10 );
break;
case ASSET_PRODUCT_ID:
retval = h3600_micro_eeprom_read( 80, buf, 2 );
asset->a.vshort = GETWORD(buf);
break;
case ASSET_FRAME_RATE:
retval = h3600_micro_eeprom_read( 82, buf, 2 );
asset->a.vshort = GETWORD(buf);
break;
case ASSET_PAGE_MODE:
retval = h3600_micro_eeprom_read( 84, buf, 2 );
asset->a.vshort = GETWORD(buf);
break;
case ASSET_COUNTRY_ID:
retval = h3600_micro_eeprom_read( 86, buf, 2 );
asset->a.vshort = GETWORD(buf);
break;
case ASSET_IS_COLOR_DISPLAY:
retval = h3600_micro_eeprom_read( 88, buf, 2 );
asset->a.vshort = GETWORD(buf);
break;
case ASSET_ROM_SIZE:
retval = h3600_micro_eeprom_read( 90, buf, 2 );
asset->a.vshort = GETWORD(buf);
break;
case ASSET_RAM_SIZE:
retval = h3600_micro_eeprom_read( 92, buf, 2 );
asset->a.vshort = GETWORD(buf);
break;
case ASSET_HORIZONTAL_PIXELS:
retval = h3600_micro_eeprom_read( 94, buf, 2 );
asset->a.vshort = GETWORD(buf);
break;
case ASSET_VERTICAL_PIXELS:
retval = h3600_micro_eeprom_read( 96, buf, 2 );
asset->a.vshort = GETWORD(buf);
break;
}
return retval;
}
示例10: IT_ISBADCODEPTR
void
IT_ISBADCODEPTR (ENV *envp,LONGPROC f)
{
DWORD retcode;
LPSTR lpString;
lpString = MAKELP(GETWORD(SP+8),GETWORD(SP+6));
retcode = (f)(lpString,0);
envp->reg.sp += LP_86 + RET_86;
envp->reg.ax = LOWORD(retcode);
envp->reg.dx = HIWORD(retcode);
}
示例11: IT_LOCALREALLOC
void
IT_LOCALREALLOC (ENV *envp,LONGPROC f) /* TWIN_LocalReAlloc */
{
DWORD retcode;
retcode = TWIN_LocalReAlloc((HANDLE)GETWORD(SP+8),
(UINT)GETWORD(SP+6),
(UINT)GETWORD(SP+4));
envp->reg.sp += HANDLE_86 + 2*UINT_86 + RET_86;
envp->reg.ax = LOWORD(retcode);
envp->reg.dx = HIWORD(retcode);
}
示例12: IT_ACCESSRESOURCE
void
IT_ACCESSRESOURCE (ENV *envp,LONGPROC f)
{
DWORD retcode;
retcode = (DWORD)AccessResourceBin(
(HINSTANCE)GetSelectorHandle(GETWORD(SP+6)),
(HRSRC)GETWORD(SP+4));
envp->reg.ax = LOWORD(retcode);
envp->reg.dx = HIWORD(retcode);
envp->reg.sp += 2*HANDLE_86 + RET_86;
}
示例13: IT_OLEENUMOBJ
void
IT_OLEENUMOBJ(ENV *envp,LONGPROC f)
{
DWORD retcode;
LPBYTE lp1;
lp1 = (LPBYTE)GetAddress(GETWORD(SP+6),GETWORD(SP+4));
retcode = OleEnumObjects((LHCLIENTDOC)GETDWORD(SP+8),
(LPOLEOBJECT *)lp1);
envp->reg.sp += LP_86 + LONG_86 + RET_86;
envp->reg.ax = LOWORD(retcode);
envp->reg.dx = HIWORD(retcode);
}
示例14: IT_LOCALALLOC
void
IT_LOCALALLOC (ENV *envp,LONGPROC f) /* TWIN_LocalAlloc */
{
DWORD retcode;
if (envp != envp_global)
envp_global = envp;
retcode = TWIN_LocalAlloc((UINT)GETWORD(SP+6),
(UINT)GETWORD(SP+4));
envp->reg.sp += 2*UINT_86 + RET_86;
envp->reg.ax = LOWORD(retcode);
envp->reg.dx = HIWORD(retcode);
}
示例15: IT_PLAYMETAFILE
void
IT_PLAYMETAFILE(ENV *envp,LONGPROC f)
{
HDC hDC;
WORD wSel;
HGLOBAL hGlobal;
hDC = GETWORD(SP+6);
wSel = GETWORD(SP+4);
hGlobal = GetSelectorHandle(wSel);
envp->reg.ax = PlayMetaFile(hDC, hGlobal);
envp->reg.sp += 2 * HANDLE_86 + RET_86;
}