Example #1
0
// static int win32_getpid(void) {
int getpid(void) {
  int pid;
  pid = _getpid();
  /* Windows 9x appears to always reports a pid for threads and processes
   * that has the high bit set. So we treat the lower 31 bits as the
   * "real" PID for Perl's purposes. */
  if (IsWin95() && pid < 0) pid = -pid;
  return pid;
}
Example #2
0
int PASCAL WinMain(HINSTANCE hInst,
  HINSTANCE /*hPrevInst*/, LPSTR /*pszCmdLine*/,
  int /*nCmdShow*/)
{
    if (IsWin95())
    {
        if (GetModuleUsage(hInst) <= 1)
            SetModuleExpWinVer(hInst, 0x0400);
        SetTaskExpWinVer(GetCurrentTask(), 0x0400);
    }

    // do something else...

    if (IsWin95())
    {
        if (GetModuleUsage(hInst) <= 1)
            SetModuleExpWinVer(hInst, 0x030a);
        SetTaskExpWinVer(GetCurrentTask(), 0x030a);
    }
    return (0);
}
Example #3
0
static struct servent*
win32_savecopyservent(struct servent*d, struct servent*s, const char *proto)
{
    d->s_name = s->s_name;
    d->s_aliases = s->s_aliases;
    d->s_port = s->s_port;
#ifndef __BORLANDC__	/* Buggy on Win95 and WinNT-with-Borland-WSOCK */
    if (!IsWin95() && s->s_proto && strlen(s->s_proto))
	d->s_proto = s->s_proto;
    else
#endif
    if (proto && strlen(proto))
	d->s_proto = (char *)proto;
    else
	d->s_proto = "tcp";
   
    return d;
}
Example #4
0
static BOOL SetQueueExpWinVer(HGLOBAL hQueue, WORD wVer)
{
    LPBYTE pMQ = LPBYTE(MAKELP(hQueue, 0));
    if (!BAD_PTR(pMQ, 0x44))
    {
        if (IsWin95())
        {
            pMQ[0x42] = LOBYTE(wVer); // minor
            pMQ[0x43] = HIBYTE(wVer); // major
        }
        else
        {
            pMQ[0x36] = LOBYTE(wVer); // minor
            pMQ[0x37] = HIBYTE(wVer); // major
        }
        return (TRUE);
    }
    return (FALSE);
}