本文整理匯總了C++中DosGetInfoBlocks函數的典型用法代碼示例。如果您正苦於以下問題:C++ DosGetInfoBlocks函數的具體用法?C++ DosGetInfoBlocks怎麽用?C++ DosGetInfoBlocks使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DosGetInfoBlocks函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: __PHYSFS_platformGetThreadID
PHYSFS_uint64 __PHYSFS_platformGetThreadID(void)
{
PTIB ptib;
PPIB ppib;
/*
* Allegedly, this API never fails, but we'll punt and return a
* default value (zero might as well do) if it does.
*/
BAIL_IF_MACRO(os2err(DosGetInfoBlocks(&ptib, &ppib)) != NO_ERROR, 0, 0);
return((PHYSFS_uint64) ptib->tib_ordinal);
} /* __PHYSFS_platformGetThreadID */
示例2: _sendQuery
static BOOL _sendQuery(PGROPDATA pGrop, PGROPQUERY pQuery, BOOL fPrivateEvSem)
{
ULONG ulRC;
BOOL fSuccess;
PTIB tib;
PPIB pib;
DosGetInfoBlocks( &tib, &pib );
if ( tib->tib_ptib2->tib2_ultid == pGrop->tid )
{
// Query send from callback function.
debug( "Query send from callback function." );
pQuery->hevReady = NULLHANDLE;
_wmGropQuery( pGrop, pQuery );
return pQuery->fSuccess;
/* return (BOOL)WinSendMsg( pGrop->hwnd, WM_GROP_QUERY, MPFROMP( pQuery ), 0 )
&& pQuery->fSuccess;*/
}
if ( fPrivateEvSem )
{
ulRC = DosCreateEventSem( NULL, &pQuery->hevReady, 0, FALSE );
if ( ulRC != NO_ERROR )
{
debug( "DosCreateEventSem(), rc = %u.", ulRC );
return FALSE;
}
}
else
pQuery->hevReady = pGrop->hevReady;
fSuccess = WinPostMsg( pGrop->hwnd, WM_GROP_QUERY, MPFROMP( pQuery ), 0 );
if ( !fSuccess )
{
debug( "WinPostMsg() failed" );
}
else
{
ulRC = DosWaitEventSem( pQuery->hevReady, 3000 );
if ( ulRC != NO_ERROR )
{
debug( "DosWaitEventSem(), rc = %u.", ulRC );
}
fSuccess = pQuery->fSuccess;
}
if ( fPrivateEvSem )
DosCloseEventSem( pQuery->hevReady );
return fSuccess;
}
示例3: os2MutexNotheld
static int os2MutexNotheld(sqlite3_mutex *p){
TID tid;
PID pid;
ULONG ulCount;
PTIB ptib;
if( p!= 0 ) {
DosQueryMutexSem(p->mutex, &pid, &tid, &ulCount);
} else {
DosGetInfoBlocks(&ptib, NULL);
tid = ptib->tib_ptib2->tib2_ultid;
}
return p==0 || p->nRef==0 || p->owner!=tid;
}
示例4: DosGetInfoBlocks
static unsigned char *get_cmdline( void )
{
PTIB ptib;
PPIB ppib;
/* Get a pointer to the first through n arguments that were entered on */
/* the command line. */
DosGetInfoBlocks( &ptib, &ppib );
return (ppib->pib_pchcmd);
}
示例5: morph
void morph(void)
{
PPIB ppib = NULL;
PTIB ptib = NULL;
APIRET rc;
rc = DosGetInfoBlocks(&ptib,&ppib);
if (rc != NO_ERROR)
{
printf("DosGetInfoBlocks Error : %d\n",rc);
exit(-1);
}
ppib->pib_ultype = 3;
}
示例6: return
static char *OS_GET_CMD_LINE( void )
{
PTIB tib;
PPIB pib;
char *cmd;
if( DosGetInfoBlocks(&tib, &pib) )
return( NULL );
cmd = pib->pib_pchcmd;
while( *cmd ) ++cmd; /* skip over second copy of program name */
++cmd;
return( cmd );
}
示例7: EnumConfigPaths
bool EnumConfigPaths(char *Path,int Number)
{
#ifdef _EMX
static char RARFileName[NM];
if (Number==-1)
strcpy(RARFileName,Path);
if (Number!=0)
return(false);
if (_osmode==OS2_MODE)
{
PTIB ptib;
PPIB ppib;
DosGetInfoBlocks(&ptib, &ppib);
DosQueryModuleName(ppib->pib_hmte,NM,Path);
}
else
strcpy(Path,RARFileName);
RemoveNameFromPath(Path);
return(true);
#elif defined(_UNIX)
if (Number==0)
{
char *EnvStr=getenv("HOME");
if (EnvStr==NULL)
return(false);
strncpy(Path,EnvStr,NM);
Path[NM-1]=0;
return(true);
}
static const char *AltPath[]={
"/etc","/usr/lib","/usr/local/lib","/usr/local/etc"
};
Number--;
if (Number<0 || Number>=(int)(sizeof(AltPath)/sizeof(AltPath[0])))
return(false);
strcpy(Path,AltPath[Number]);
return(true);
#elif defined(_WIN_32)
if (Number!=0)
return(false);
#if !defined(_LINUX)
GetModuleFileName(NULL,Path,NM);
RemoveNameFromPath(Path);
#endif
return(true);
#else
return(false);
#endif
}
示例8: enable_os2_iostreams
static
void enable_os2_iostreams( void )
{
PTIB thread_block;
PPIB process_block;
/* XXX : This is a very nasty hack, it fools OS/2 and let the program */
/* call PM functions, even though stdin/stdout/stderr are still */
/* directed to the standard i/o streams.. */
/* The program must be compiled with WINDOWCOMPAT */
/* */
/* Credits go to Michal for finding this !! */
/* */
DosGetInfoBlocks( &thread_block, &process_block );
process_block->pib_ultype = 3;
}
示例9: getSGID
ULONG APIENTRY getSGID( VOID )
{
PQTOPLEVEL pQTopLevel = ( PQTOPLEVEL )m_achSysState;
PPIB ppib;
if( m_ulSGID != ( ULONG )-1 )
return m_ulSGID;
DosGetInfoBlocks( NULL, &ppib );
DosQuerySysState( 0x01, 0, ppib->pib_ulpid, 1, pQTopLevel, BUF_SIZE );
m_ulSGID = pQTopLevel->procdata->sessid;
return m_ulSGID;
}
示例10: archdep_init
int archdep_init(int *argc, char **argv)
{
/* This is right way to do this in OS/2 (not via argv[0]) */
TIB *pTib;
PIB *pPib;
DosGetInfoBlocks(&pTib, &pPib);
DosQueryModuleName(pPib->pib_hmte, CCHMAXPATH, argv0);
orig_workdir = (char *)getcwd(NULL, CCHMAXPATH);
atexit(restore_workdir);
PM_open();
#if !defined __X1541__ && !defined __PETCAT__
archdep_create_mutex_sem(&hmtxSpawn, "Spawn", FALSE);
#endif
return 0;
}
示例11: init_pm
int init_pm(void)
{
PPIB pib;
PTIB tib;
APIRET rc;
HMODULE hMte = 0;
char loadErr[256];
if(hab || hmq)
return 0;
rc = DosGetInfoBlocks(&tib, &pib);
rc = DosQueryModuleHandle("PMWIN", &hMte);
if(rc)
return 1;
pib->pib_ultype = 3;
rc = DosLoadModule(loadErr, sizeof(loadErr), "PMWIN", &hMte);
if(rc)
return 1;
rc = DosQueryProcAddr(hMte, 707, 0, (PFN*)&_inCloseClipbrd);
rc = DosQueryProcAddr(hMte, 716, 0, (PFN*)&_inCreateMsgQueue);
rc = DosQueryProcAddr(hMte, 726, 0, (PFN*)&_inDestroyMsgQueue);
rc = DosQueryProcAddr(hMte, 733, 0, (PFN*)&_inEmptyClipbrd);
rc = DosQueryProcAddr(hMte, 763, 0, (PFN*)&_inInitialize);
rc = DosQueryProcAddr(hMte, 793, 0, (PFN*)&_inOpenClipbrd);
rc = DosQueryProcAddr(hMte, 806, 0, (PFN*)&_inQueryClipbrdData);
rc = DosQueryProcAddr(hMte, 807, 0, (PFN*)&_inQueryClipbrdFmtInfo);
rc = DosQueryProcAddr(hMte, 854, 0, (PFN*)&_inSetClipbrdData);
rc = DosQueryProcAddr(hMte, 888, 0, (PFN*)&_inTerminate);
hab = _inInitialize(0);
hmq = _inCreateMsgQueue(hab, 0);
return 0;
}
示例12: __objc_thread_get_priority
/* Return the current thread's priority. */
int
__objc_thread_get_priority(void)
{
PTIB ptib;
PPIB ppib;
/* get information about current thread */
DosGetInfoBlocks (&ptib,&ppib);
switch (ptib->tib_ptib2->tib2_ulpri)
{
case PRTYC_IDLETIME:
case PRTYC_REGULAR:
case PRTYC_TIMECRITICAL:
case PRTYC_FOREGROUNDSERVER:
default:
return OBJC_THREAD_INTERACTIVE_PRIORITY;
}
return -1;
}
示例13: RTSysInit
unsigned RTSysInit( void ) {
//===========================
if( RTSysInitialized ) return( 0 );
#if defined( __OS2__ ) && defined( __386__ )
{
#define INCL_DOSPROCESS
#include <os2.h>
TIB *ptib;
PIB *ppib;
DosGetInfoBlocks( &ptib, &ppib );
if( ppib->pib_ultype == 3 ) {
if( _WindowsStdout == 0 ) {
__FAppType = FAPP_GUI;
} else {
__FAppType = FAPP_DEFAULT_GUI;
}
}
}
#elif defined( __NT__ )
{
if( _WindowsStdout != 0 ) {
__FAppType = FAPP_DEFAULT_GUI;
}
}
#endif
// WATFOR-77 calls __ErrorInit() when it starts
__ErrorInit( _LpPgmName );
RTSysInitialized = 1;
__InitRTData(); // for main thread
_ExceptionInit();
// call to RTSysFini() is done in LGSysFini() for load'n go
// (i.e. we must call RTSysFini() after each time we execute, not when
// WATFOR-77 exits in case we are operating in batch mode)
atexit( &RTSysFini );
return( 0 );
}
示例14: DosGetInfoBlocks
/*--------------------------------------------------------------------------------------*\
* UApm : intialize() *
\*--------------------------------------------------------------------------------------*/
UApm &UApm::initialize(void)
{
TIB *ptib; /* Thread information block */
PIB *ppib; /* Process information block */
char *pcTemp;
/* Query the fully qualified path APM/2 was loaded from.
Once we know the language to use we replace ".exe"
by e.g. "xx.msg" where xx is the NLS message file,
but for now we assume English as this one is shipped
with APM/2 for sure */
DosGetInfoBlocks(&ptib, &ppib);
DosQueryModuleName(ppib->pib_hmte, sizeof(acMessageFileUs), (PCHAR)acMessageFileUs);
pcCommandline=strdup(strchr(ppib->pib_pchcmd, '\0')+1);
pcTemp=strrchr(acMessageFileUs, '.');
if(pcTemp!=0)
strcpy(pcTemp, "Us.msg");
strcpy(acMessageFileNls, acMessageFileUs);
/* Query the version we're running */
DosQuerySysInfo(QSV_VERSION_MAJOR, QSV_VERSION_MINOR, ulVersion, sizeof(ulVersion));
return(*this);
}
示例15: DosScanEnv
APIRET APIENTRY DosScanEnv(PCSZ pszName,
PSZ *ppszValue)
{
char varname[CCHMAXPATH];
PPIB pib;
PTIB tib;
int i;
char *p, *q, *env;
/* Get application info blocks */
DosGetInfoBlocks(&tib, &pib);
/* get the environment */
env = pib->pib_pchenv;
/* search for needed env variable */
for (p = env; *p; p += strlen(p) + 1)
{
// move until '=' sign is encountered
for (i = 0, q = p; *q && *q != '=' && i < CCHMAXPATH - 1; q++, i++) ;
/* copy to name buffer */
strncpy(varname, p, i);
/* add ending zero byte */
varname[i] = '\0';
if (!strcasecmp(varname, pszName))
{
/* variable found */
*ppszValue = q + 1;
return NO_ERROR;
}
}
return ERROR_ENVVAR_NOT_FOUND;
}