replaced many uses of libc calls with SDL_ counterparts in os2 sources.

TODO: core/os2 and geniconv sources _must_ be updated, as well..
This commit is contained in:
Ozkan Sezer 2021-10-04 23:00:28 +03:00
parent dd9b2daf8d
commit e92a639b23
6 changed files with 46 additions and 50 deletions

View file

@ -87,7 +87,7 @@ static LONG APIENTRY cbAudioWriteEvent(ULONG ulStatus, PMCI_MIX_BUFFER pBuffer,
debug_os2("DosPostEventSem(), rc = %u", ulRC); debug_os2("DosPostEventSem(), rc = %u", ulRC);
} }
return 1; /* It seems, return value is not matter. */ return 1; /* return value doesn't seem to matter. */
} }
static LONG APIENTRY cbAudioReadEvent(ULONG ulStatus, PMCI_MIX_BUFFER pBuffer, static LONG APIENTRY cbAudioReadEvent(ULONG ulStatus, PMCI_MIX_BUFFER pBuffer,
@ -133,7 +133,7 @@ static void OS2_DetectDevices(void)
return; return;
} }
ulDevicesNum = atol(stMCISysInfo.pszReturn); ulDevicesNum = SDL_strtoul(stMCISysInfo.pszReturn, NULL, 10);
for (stSysInfoParams.ulNumber = 0; stSysInfoParams.ulNumber < ulDevicesNum; for (stSysInfoParams.ulNumber = 0; stSysInfoParams.ulNumber < ulDevicesNum;
stSysInfoParams.ulNumber++) { stSysInfoParams.ulNumber++) {
@ -151,7 +151,7 @@ static void OS2_DetectDevices(void)
/* Get textual product description. */ /* Get textual product description. */
stSysInfoParams.ulItem = MCI_SYSINFO_QUERY_DRIVER; stSysInfoParams.ulItem = MCI_SYSINFO_QUERY_DRIVER;
stSysInfoParams.pSysInfoParm = &stLogDevice; stSysInfoParams.pSysInfoParm = &stLogDevice;
strcpy(stLogDevice.szInstallName, stSysInfoParams.pszReturn); SDL_strlcpy(stLogDevice.szInstallName, stSysInfoParams.pszReturn, MAX_DEVICE_NAME);
ulRC = mciSendCommand(0, MCI_SYSINFO, MCI_WAIT | MCI_SYSINFO_ITEM, ulRC = mciSendCommand(0, MCI_SYSINFO, MCI_WAIT | MCI_SYSINFO_ITEM,
&stSysInfoParams, 0); &stSysInfoParams, 0);
if (ulRC != NO_ERROR) { if (ulRC != NO_ERROR) {
@ -211,10 +211,8 @@ static void OS2_CloseDevice(_THIS)
return; return;
/* Close up audio */ /* Close up audio */
if (pAData->usDeviceId != (USHORT)~0) { if (pAData->usDeviceId != (USHORT)~0) { /* Device is open. */
/* Device is open. */ if (pAData->stMCIMixSetup.ulBitsPerSample != 0) { /* Mixer was initialized. */
if (pAData->stMCIMixSetup.ulBitsPerSample != 0) {
/* Mixer was initialized. */
ulRC = mciSendCommand(pAData->usDeviceId, MCI_MIXSETUP, ulRC = mciSendCommand(pAData->usDeviceId, MCI_MIXSETUP,
MCI_WAIT | MCI_MIXSETUP_DEINIT, MCI_WAIT | MCI_MIXSETUP_DEINIT,
&pAData->stMCIMixSetup, 0); &pAData->stMCIMixSetup, 0);
@ -223,8 +221,7 @@ static void OS2_CloseDevice(_THIS)
} }
} }
if (pAData->cMixBuffers != 0) { if (pAData->cMixBuffers != 0) { /* Buffers was allocated. */
/* Buffers was allocated. */
MCI_BUFFER_PARMS stMCIBuffer; MCI_BUFFER_PARMS stMCIBuffer;
stMCIBuffer.ulBufferSize = pAData->aMixBuffers[0].ulBufferLength; stMCIBuffer.ulBufferSize = pAData->aMixBuffers[0].ulBufferLength;
@ -410,15 +407,13 @@ static int OS2_OpenDevice(_THIS, void *handle, const char *devname,
pAData->aMixBuffers[ulIdx].ulBufferLength = stMCIBuffer.ulBufferSize; pAData->aMixBuffers[ulIdx].ulBufferLength = stMCIBuffer.ulBufferSize;
pAData->aMixBuffers[ulIdx].ulUserParm = (ULONG)pAData; pAData->aMixBuffers[ulIdx].ulUserParm = (ULONG)pAData;
memset(((PMCI_MIX_BUFFER)stMCIBuffer.pBufList)[ulIdx].pBuffer, SDL_memset(((PMCI_MIX_BUFFER)stMCIBuffer.pBufList)[ulIdx].pBuffer,
_this->spec.silence, stMCIBuffer.ulBufferSize); _this->spec.silence, stMCIBuffer.ulBufferSize);
} }
/* Write buffers to kick off the amp mixer */ /* Write buffers to kick off the amp mixer */
/*pAData->ulQueuedBuf = 1;//stMCIBuffer.ulNumBuffers */
ulRC = pAData->stMCIMixSetup.pmixWrite(pAData->stMCIMixSetup.ulMixHandle, ulRC = pAData->stMCIMixSetup.pmixWrite(pAData->stMCIMixSetup.ulMixHandle,
pAData->aMixBuffers, pAData->aMixBuffers, 1);
1 /*stMCIBuffer.ulNumBuffers*/);
if (ulRC != MCIERR_SUCCESS) { if (ulRC != MCIERR_SUCCESS) {
_mixIOError("pmixWrite", ulRC); _mixIOError("pmixWrite", ulRC);
return -1; return -1;

View file

@ -147,7 +147,7 @@ struct _joycfg
/* OS/2 Implementation Function Prototypes */ /* OS/2 Implementation Function Prototypes */
static int joyPortOpen(HFILE * hGame); static int joyPortOpen(HFILE * hGame);
static void joyPortClose(HFILE * hGame); static void joyPortClose(HFILE * hGame);
static int joyGetData(char *joyenv, char *name, char stopchar, size_t maxchars); static int joyGetData(const char *joyenv, char *name, char stopchar, size_t maxchars);
static int joyGetEnv(struct _joycfg * joydata); static int joyGetEnv(struct _joycfg * joydata);
@ -700,7 +700,7 @@ static void joyPortClose(HFILE * hGame)
/***************************/ /***************************/
static int joyGetEnv(struct _joycfg * joydata) static int joyGetEnv(struct _joycfg * joydata)
{ {
char *joyenv; /* Pointer to tested character */ const char *joyenv; /* Pointer to tested character */
char tempnumber[5]; /* Temporary place to put numeric texts */ char tempnumber[5]; /* Temporary place to put numeric texts */
joyenv = SDL_getenv("SDL_OS2_JOYSTICK"); joyenv = SDL_getenv("SDL_OS2_JOYSTICK");
@ -711,30 +711,29 @@ static int joyGetEnv(struct _joycfg * joydata)
/* If the string name starts with '... get if fully */ /* If the string name starts with '... get if fully */
if (*joyenv == '\'') joyenv += joyGetData(++joyenv,joydata->name,'\'',sizeof(joydata->name)); if (*joyenv == '\'') joyenv += joyGetData(++joyenv,joydata->name,'\'',sizeof(joydata->name));
/* If not, get it until the next space */ /* If not, get it until the next space */
else if (*joyenv == '\"') joyenv+=joyGetData(++joyenv,joydata->name,'\"',sizeof(joydata->name)); else if (*joyenv == '\"') joyenv += joyGetData(++joyenv,joydata->name,'\"',sizeof(joydata->name));
else joyenv += joyGetData(joyenv,joydata->name,' ',sizeof(joydata->name)); else joyenv += joyGetData(joyenv,joydata->name,' ',sizeof(joydata->name));
/* Now get the number of axes */ /* Now get the number of axes */
while (*joyenv == ' ' && *joyenv != 0) joyenv++; /* jump spaces... */ while (*joyenv == ' ' && *joyenv != 0) joyenv++; /* jump spaces... */
joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber)); joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber));
joydata->axes = atoi(tempnumber); joydata->axes = SDL_atoi(tempnumber);
/* Now get the number of buttons */ /* Now get the number of buttons */
while (*joyenv == ' ' && *joyenv != 0) joyenv++; /* jump spaces... */ while (*joyenv == ' ' && *joyenv != 0) joyenv++; /* jump spaces... */
joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber)); joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber));
joydata->buttons = atoi(tempnumber); joydata->buttons = SDL_atoi(tempnumber);
/* Now get the number of hats */ /* Now get the number of hats */
while (*joyenv == ' ' && *joyenv != 0) joyenv++; /* jump spaces... */ while (*joyenv == ' ' && *joyenv != 0) joyenv++; /* jump spaces... */
joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber)); joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber));
joydata->hats = atoi(tempnumber); joydata->hats = SDL_atoi(tempnumber);
/* Now get the number of balls */ /* Now get the number of balls */
while (*joyenv==' ' && *joyenv != 0) joyenv++; /* jump spaces... */ while (*joyenv==' ' && *joyenv != 0) joyenv++; /* jump spaces... */
joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber)); joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber));
joydata->balls = atoi(tempnumber); joydata->balls = SDL_atoi(tempnumber);
return 1; return 1;
} }
@ -742,7 +741,7 @@ static int joyGetEnv(struct _joycfg * joydata)
/* Get a text from in the string starting in joyenv until it finds */ /* Get a text from in the string starting in joyenv until it finds */
/* the stopchar or maxchars is reached. The result is placed in name. */ /* the stopchar or maxchars is reached. The result is placed in name. */
/************************************************************************/ /************************************************************************/
static int joyGetData(char *joyenv, char *name, char stopchar, size_t maxchars) static int joyGetData(const char *joyenv, char *name, char stopchar, size_t maxchars)
{ {
char *nameptr; /* Pointer to the selected character */ char *nameptr; /* Pointer to the selected character */
int chcnt = 0; /* Count how many characters where copied */ int chcnt = 0; /* Count how many characters where copied */

View file

@ -302,10 +302,10 @@ static BOOL voUpdate(PVODATA pVOData, HWND hwnd, SDL_Rect *pSDLRects,
debug_os2("Not enough stack size"); debug_os2("Not enough stack size");
return FALSE; return FALSE;
} }
memset(pbLineMask, 0, pVOData->ulHeight); SDL_memset(pbLineMask, 0, pVOData->ulHeight);
for ( ; ((LONG)cSDLRects) > 0; cSDLRects--, pSDLRects++) { for ( ; ((LONG)cSDLRects) > 0; cSDLRects--, pSDLRects++) {
memset(&pbLineMask[pSDLRects->y], 1, pSDLRects->h); SDL_memset(&pbLineMask[pSDLRects->y], 1, pSDLRects->h);
} }
ulRC = DiveBlitImageLines(pVOData->hDive, pVOData->ulDIVEBufNum, ulRC = DiveBlitImageLines(pVOData->hDive, pVOData->ulDIVEBufNum,

View file

@ -69,7 +69,7 @@ static VOID _wmInitDlg(HWND hwnd, MSGBOXDLGDATA *pDlgData)
if (WinQueryClassName(hWndNext, sizeof(acBuf), acBuf) == 0) if (WinQueryClassName(hWndNext, sizeof(acBuf), acBuf) == 0)
continue; continue;
if (strcmp(acBuf, "#3") == 0) { /* Class name of button. */ if (SDL_strcmp(acBuf, "#3") == 0) { /* Class name of button. */
if (cButtons < sizeof(aButtons) / sizeof(struct _BUTTON)) { if (cButtons < sizeof(aButtons) / sizeof(struct _BUTTON)) {
aButtons[cButtons].hwnd = hWndNext; aButtons[cButtons].hwnd = hWndNext;
cButtons++; cButtons++;
@ -176,7 +176,7 @@ static VOID _wmInitDlg(HWND hwnd, MSGBOXDLGDATA *pDlgData)
SWP_MOVE | SWP_SIZE); SWP_MOVE | SWP_SIZE);
} }
MRESULT EXPENTRY DynDlgProc(HWND hwnd, USHORT message, MPARAM mp1, MPARAM mp2) static MRESULT EXPENTRY DynDlgProc(HWND hwnd, USHORT message, MPARAM mp1, MPARAM mp2)
{ {
switch (message) { switch (message) {
case WM_INITDLG: case WM_INITDLG:
@ -206,9 +206,9 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata)
ULONG cSDLBtnData = messageboxdata->numbuttons; ULONG cSDLBtnData = messageboxdata->numbuttons;
PSZ pszTitle = OS2_UTF8ToSys((PSZ) messageboxdata->title); PSZ pszTitle = OS2_UTF8ToSys((PSZ) messageboxdata->title);
ULONG cbTitle = (pszTitle == NULL)? 0 : strlen(pszTitle); ULONG cbTitle = (pszTitle == NULL)? 1 : (SDL_strlen(pszTitle) + 1);
PSZ pszText = OS2_UTF8ToSys((PSZ) messageboxdata->message); PSZ pszText = OS2_UTF8ToSys((PSZ) messageboxdata->message);
ULONG cbText = (pszText == NULL)? 0 : strlen(pszText); ULONG cbText = (pszText == NULL)? 1 : (SDL_strlen(pszText) + 1);
PDLGTEMPLATE pTemplate; PDLGTEMPLATE pTemplate;
ULONG cbTemplate; ULONG cbTemplate;
@ -218,23 +218,25 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata)
PSZ pszBtnText; PSZ pszBtnText;
ULONG cbBtnText; ULONG cbBtnText;
HWND hwnd; HWND hwnd;
const SDL_MessageBoxColor* pSDLColors = (messageboxdata->colorScheme == NULL)? const SDL_MessageBoxColor* pSDLColors = (messageboxdata->colorScheme == NULL)?
NULL : messageboxdata->colorScheme->colors; NULL : messageboxdata->colorScheme->colors;
const SDL_MessageBoxColor* pSDLColor; const SDL_MessageBoxColor* pSDLColor;
MSGBOXDLGDATA stDlgData; MSGBOXDLGDATA stDlgData;
/* Build a dialog tamplate in memory */ /* Build a dialog tamplate in memory */
/* Size of template (cbTemplate). */ /* Size of template */
cbTemplate = sizeof(DLGTEMPLATE) + ((2 + cSDLBtnData) * sizeof(DLGTITEM)) + cbTemplate = sizeof(DLGTEMPLATE) + ((2 + cSDLBtnData) * sizeof(DLGTITEM)) +
sizeof(ULONG) + /* First item data - frame control data. */ sizeof(ULONG) + /* First item data - frame control data. */
cbTitle + 1 + /* First item data - frame title + ZERO. */ cbTitle + /* First item data - frame title + ZERO. */
cbText + 1 + /* Second item data - ststic text + ZERO.*/ cbText + /* Second item data - ststic text + ZERO.*/
3; /* Third item data - system icon Id. */ 3; /* Third item data - system icon Id. */
/* Button items datas - text for buttons. */ /* Button items datas - text for buttons. */
for (ulIdx = 0; ulIdx < cSDLBtnData; ulIdx++) { for (ulIdx = 0; ulIdx < cSDLBtnData; ulIdx++) {
pszBtnText = (PSZ)pSDLBtnData[ulIdx].text; pszBtnText = (PSZ)pSDLBtnData[ulIdx].text;
cbTemplate += (pszBtnText == NULL)? 1 : (strlen(pszBtnText) + 1); cbTemplate += (pszBtnText == NULL)? 1 : (SDL_strlen(pszBtnText) + 1);
} }
/* Presentation parameter space. */ /* Presentation parameter space. */
if (pSDLColors != NULL) if (pSDLColors != NULL)
@ -268,11 +270,11 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata)
pDlgItem->cchClassName = 0; pDlgItem->cchClassName = 0;
pDlgItem->offClassName = (USHORT)WC_FRAME; pDlgItem->offClassName = (USHORT)WC_FRAME;
/* Length of text. */ /* Length of text. */
pDlgItem->cchText = cbTitle + 1; /* +1 - trailing ZERO. */ pDlgItem->cchText = cbTitle;
pDlgItem->offText = pcDlgData - (PCHAR)pTemplate; /* Offset to title text. */ pDlgItem->offText = pcDlgData - (PCHAR)pTemplate; /* Offset to title text. */
/* Copy text for the title into the dialog template. */ /* Copy text for the title into the dialog template. */
if (pszTitle != NULL) { if (pszTitle != NULL) {
strcpy(pcDlgData, pszTitle); SDL_memcpy(pcDlgData, pszTitle, cbTitle);
} else { } else {
*pcDlgData = '\0'; *pcDlgData = '\0';
} }
@ -322,11 +324,11 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata)
pDlgItem->cchClassName = 0; pDlgItem->cchClassName = 0;
pDlgItem->offClassName = (USHORT)WC_STATIC; pDlgItem->offClassName = (USHORT)WC_STATIC;
pDlgItem->cchText = cbText + 1; pDlgItem->cchText = cbText;
pDlgItem->offText = pcDlgData - (PCHAR)pTemplate; /* Offset to the text. */ pDlgItem->offText = pcDlgData - (PCHAR)pTemplate; /* Offset to the text. */
/* Copy message text into the dialog template. */ /* Copy message text into the dialog template. */
if (pszText != NULL) { if (pszText != NULL) {
strcpy(pcDlgData, pszText); SDL_memcpy(pcDlgData, pszText, cbText);
} else { } else {
*pcDlgData = '\0'; *pcDlgData = '\0';
} }
@ -401,12 +403,12 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata)
pDlgItem->offClassName = (USHORT)WC_BUTTON; pDlgItem->offClassName = (USHORT)WC_BUTTON;
pszBtnText = OS2_UTF8ToSys((PSZ)pSDLBtnData[ulIdx].text); pszBtnText = OS2_UTF8ToSys((PSZ)pSDLBtnData[ulIdx].text);
cbBtnText = (pszBtnText == NULL)? 0 : strlen(pszBtnText); cbBtnText = (pszBtnText == NULL)? 1 : (SDL_strlen(pszBtnText) + 1);
pDlgItem->cchText = cbBtnText + 1; pDlgItem->cchText = cbBtnText;
pDlgItem->offText = pcDlgData - (PCHAR)pTemplate; /* Offset to the text. */ pDlgItem->offText = pcDlgData - (PCHAR)pTemplate; /* Offset to the text. */
/* Copy text for the button into the dialog template. */ /* Copy text for the button into the dialog template. */
if (pszBtnText != NULL) { if (pszBtnText != NULL) {
strcpy(pcDlgData, pszBtnText); SDL_memcpy(pcDlgData, pszBtnText, cbBtnText);
} else { } else {
*pcDlgData = '\0'; *pcDlgData = '\0';
} }

View file

@ -133,7 +133,7 @@ static BOOL _getSDLPixelFormatData(SDL_PixelFormat *pSDLPixelFormat,
default: default:
/* printf("Unknown color encoding: %.4s\n", fccColorEncoding);*/ /* printf("Unknown color encoding: %.4s\n", fccColorEncoding);*/
memset(pSDLPixelFormat, 0, sizeof(SDL_PixelFormat)); SDL_memset(pSDLPixelFormat, 0, sizeof(SDL_PixelFormat));
return FALSE; return FALSE;
} }
@ -403,7 +403,7 @@ static MRESULT _wmDrop(WINDATA *pWinData, PDRAGINFO pDragInfo)
pDragItem->hstrSourceName != NULLHANDLE) { pDragItem->hstrSourceName != NULLHANDLE) {
/* Get file name from the item. */ /* Get file name from the item. */
DrgQueryStrName(pDragItem->hstrContainerName, sizeof(acFName), acFName); DrgQueryStrName(pDragItem->hstrContainerName, sizeof(acFName), acFName);
pcFName = strchr(acFName, '\0'); pcFName = SDL_strchr(acFName, '\0');
DrgQueryStrName(pDragItem->hstrSourceName, DrgQueryStrName(pDragItem->hstrSourceName,
sizeof(acFName) - (pcFName - acFName), pcFName); sizeof(acFName) - (pcFName - acFName), pcFName);
@ -428,7 +428,7 @@ static MRESULT _wmDrop(WINDATA *pWinData, PDRAGINFO pDragInfo)
return (MRESULT)FALSE; return (MRESULT)FALSE;
} }
MRESULT EXPENTRY wndFrameProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) static MRESULT EXPENTRY wndFrameProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
{ {
HWND hwndClient = WinQueryWindow(hwnd, QW_BOTTOM); HWND hwndClient = WinQueryWindow(hwnd, QW_BOTTOM);
WINDATA * pWinData = (WINDATA *)WinQueryWindowULong(hwndClient, 0); WINDATA * pWinData = (WINDATA *)WinQueryWindowULong(hwndClient, 0);
@ -535,7 +535,7 @@ MRESULT EXPENTRY wndFrameProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
return pWinData->fnWndFrameProc(hwnd, msg, mp1, mp2); return pWinData->fnWndFrameProc(hwnd, msg, mp1, mp2);
} }
MRESULT EXPENTRY wndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) static MRESULT EXPENTRY wndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
{ {
WINDATA *pWinData = (WINDATA *)WinQueryWindowULong(hwnd, 0); WINDATA *pWinData = (WINDATA *)WinQueryWindowULong(hwnd, 0);
@ -691,7 +691,7 @@ MRESULT EXPENTRY wndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
} }
/* SDL routnes. /* SDL routines.
* ------------ * ------------
*/ */
@ -1343,9 +1343,9 @@ static int OS2_SetClipboardText(_THIS, const char *text)
debug_os2("Enter"); debug_os2("Enter");
if (pszText == NULL) if (pszText == NULL)
return -1; return -1;
cbText = SDL_strlen(pszText); cbText = SDL_strlen(pszText) + 1;
ulRC = DosAllocSharedMem((PPVOID)&pszClipboard, 0, cbText + 1, ulRC = DosAllocSharedMem((PPVOID)&pszClipboard, 0, cbText,
PAG_COMMIT | PAG_READ | PAG_WRITE | PAG_COMMIT | PAG_READ | PAG_WRITE |
OBJ_GIVEABLE | OBJ_GETTABLE | OBJ_TILE); OBJ_GIVEABLE | OBJ_GETTABLE | OBJ_TILE);
if (ulRC != NO_ERROR) { if (ulRC != NO_ERROR) {
@ -1354,7 +1354,7 @@ static int OS2_SetClipboardText(_THIS, const char *text)
return -1; return -1;
} }
strcpy(pszClipboard, pszText); SDL_memcpy(pszClipboard, pszText, cbText);
SDL_free(pszText); SDL_free(pszText);
if (!WinOpenClipbrd(pVData->hab)) { if (!WinOpenClipbrd(pVData->hab)) {

View file

@ -78,7 +78,7 @@ static HMODULE hmodVMan = NULLHANDLE;
static FNVMIENTRY *pfnVMIEntry = NULL; static FNVMIENTRY *pfnVMIEntry = NULL;
static ULONG ulVRAMAddress = 0; static ULONG ulVRAMAddress = 0;
VOID APIENTRY ExitVMan(VOID) static VOID APIENTRY ExitVMan(VOID)
{ {
if (ulVRAMAddress != 0 && hmodVMan != NULLHANDLE) { if (ulVRAMAddress != 0 && hmodVMan != NULLHANDLE) {
pfnVMIEntry(0, VMI_CMD_TERMPROC, NULL, NULL); pfnVMIEntry(0, VMI_CMD_TERMPROC, NULL, NULL);