Ignore:
Timestamp:
May 31, 2006, 12:03:38 AM (19 years ago)
Author:
pr
Message:

Move doshIsWarp4 to dosh2 and query Syslevel to determine W4/MCP difference

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1-0/src/helpers/dosh.c

    r311 r317  
    3030
    3131/*
    32  *      This file Copyright (C) 1997-2000 Ulrich M”ller.
     32 *      This file Copyright (C) 1997-2006 Ulrich M”ller.
    3333 *      This file is part of the "XWorkplace helpers" source package.
    3434 *      This is free software; you can redistribute it and/or modify
     
    233233
    234234    return brc;
    235 }
    236 
    237 /*
    238  *@@ doshIsWarp4:
    239  *      checks the OS/2 system version number.
    240  *
    241  *      Returns:
    242  *
    243  *      -- 0 (FALSE): OS/2 2.x or Warp 3 is running.
    244  *
    245  *      -- 1: Warp 4.0 is running.
    246  *
    247  *      -- 2: Warp 4.5 is running (WSeB or Warp 4 FP 13+ or eCS
    248  *            or ACP/MCP), or even something newer.
    249  *
    250  *@@changed V0.9.2 (2000-03-05) [umoeller]: reported TRUE on Warp 3 also; fixed
    251  *@@changed V0.9.6 (2000-10-16) [umoeller]: patched for speed
    252  *@@changed V0.9.9 (2001-04-04) [umoeller]: now returning 2 for Warp 4.5 and above
    253  */
    254 
    255 ULONG doshIsWarp4(VOID)
    256 {
    257     static BOOL     s_fQueried = FALSE;
    258     static ULONG    s_ulrc = 0;
    259 
    260     if (!s_fQueried)
    261     {
    262         // first call:
    263         ULONG       aulBuf[3];
    264 
    265         DosQuerySysInfo(QSV_VERSION_MAJOR,      // 11
    266                         QSV_VERSION_MINOR,      // 12
    267                         &aulBuf, sizeof(aulBuf));
    268         // Warp 3 is reported as 20.30
    269         // Warp 4 is reported as 20.40
    270         // Aurora is reported as 20.45 (regardless of convenience packs)
    271 
    272         if     (    (aulBuf[0] > 20)        // major > 20; not the case with Warp 3, 4, 5
    273                  || (   (aulBuf[0] == 20)   // major == 20 and minor >= 45
    274                      && (aulBuf[1] >= 45)
    275                     )
    276                )
    277             // Warp 4.5 or newer:
    278             s_ulrc = 2;
    279         else if (   (aulBuf[0] == 20)   // major == 20 and minor == 40
    280                  && (aulBuf[1] == 40)
    281                 )
    282             // Warp 4:
    283             s_ulrc = 1;
    284 
    285         s_fQueried = TRUE;
    286     }
    287 
    288     return (s_ulrc);
    289235}
    290236
Note: See TracChangeset for help on using the changeset viewer.