Changeset 21916 for trunk/src/kernel32


Ignore:
Timestamp:
Dec 18, 2011, 10:28:22 PM (14 years ago)
Author:
dmik
Message:

Merge branch gcc-kmk to trunk.

Location:
trunk
Files:
21 deleted
110 edited
11 copied

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1 bin
        2 Makefile.inc
         1env.cmd
         2LocalConfig.kmk
    • Property svn:mergeinfo set to
      /branches/gcc-kmkmergedeligible
  • trunk/src/kernel32/FastInfoBlocksa.asm

    r9910 r21916  
    2626;*******************************************************************************
    2727DATA32 segment use32 dword public 'DATA'
    28 _gpfibLIS       dd 0
    29 _gfpfibLIS      dd 0
    30 _gpfibGIS       dd 0
    31 _gfpfibGIS      dd 0
    32 _gpfibPIB       dd 0
     28__gpfibLIS       dd 0
     29__gfpfibLIS      dd 0
     30__gpfibGIS       dd 0
     31__gfpfibGIS      dd 0
     32__gpfibPIB       dd 0
    3333DATA32 ends
    34 
    35 extrn fibDumpAll:near
    3634
    3735
     
    3937;* Exported Symbols                                                            *
    4038;*******************************************************************************
    41 public _gpfibLIS
    42 public _gfpfibLIS
    43 public _gpfibGIS
    44 public _gfpfibGIS
    45 public _gpfibPIB
    46 public fibInit
     39public __gpfibLIS
     40public __gfpfibLIS
     41public __gpfibGIS
     42public __gfpfibGIS
     43public __gpfibPIB
     44public _fibInit
    4745
    4846
     
    6260; @remark
    6361;
    64 fibInit proc near
     62_fibInit proc near
    6563    push    ebp
    6664    mov     ebp, esp
    67     cmp     _gpfibPIB, 0
     65    cmp     __gpfibPIB, 0
    6866    jz      @doinit
    6967    jmp     @exit_ok
     
    114112    push    ss
    115113    push    dx
     114IFDEF __EMX__
     115    extrn _16_Dos16GetInfoSeg:far
     116    call    _16_Dos16GetInfoSeg
     117ELSE
    116118    extrn DOS16GETINFOSEG:far
    117119    call    DOS16GETINFOSEG
     120ENDIF
    118121    pop     dx                          ; sel LIS
    119122    pop     cx                          ; sel GIS
     
    148151    ; Store far pointers.
    149152    ;
    150     mov     word ptr [_gfpfibLIS + 2], dx
    151     mov     word ptr [_gfpfibGIS + 2], cx
     153    mov     word ptr [__gfpfibLIS + 2], dx
     154    mov     word ptr [__gfpfibGIS + 2], cx
    152155
    153156    ;
     
    156159    and     edx, 0fff8h
    157160    shl     edx, 13
    158     mov     [_gpfibLIS], edx
     161    mov     [__gpfibLIS], edx
    159162
    160163    and     ecx, 0fff8h
    161164    shl     ecx, 13
    162     mov     [_gpfibGIS], ecx
     165    mov     [__gpfibGIS], ecx
    163166
    164167
     
    178181    pop     eax                         ; ptib, ignore.
    179182    pop     eax                         ; ppib
    180     mov     [_gpfibPIB], eax
     183    mov     [__gpfibPIB], eax
    181184
    182185    ;
     
    188191    leave
    189192    ret
    190 fibInit endp
     193_fibInit endp
    191194
    192195
  • trunk/src/kernel32/Fileio.cpp

    r21566 r21916  
    11841184  DWORD sp = 0, lp = 0,attr;
    11851185  LPSTR tmpshortpath,tmplongpath;
    1186   LPSTR lpszShortPath1, lpszLongPath1;
     1186  LPCSTR lpszShortPath1;
     1187  LPSTR lpszLongPath1;
    11871188
    11881189   dprintf(("GetLongPathNameA %s %x %d", lpszShortPath, lpszLongPath, cchBuffer));
     
    12031204   }
    12041205
    1205    lpszShortPath1 = ODINHelperStripUNC((char*)lpszShortPath);
    1206    lpszLongPath1 = ODINHelperStripUNC((char*)lpszLongPath);
     1206   lpszShortPath1 = ODINHelperStripUNC(lpszShortPath);
     1207   lpszLongPath1 = ODINHelperStripUNC(lpszLongPath);
    12071208
    12081209   lstrcpyA(tmpshortpath,lpszShortPath1);
  • trunk/src/kernel32/HandleManager.cpp

    r21374 r21916  
    7070
    7171#include <vmutex.h>
    72 #include <win\thread.h>
     72#include <win/thread.h>
    7373
    7474#include <odinapi.h>
     
    170170    RasRemoveObject(rthHandles, a);                                   \
    171171  } while (0)
     172
     173extern "C" {
    172174
    173175/*****************************************************************************
     
    454456 *****************************************************************************/
    455457
    456 static ULONG INLINE _HMHandleQuery(HANDLE hHandle)
     458INLINE ULONG _HMHandleQuery(HANDLE hHandle)
    457459{
    458460    if (hHandle >= MAX_OS2_HMHANDLES)        /* check the table range */
     
    533535 *****************************************************************************/
    534536
    535 DWORD   HMDeviceRegisterEx(LPSTR           pszDeviceName,
     537DWORD   HMDeviceRegisterEx(LPCSTR          pszDeviceName,
    536538                           HMDeviceHandler *pDeviceHandler,
    537539                           VOID            *pDevData)
     
    564566}
    565567
    566 DWORD   HMDeviceRegister(LPSTR           pszDeviceName,
     568DWORD   HMDeviceRegister(LPCSTR          pszDeviceName,
    567569                         HMDeviceHandler *pDeviceHandler)
    568570{
     
    21332135 *           GetFileSizeEx   (KERNEL32.@)
    21342136 */
    2135 #define INVALID_FILE_SIZE        ((DWORD)~0UL)
    21362137BOOL WINAPI GetFileSizeEx( HANDLE hFile, PLARGE_INTEGER lpFileSize )
    21372138{
     
    36243625}
    36253626
     3627} // extern "C"
     3628
  • trunk/src/kernel32/_ras.cpp

    r21342 r21916  
    77#include <_ras.h>
    88#include <umalloc.h>
     9#include <process.h>
    910
    1011#include <custombuild.h>
    1112#include <odincrt.h>
     13#ifdef __GNUC__
     14#include <float.h>
     15#else
    1216#include <libc/float.h>
     17#endif
    1318
    1419#include "initterm.h"
     
    1823
    1924/* RAS functions to isolate all RAS related services:
    20  * 
     25 *
    2126 * - Common statistic functions to track objects allocations/deallocations.
    2227 *
     
    2934 * Note: RAS subsystem does not use any other Odin subsystem, and IMO must not.
    3035 *       That is RAS has its own heap, serialization, logging.
    31  *       External stuff that is used: 
     36 *       External stuff that is used:
    3237 *           - from Odin: asm helpers from interlock.asm
    3338 *           - from libc: uheap functions
    34  *       
     39 *
    3540 *       The following has been borrowed from other Odin parts and adapted:
    3641 *           - critical section
     
    4853typedef struct _RAS_TRACK RAS_TRACK;
    4954
    50 typedef struct _RAS_OBJECT_INFO 
     55typedef struct _RAS_OBJECT_INFO
    5156{
    5257    struct _RAS_OBJECT_INFO *next;
    5358    struct _RAS_OBJECT_INFO *prev;
    54    
     59
    5560    RAS_TRACK_HANDLE h;
    56    
     61
    5762    ULONG objident;
    5863    ULONG usecount;
    59    
     64
    6065    ULONG objhandle;
    61    
     66
    6267    void *objdata;
    6368    ULONG cbobjdata;
    64    
     69
    6570    char userdata[1];
    6671} RAS_OBJECT_INFO;
     
    7378    RAS_OBJECT_INFO *objfirst;
    7479    RAS_OBJECT_INFO *objlast;
    75    
     80
    7681    char objname[80];
    77    
     82
    7883    ULONG cbuserdata;
    79    
     84
    8085    ULONG fLogObjectContent: 1;
    8186    ULONG fMemory: 1;
    8287    ULONG fLogAtExit: 1;
    8388    ULONG fLogObjectsAtExit: 1;
    84    
     89
    8590    FNLOC *pfnLogObjectContent;
    8691    FNCOC *pfnCompareObjectContent;
    87    
     92
    8893    /* Used when fMemory = 1 for RasTrackAlloc, Realloc and Free calls */
    8994    ULONG cAllocs;
    9095    ULONG cFrees;
    9196    ULONG cbTotalAllocated;
    92    
     97
    9398};
    9499
     
    119124
    120125    ULONG hlogfile;         // filehandle if default logging functions are used
    121    
     126
    122127    HMODULE hmod;
    123128} RasLogChannel;
     
    126131{
    127132    HMODULE hmod;           // handle of this dll
    128    
     133
    129134    RasLogChannel rlc;
    130    
     135
    131136    Heap_t rasheap;
    132137    void *pHeapMem;
    133138    ULONG ulRefCount;
    134139    ULONG flAllocMem;
    135    
     140
    136141    HMODULE hmodPlugin;
    137    
     142
    138143    RasEntryTable ret;
    139144    RasPluginEntryTable pet;
     
    163168} RASCONTEXT_I;
    164169
     170extern "C" {
     171
    165172void rasSaveContext(RASCONTEXT_I *pcontext)
    166173{
     
    181188
    182189    DosGetInfoBlocks(&ptib, &ppib);
    183    
     190
    184191    return ppib->pib_ulpid << 16 | ptib->tib_ptib2->tib2_ultid;
    185192}
     
    188195{
    189196    int rc = NO_ERROR;
    190    
     197
    191198    rc = DosCreateEventSem (NULL, &crit->hevLock, DC_SEM_SHARED, 0);
    192        
     199
    193200    if (rc != NO_ERROR)
    194201    {
    195202        crit->hevLock = 0;
    196203    }
    197    
     204
    198205    return rc;
    199206}
     
    207214{
    208215    APIRET rc = NO_ERROR;
    209            
     216
    210217    ULONG threadid = rasGetCurrentThreadId ();
    211            
     218
    212219    // We want to acquire the section, count the entering
    213220    DosInterlockedIncrement (&crit->LockCount);
    214    
     221
    215222    if (crit->OwningThread == threadid)
    216223    {
     
    228235            break;
    229236        }
    230        
     237
    231238        rc = DosWaitEventSem (crit->hevLock, ulTimeout);
    232        
    233         if (rc != NO_ERROR) 
     239
     240        if (rc != NO_ERROR)
    234241        {
    235242            // We fail, deregister itself
     
    238245        }
    239246    }
    240    
     247
    241248    // the section was successfully aquired
    242249    crit->RecursionCount = 1;
    243    
     250
    244251    return NO_ERROR;
    245252}
     
    256263    {
    257264        DosInterlockedDecrement (&crit->LockCount);
    258        
     265
    259266        return NO_ERROR;
    260267    }
    261    
     268
    262269    crit->OwningThread = 0;
    263270
     
    270277        DosResetEventSem (crit->hevLock, &ulnrposts);
    271278    }
    272    
     279
    273280    return NO_ERROR;
    274281}
     
    287294void ulong2string (unsigned long number, char *string, int n, int base)
    288295{
    289     static char *digits = "0123456789ABCDEF";
    290    
     296    static const char *digits = "0123456789ABCDEF";
     297
    291298    unsigned long tmp = number;
    292299    char *s = string;
     
    294301    int l = 0;
    295302    int i;
    296    
     303
    297304    if (n <= 0)
    298305    {
    299306        return;
    300307    }
    301    
     308
    302309    if (tmp == 0)
    303310    {
    304311        s[l++] = digits[0];
    305312    }
    306    
     313
    307314    while (tmp != 0)
    308315    {
     
    319326        s[l++] = '\0';
    320327    }
    321    
     328
    322329    s = string;
    323    
     330
    324331    for (i = 0; i < len/2; i++)
    325332    {
     
    338345        return;
    339346    }
    340    
     347
    341348    if (number < 0)
    342349    {
     
    345352        n--;
    346353    }
    347    
     354
    348355    ulong2string (number, string, n, base);
    349356}
    350  
     357
    351358int string2ulong (const char *string, char **pstring2, unsigned long *pvalue, int base)
    352359{
    353360    unsigned long value = 0;
    354361    int sign = 1;
    355    
     362
    356363    const char *p = string;
    357    
     364
    358365    if (p[0] == '-')
    359366    {
     
    361368        p++;
    362369    }
    363    
     370
    364371    if (base == 0)
    365372    {
     
    379386        }
    380387    }
    381            
     388
    382389    while (*p)
    383390    {
    384391        int digit = 0;
    385        
     392
    386393        if ('0' <= *p && *p <= '9')
    387394        {
     
    400407            break;
    401408        }
    402        
     409
    403410        if (digit >= base)
    404411        {
    405412            break;
    406413        }
    407        
     414
    408415        value = value*base + digit;
    409        
     416
    410417        p++;
    411418    }
    412    
     419
    413420    if (pstring2)
    414421    {
    415422        *pstring2 = (char *)p;
    416423    }
    417    
     424
    418425    *pvalue = sign*value;
    419    
     426
    420427    return 1;
    421428}
     429
     430#ifndef __GNUC__
    422431
    423432int vsnprintf (char *buf, int n, const char *fmt, va_list args)
     
    426435    char *s = (char *)fmt;
    427436    char *d = buf;
    428    
     437
    429438    if (n <= 0)
    430439    {
    431440        return 0;
    432441    }
    433    
     442
    434443    n--;
    435    
     444
    436445    while (*s && count < n)
    437446    {
    438447        char tmpstr[16];
    439      
     448
    440449        char *str = NULL;
    441        
     450
    442451        int width = 0;
    443452        int precision = 0;
    444            
     453
    445454        if (*s == '%')
    446455        {
    447456            s++;
    448            
     457
    449458            if ('0' <= *s && *s <= '9' || *s == '-')
    450459            {
     
    462471                string2ulong (s, &s, (unsigned long *)&precision, 10);
    463472            }
    464            
     473
    465474            if (*s == 's')
    466475            {
     
    480489            {
    481490                int num = va_arg(args, int);
    482            
     491
    483492                ulong2string (num, tmpstr, sizeof (tmpstr), 16);
    484                
     493
    485494                str = &tmpstr[0];
    486495                s++;
     
    494503                    s++;
    495504                }
    496                
     505
    497506                if (*s == 'd' || *s == 'i')
    498507                {
    499508                    int num = va_arg(args, int);
    500                
     509
    501510                    long2string (num, tmpstr, sizeof (tmpstr), 10);
    502                
     511
    503512                    str = &tmpstr[0];
    504513                    s++;
     
    507516                {
    508517                    int num = va_arg(args, int);
    509                
     518
    510519                    ulong2string (num, tmpstr, sizeof (tmpstr), 10);
    511                
     520
    512521                    str = &tmpstr[0];
    513522                    s++;
     
    516525                {
    517526                    int num = va_arg(args, int);
    518                
     527
    519528                    ulong2string (num, tmpstr, sizeof (tmpstr), 16);
    520                
     529
    521530                    str = &tmpstr[0];
    522531                    s++;
     
    524533            }
    525534        }
    526        
     535
    527536        if (str != NULL)
    528537        {
     
    531540            int len = strlen (str);
    532541            int leftalign = 0;
    533            
     542
    534543            if (width < 0)
    535544            {
     
    537546                leftalign = 1;
    538547            }
    539            
     548
    540549            if (precision)
    541550            {
     
    546555                    precision--;
    547556                }
    548                
     557
    549558                memcpy (&numstr[i], str, len);
    550                
     559
    551560                str = &numstr[0];
    552561                len += i;
    553562            }
    554            
     563
    555564            if (len < width && !leftalign)
    556565            {
     
    561570                    count++;
    562571                }
    563                
     572
    564573                if (count >= n)
    565574                {
     
    567576                }
    568577            }
    569            
     578
    570579            i = 0;
    571580            while (i < len && count < n)
     
    574583                count++;
    575584            }
    576                
     585
    577586            if (count >= n)
    578587            {
    579588                break;
    580589            }
    581            
     590
    582591            if (len < width && leftalign)
    583592            {
     
    588597                    count++;
    589598                }
    590                
     599
    591600                if (count >= n)
    592601                {
     
    601610        }
    602611    }
    603    
     612
    604613    *d = '\0';
    605    
     614
    606615    return count + 1;
    607616}
    608617
     618#endif // ifndef __GNUC__
     619
     620#ifdef __GNUC__
     621int WIN32API_VA ras_snprintf (char *buf, int n, const char *fmt, ...)
     622#else
    609623int WIN32API snprintf (char *buf, int n, const char *fmt, ...)
     624#endif
    610625{
    611626    va_list args;
    612    
     627
    613628    int rc = 0;
    614629
    615630    va_start (args, fmt);
    616    
     631
    617632    rc = vsnprintf (buf, n, fmt, args);
    618633
    619634    va_end (args);
    620    
     635
    621636    return rc;
    622637}
     
    625640{
    626641    ULONG ulAction = 0;
    627    
     642
    628643    int rc = DosOpen (logfilename, ph, &ulAction, 0L, FILE_ARCHIVED,
    629644                      OPEN_ACTION_CREATE_IF_NEW | OPEN_ACTION_REPLACE_IF_EXISTS,
    630645                      OPEN_FLAGS_NOINHERIT | OPEN_SHARE_DENYNONE |
    631646                      OPEN_ACCESS_READWRITE, 0L);
    632                          
     647
    633648    if (rc == ERROR_TOO_MANY_OPEN_FILES)
    634649    {
    635650        LONG lReqCount = 10l;
    636651        ULONG ulCurMaxFH = 0ul;
    637          
     652
    638653        DosSetRelMaxFH (&lReqCount, &ulCurMaxFH);
    639            
     654
    640655        rc = DosOpen (logfilename, ph, &ulAction, 0L, FILE_ARCHIVED,
    641656                      OPEN_ACTION_CREATE_IF_NEW | OPEN_ACTION_REPLACE_IF_EXISTS,
     
    643658                      OPEN_ACCESS_READWRITE, 0L);
    644659    }
    645        
     660
    646661    if (rc != NO_ERROR)
    647662    {
    648663        *ph = -1;
    649664    }
    650    
     665
    651666    return rc;
    652667}
     
    660675{
    661676    ULONG ulActual = 0;
    662            
     677
    663678    DosWrite ((HFILE)h, msg, len, &ulActual);
    664679}
     
    671686        prlc->hlogfile = -1;
    672687    }
    673    
     688
    674689    if (prlc->hmod)
    675690    {
     
    677692        prlc->hmod            = NULLHANDLE;
    678693    }
    679    
     694
    680695    prlc->pfnWriteLog     = NULL;
    681696    prlc->pfnOpenLogFile  = NULL;
     
    687702{
    688703    int rc = NO_ERROR;
    689    
     704
    690705    const char *env = NULL;
    691        
     706
    692707    DosScanEnv (env_loghandler, &env);
    693    
     708
    694709    HMODULE hmod = NULLHANDLE;
    695        
     710
    696711    PFN popenlogfile = NULL;
    697712    PFN pcloselogfile = NULL;
    698713    PFN pwritelog = NULL;
    699          
     714
    700715    if (env)
    701716    {
    702717        rc = DosLoadModule (NULL, 0, env, &hmod);
    703            
     718
    704719        if (rc == NO_ERROR)
    705720        {
    706721            rc = DosQueryProcAddr (hmod, 0, "WIN32RAS_OPENLOGFILE", &popenlogfile);
    707722        }
    708            
     723
    709724        if (rc == NO_ERROR)
    710725        {
    711726            rc = DosQueryProcAddr (hmod, 0, "WIN32RAS_CLOSELOGFILE", &pcloselogfile);
    712727        }
    713            
     728
    714729        if (rc == NO_ERROR)
    715730        {
    716731            rc = DosQueryProcAddr (hmod, 0, "WIN32RAS_WRITELOG", &pwritelog);
    717732        }
    718            
     733
    719734        if (rc != NO_ERROR && hmod)
    720735        {
     
    723738        }
    724739    }
    725        
     740
    726741    if (rc == NO_ERROR && hmod && popenlogfile && pcloselogfile && pwritelog)
    727742    {
     
    739754        prlc->hlogfile        = -1;
    740755        prlc->hmod            = NULLHANDLE;
    741        
     756
    742757        rc = NO_ERROR;
    743758    }
    744        
     759
    745760    rc = prlc->pfnOpenLogFile (&prlc->hlogfile, filename);
    746    
     761
    747762    if (rc != NO_ERROR)
    748763    {
     
    750765        rasCloseLogChannel (prlc);
    751766    }
    752        
     767
    753768    return rc;
    754769}
     
    757772{
    758773    int rc = NO_ERROR;
    759    
     774
    760775    const char *filename = "win32ras.log";
    761    
     776
    762777    const char *env = NULL;
    763    
     778
    764779    DosScanEnv ("WIN32RAS_LOG_FILENAME", &env);
    765        
     780
    766781    if (env)
    767782    {
    768783        filename = env;
    769784    }
    770        
     785
    771786    char uniqueLogFileName[260];
    772        
     787
    773788    snprintf (uniqueLogFileName, sizeof(uniqueLogFileName),
    774               "%s.%d", filename, loadNr);
    775        
     789              "%s.%d", filename, getpid());
     790
    776791    if (rasdata.rlc.hlogfile == -1)
    777792    {
    778793        rc = rasOpenLogChannel ("WIN32RAS_LOGHANDLER", &rasdata.rlc, uniqueLogFileName);
    779794    }
    780    
     795
    781796    return rc;
    782797}
     
    787802}
    788803
    789 void rasLogInternalV (RAS_LOG_CHANNEL_H hchannel, char *fmt, va_list args)
     804void rasLogInternalV (RAS_LOG_CHANNEL_H hchannel, const char *fmt, va_list args)
    790805{
    791806    static char szOutMsg[4096];
    792807
    793808    ULONG ulHdrLen = snprintf (szOutMsg, sizeof (szOutMsg), "%s", "");
    794    
     809
    795810    ulHdrLen -= 1;
    796    
     811
    797812    ULONG ulMsgLen = vsnprintf (&szOutMsg[ulHdrLen], sizeof (szOutMsg) - ulHdrLen, fmt, args);
    798813
    799814    ulMsgLen -= 1;
    800    
     815
    801816    if (ulMsgLen > 0)
    802817    {
     
    810825            }
    811826        }
    812        
     827
    813828        RasLogChannel *prlc = hchannel? (RasLogChannel *)hchannel: &rasdata.rlc;
    814      
     829
    815830        prlc->pfnWriteLog (prlc->hlogfile, szOutMsg, ulMsgLen + ulHdrLen);
    816831    }
    817832}
    818833
    819 void rasLog (char *fmt, ...)
     834void rasLog (const char *fmt, ...)
    820835{
    821836    va_list args;
    822837
    823838    va_start (args, fmt);
    824    
     839
    825840    rasLogInternalV (NULL, fmt, args);
    826    
     841
    827842    va_end (args);
    828843}
    829844
    830 void rasLogInternal (char *fmt, ...)
     845void rasLogInternal (const char *fmt, ...)
    831846{
    832847    va_list args;
    833848
    834849    va_start (args, fmt);
    835    
     850
    836851    rasLogInternalV (NULL, fmt, args);
    837    
     852
    838853    va_end (args);
    839854}
    840855
    841 void WIN32API rasLogExternal (char *fmt, ...)
     856void WIN32API_VA rasLogExternal (const char *fmt, ...)
    842857{
    843858    va_list args;
     
    846861
    847862    va_start (args, fmt);
    848    
     863
    849864    rasLogInternalV (NULL, fmt, args);
    850    
     865
    851866    va_end (args);
    852    
     867
    853868    SetFS (sel);
    854869}
     
    876891
    877892    *clean = _BLOCK_CLEAN;
    878    
     893
    879894    rc = DosAllocSharedMem (&p, NULL, *size, rasdata.flAllocMem | OBJ_GETTABLE);
    880    
     895
    881896    if (rc != NO_ERROR)
    882897    {
    883898        rasLog ("RAS heap: getmore_fn: DosAllocSharedMem failed, rc = %d\n", rc);
    884899    }
    885    
     900
    886901    return p;
    887902}
     
    906921    {
    907922        rasdata.flAllocMem = PAG_READ | PAG_WRITE | PAG_COMMIT;
    908    
     923
    909924        if (rascfg.fUseHighMem)
    910925        {
    911926            ULONG ulSysinfo = 0;
    912        
     927
    913928            rc = DosQuerySysInfo (QSV_VIRTUALADDRESSLIMIT, QSV_VIRTUALADDRESSLIMIT, &ulSysinfo, sizeof (ulSysinfo));
    914    
     929
    915930            if (rc == NO_ERROR && ulSysinfo > 512)   // VirtualAddresslimit is in MB
    916931            {
    917932                rasdata.flAllocMem |= PAG_ANY;
    918            
     933
    919934                rasLog ("RAS heap initialization: will use high memory\n");
    920935            }
    921936        }
    922937
    923         rc = DosAllocSharedMem (&rasdata.pHeapMem, NULL, rascfg.ulInitHeapSize, 
     938        rc = DosAllocSharedMem (&rasdata.pHeapMem, NULL, rascfg.ulInitHeapSize,
    924939                                rasdata.flAllocMem | OBJ_GETTABLE);
    925940        if (rc != NO_ERROR)
     
    928943            return NO_ERROR;
    929944        }
    930        
    931         rasdata.rasheap = _ucreate (rasdata.pHeapMem, rascfg.ulInitHeapSize, 
     945
     946        rasdata.rasheap = _ucreate (rasdata.pHeapMem, rascfg.ulInitHeapSize,
    932947                                    _BLOCK_CLEAN, _HEAP_REGULAR | _HEAP_SHARED,
    933948                                    getmore_fn, release_fn);
     
    936951        {
    937952            rasLog ("RAS heap initialization: _ucreate failed\n");
    938            
     953
    939954            DosFreeMem (rasdata.pHeapMem);
    940955            rasdata.pHeapMem = NULL;
    941            
     956
    942957            return ERROR_NOT_ENOUGH_MEMORY;
    943958        }
     
    949964         */
    950965        rc = DosGetSharedMem (rasdata.pHeapMem, rasdata.flAllocMem);
    951        
     966
    952967        if (rc != NO_ERROR)
    953968        {
    954969            rasLog ("RAS heap initialization: DosGetSharedMem failed %d\n", rc);
    955            
     970
    956971            return rc;
    957972        }
     
    960975        {
    961976            rasLog ("RAS heap initialization: _uopen failed\n");
    962            
     977
    963978            DosFreeMem (rasdata.pHeapMem);
    964            
     979
    965980            return ERROR_NOT_ENOUGH_MEMORY;
    966981        }
    967982    }
    968    
     983
    969984    rasdata.ulRefCount++;
    970    
     985
    971986    return NO_ERROR;
    972987}
     
    980995       return 1;
    981996    }
    982    
    983     if (useflag == _USEDENTRY) 
     997
     998    if (useflag == _USEDENTRY)
    984999    {
    9851000        if (filename)
     
    10011016    {
    10021017        rasLog ("RAS heap uninitialization: privateRefCount = %d\n", privateRefCount);
    1003    
     1018
    10041019        return;
    10051020    }
     
    10171032
    10181033            _uclose (rasdata.rasheap);
    1019            
     1034
    10201035            _udestroy (rasdata.rasheap, _FORCE);
    10211036            rasdata.rasheap = NULL;
    10221037        }
    1023        
     1038
    10241039        if (rasdata.pHeapMem)
    10251040        {
     
    10281043        }
    10291044    }
    1030     else 
     1045    else
    10311046    {
    10321047        _uclose (rasdata.rasheap);
     
    10371052{
    10381053    void *p = _umalloc(rasdata.rasheap, size);
    1039    
     1054
    10401055    if (p)
    10411056    {
     
    10461061        rasLog ("RAS heap: allocation failed, %d bytes\n", size);
    10471062    }
    1048    
     1063
    10491064    return p;
    10501065}
     
    10601075{
    10611076    RAS_TRACK_HANDLE iter = rasdata.firsttrack;
    1062    
     1077
    10631078    while (iter)
    10641079    {
     
    10671082            break;
    10681083        }
    1069        
     1084
    10701085        iter = iter->next;
    10711086    }
    1072    
     1087
    10731088    return iter;
    10741089}
     
    10761091ULONG rasGenObjIdent (void)
    10771092{
    1078     static objident = 0;
    1079    
     1093    static ULONG objident = 0;
     1094
    10801095    objident++;
    1081    
     1096
    10821097    if (objident == 0)
    10831098    {
    10841099        objident++;
    10851100    }
    1086    
     1101
    10871102    return objident;
    10881103}
     
    11001115        h->objlast = h->objfirst = pinfo;
    11011116    }
    1102    
     1117
    11031118    return NO_ERROR;
    11041119}
    1105      
     1120
    11061121void rasRemoveObjectInfo (RAS_OBJECT_INFO *pinfo)
    11071122{
     
    11151130        pinfo->h->objlast = pinfo->prev;
    11161131    }
    1117    
     1132
    11181133    if (pinfo->prev)
    11191134    {
     
    11311146{
    11321147    pinfo->objhandle = objhandle;
    1133    
     1148
    11341149    pinfo->h = h;
    1135    
     1150
    11361151    pinfo->usecount = 1;
    1137    
     1152
    11381153    pinfo->objident = rasGenObjIdent ();
    11391154
     
    11461161        }
    11471162    }
    1148    
     1163
    11491164    pinfo->cbobjdata = cbobjdata;
    11501165}
     
    11521167struct _RAS_OBJECT_INFO *rasSearchObject2 (RAS_TRACK_HANDLE h, ULONG objident)
    11531168{
    1154     if (!h) 
     1169    if (!h)
    11551170    {
    11561171        return NULL;
     
    11581173
    11591174    RAS_OBJECT_INFO *iter = h->objfirst;
    1160    
     1175
    11611176    while (iter)
    11621177    {
     
    11671182        iter = iter->next;
    11681183    }
    1169    
     1184
    11701185    return iter;
    11711186}
     
    11811196struct _RAS_OBJECT_INFO *rasSearchObject (RAS_TRACK_HANDLE h, ULONG objhandle, RAS_OBJECT_INFO **ppinfo_next)
    11821197{
    1183     if (!h) 
     1198    if (!h)
    11841199    {
    11851200        return NULL;
     
    11871202
    11881203    RAS_OBJECT_INFO *iter = h->objfirst;
    1189    
     1204
    11901205    while (iter)
    11911206    {
     
    11941209            break;
    11951210        }
    1196        
     1211
    11971212        iter = iter->next;
    11981213    }
    1199    
     1214
    12001215    if (iter && ppinfo_next)
    12011216    {
    12021217        *ppinfo_next = iter->next;
    12031218    }
    1204    
     1219
    12051220    return iter;
    12061221}
     
    12141229{
    12151230    pinfo->usecount--;
    1216    
     1231
    12171232    return pinfo->usecount;
    12181233}
     
    12231238    char buf[128];
    12241239    char *p = &buf[0];
    1225    
     1240
    12261241    if (!objdata)
    12271242    {
    12281243        return NO_ERROR;
    12291244    }
    1230    
     1245
    12311246    for (i = 0; i < cbobjdata; i++)
    12321247    {
     
    12381253                 p = &buf[0];
    12391254             }
    1240              
     1255
    12411256             snprintf (p, sizeof(buf) - (p - &buf[0]), "%8.8x:", i / 16);
    12421257             p += strlen (p);
    12431258        }
    1244        
     1259
    12451260        snprintf (p, sizeof(buf) - (p - &buf[0]), " %2.2x", ((char *)objdata)[i]);
    12461261        p += strlen (p);
    12471262    }
    1248    
     1263
    12491264    pRasLog ("%s\n", buf);
    1250    
     1265
    12511266    return NO_ERROR;
    12521267}
     
    12581273        return 1;
    12591274    }
    1260    
     1275
    12611276    if (objdata1 == NULL || objdata2 == NULL)
    12621277    {
     
    12641279        return 1;
    12651280    }
    1266    
     1281
    12671282    return memcmp (objdata1, objdata2, cbobjdata1);
    12681283}
    12691284
    1270 ULONG rasCallLogObjectContent (RAS_TRACK_HANDLE h, RASCONTEXT_I *pctx, 
    1271                                ULONG objident, ULONG objhandle, 
     1285ULONG rasCallLogObjectContent (RAS_TRACK_HANDLE h, RASCONTEXT_I *pctx,
     1286                               ULONG objident, ULONG objhandle,
    12721287                               void *objdata, ULONG cbobjdata, FNRASLOG_EXTERNAL *rasLogExternal)
    12731288{
    12741289    rasRestoreContext (pctx);
    1275    
     1290
    12761291    ULONG rc = h->pfnLogObjectContent (objident, objhandle, objdata, cbobjdata, rasLogExternal);
    1277    
     1292
    12781293    rasSaveContext (pctx);
    1279    
     1294
    12801295    return rc;
    12811296}
    12821297
    1283 ULONG WIN32API rasCallCompareObjectContent (RAS_TRACK_HANDLE h, RASCONTEXT_I *pctx, 
     1298ULONG WIN32API rasCallCompareObjectContent (RAS_TRACK_HANDLE h, RASCONTEXT_I *pctx,
    12841299                                            ULONG objhandle, void *objdata1, ULONG cbobjdata1, void *objdata2, ULONG cbobjdata2)
    12851300{
    12861301    rasRestoreContext (pctx);
    1287    
     1302
    12881303    ULONG rc = h->pfnCompareObjectContent (objhandle, objdata1, cbobjdata1, objdata2, cbobjdata2);
    1289    
     1304
    12901305    rasSaveContext (pctx);
    1291    
     1306
    12921307    return rc;
    12931308}
     
    13011316{
    13021317   const char *env = NULL;
    1303    
     1318
    13041319   DosScanEnv (name, &env);
    1305        
     1320
    13061321   if (env)
    13071322   {
    13081323       ULONG ul = 0;
    13091324       char *e = NULL;
    1310        
     1325
    13111326       string2ulong (env, &e, &ul, 10);
    1312            
     1327
    13131328       if (e && *e == '\0')
    13141329       {
     
    13241339{
    13251340    int rc = NO_ERROR;
    1326    
     1341
    13271342    if (!rasdata.hmodPlugin)
    13281343    {
    13291344        rasdata.ret.cb = sizeof (RasEntryTable);
    1330                
     1345
    13311346        rasdata.ret.RasRegisterObjectTracking   = RasRegisterObjectTracking;
    13321347        rasdata.ret.RasDeregisterObjectTracking = RasDeregisterObjectTracking;
     
    13431358        rasdata.ret.RasLogNoEOL                 = RasLogNoEOL2;
    13441359        rasdata.ret.RasLogMsg                   = RasLogMsg2;
     1360#ifdef __GNUC__
     1361        rasdata.ret.snprintf                    = ras_snprintf;
     1362#else
    13451363        rasdata.ret.snprintf                    = snprintf;
     1364#endif
    13461365        rasdata.ret.RasSaveContext              = RasSaveContext;
    13471366        rasdata.ret.RasRestoreContext           = RasRestoreContext;
     
    13531372        rasdata.ret.RasTrackMemFree             = RasTrackMemFree;
    13541373        rasdata.ret.RasGetTrackHandle           = RasGetTrackHandle;
    1355        
     1374
    13561375        rasdata.pet.cb = sizeof (RasPluginEntryTable);
    1357          
     1376
    13581377        rasdata.pet.RasEntry                    = _RasEntry;
    13591378
    13601379        const char *env = NULL;
    1361        
     1380
    13621381        DosScanEnv ("WIN32RAS_PLUGIN", &env);
    1363          
     1382
    13641383        if (env)
    13651384        {
    13661385            HMODULE hmod = NULLHANDLE;
    13671386            FNPI *pfnPluginInit  = NULL;
    1368          
     1387
    13691388            rc = DosLoadModule (NULL, 0, env, &hmod);
    1370            
     1389
    13711390            if (rc == NO_ERROR)
    13721391            {
    13731392                rc = DosQueryProcAddr (hmod, 0, "WIN32RAS_PLUGIN_INIT", (PFN *)&pfnPluginInit);
    13741393            }
    1375            
     1394
    13761395            if (rc != NO_ERROR)
    13771396            {
    13781397                rasLogInternal ("Could not load RAS plugin %s rc = %d", env, rc);
    13791398            }
    1380            
     1399
    13811400            if (rc != NO_ERROR && hmod)
    13821401            {
     
    13861405            {
    13871406                rasdata.hmodPlugin = hmod;
    1388                
     1407
    13891408                pfnPluginInit (rasdata.hmod, &rasdata.ret, &rasdata.pet);
    13901409            }
    13911410        }
    13921411    }
    1393    
     1412
    13941413    return rc;
    13951414}
     
    13981417{
    13991418    int rc = NO_ERROR;
    1400    
     1419
    14011420    if (rasdata.hmodPlugin)
    14021421    {
    14031422        HMODULE hmod = rasdata.hmodPlugin;
    14041423        FNPE *pfnPluginExit  = NULL;
    1405        
     1424
    14061425        rc = DosQueryProcAddr (hmod, 0, "WIN32RAS_PLUGIN_EXIT", (PFN *)&pfnPluginExit);
    1407            
     1426
    14081427        if (rc == NO_ERROR)
    14091428        {
    14101429            pfnPluginExit (rasdata.hmod);
    14111430        }
    1412        
     1431
    14131432        DosFreeModule (hmod);
    14141433    }
    1415    
     1434
    14161435    return rc;
    14171436}
     
    14631482{
    14641483   int rc = NO_ERROR;
    1465    
     1484
    14661485   if (!rasInitialized)
    14671486   {
    14681487       rasInitialized = 1;
    1469        
     1488
    14701489       memset (&rascfg, 0, sizeof (rascfg));
    1471        
     1490
    14721491       rascfg.ulTimeout = 60000; // default 1 minute
    14731492       rasQueryEnvUlong ("WIN32RAS_TIMEOUT", &rascfg.ulTimeout, 1, 3600, 1000);
    1474        
     1493
    14751494       rascfg.ulInitHeapSize = 128*1024;
    14761495       rasQueryEnvUlong ("WIN32RAS_INITHEAPSIZE", &rascfg.ulInitHeapSize, 64, 16*1024, 1024);
    1477        
     1496
    14781497       ULONG ul = 0;
    14791498       rasQueryEnvUlong ("WIN32RAS_DUMPHEAPOBJECTS", &ul, 0, 1, 1);
    14801499       rascfg.fDumpHeapObjects = ul;
    1481        
     1500
    14821501       ul = 1;
    14831502       rasQueryEnvUlong ("WIN32RAS_USEHIGHMEM", &ul, 0, 1, 1);
    14841503       rascfg.fUseHighMem = ul;
    1485        
     1504
    14861505       ul = 0;
    14871506       rasQueryEnvUlong ("WIN32RAS_ENABLE", &ul, 0, 1, 1);
    14881507       rascfg.fRasEnable = ul;
    1489        
     1508
    14901509       ul = 0;
    14911510       rasQueryEnvUlong ("WIN32RAS_BREAKPOINT", &ul, 0, 1, 1);
    14921511       rascfg.fRasBreakPoint = ul;
    1493        
     1512
    14941513       memset (&rasdata, 0, sizeof (rasdata));
    14951514       rasdata.rlc.hlogfile = -1;
    14961515       rasdata.hmod = hmod;
    1497        
     1516
    14981517       rc = NO_ERROR;
    14991518   }
    1500    
     1519
    15011520   if (!rascfg.fRasEnable)
    15021521   {
     
    15101529
    15111530   rc = rasInitializeLog ();
    1512    
     1531
    15131532   if (rc == NO_ERROR)
    15141533   {
    15151534       rc = rasInitializeCriticalSection (&csras);
    15161535   }
    1517    
     1536
    15181537   if (rc == NO_ERROR)
    15191538   {
    15201539       rc = rasInitializeHeap ();
    15211540   }
    1522    
     1541
    15231542   if (rc == NO_ERROR)
    15241543   {
    15251544       rc = rasInitializePlugin ();
    15261545   }
    1527    
     1546
    15281547   return rc;
    15291548}
     
    15321551{
    15331552    ENTER_RAS(NO_HANDLE);
    1534    
     1553
    15351554    /* Deregister all objects */
    15361555    while (rasdata.firsttrack)
    15371556    {
    15381557        RAS_TRACK_HANDLE iter = rasdata.firsttrack;
    1539        
     1558
    15401559        if (iter->fLogAtExit)
    15411560        {
    15421561            RasLogObjects (iter, iter->fLogObjectsAtExit? RAS_FLAG_LOG_OBJECTS: 0);
    15431562        }
    1544        
     1563
    15451564        RasDeregisterObjectTracking (iter);
    1546        
     1565
    15471566        rasFree (iter);
    15481567    }
    1549    
     1568
    15501569    rasUninitializePlugin ();
    1551    
     1570
    15521571    rasUninitializeHeap ();
    1553    
     1572
    15541573    EXIT_RAS();
    1555    
     1574
    15561575    rasUninitializeCriticalSection (&csras);
    1557    
    1558     rasUninitializeLog (); 
     1576
     1577    rasUninitializeLog ();
    15591578}
    15601579
     
    15621581{
    15631582    ENTER_RAS_RET(NO_HANDLE, NULL);
    1564    
     1583
    15651584    RAS_TRACK_HANDLE iter = rasdata.firsttrack;
    1566    
     1585
    15671586    while (iter)
    15681587    {
     
    15711590            break;
    15721591        }
    1573        
     1592
    15741593        iter = iter->next;
    15751594    }
    1576    
     1595
    15771596    EXIT_RAS();
    1578    
     1597
    15791598    return iter;
    15801599}
    15811600
    1582 void WIN32API RasRegisterObjectTracking (RAS_TRACK_HANDLE *ph, char *objname,
     1601void WIN32API RasRegisterObjectTracking (RAS_TRACK_HANDLE *ph, const char *objname,
    15831602                                         ULONG cbuserdata,
    15841603                                         ULONG flags,
     
    15871606{
    15881607    ENTER_RAS(NO_HANDLE);
    1589    
     1608
    15901609    RAS_TRACK *prt = (RAS_TRACK *)rasAlloc (sizeof (RAS_TRACK));
    1591    
     1610
    15921611    if (prt)
    15931612    {
    15941613        strcpy (prt->objname, objname);
    1595        
     1614
    15961615        prt->cbuserdata = cbuserdata;
    1597    
     1616
    15981617        if (flags & RAS_TRACK_FLAG_LOGOBJECTCONTENT)
    15991618        {
    16001619            prt->fLogObjectContent = 1;
    16011620        }
    1602    
     1621
    16031622        if (flags & RAS_TRACK_FLAG_MEMORY)
    16041623        {
    16051624            prt->fMemory = 1;
    16061625        }
    1607        
     1626
    16081627        if (flags & RAS_TRACK_FLAG_LOG_AT_EXIT)
    16091628        {
    16101629            prt->fLogAtExit = 1;
    16111630        }
    1612    
     1631
    16131632        if (flags & RAS_TRACK_FLAG_LOG_OBJECTS_AT_EXIT)
    16141633        {
    16151634            prt->fLogObjectsAtExit = 1;
    16161635        }
    1617    
     1636
    16181637        if (pfnLogObjectContent)
    16191638        {
     
    16241643            prt->pfnLogObjectContent = rasLogObjectContent;
    16251644        }
    1626        
     1645
    16271646        if (pfnCompareObjectContent)
    16281647        {
     
    16331652            prt->pfnCompareObjectContent = pfnCompareObjectContent;
    16341653        }
    1635        
     1654
    16361655        /* Insert the new tracking record in the list */
    16371656        if (rasdata.firsttrack)
     
    16451664            rasdata.lasttrack = rasdata.firsttrack = prt;
    16461665        }
    1647        
     1666
    16481667        *ph = prt;
    16491668    }
     
    16571676
    16581677    h = rasVerifyTrackHandle (h);
    1659    
     1678
    16601679    if (h)
    16611680    {
     
    16641683        {
    16651684            RAS_OBJECT_INFO *iter = h->objfirst;
    1666            
     1685
    16671686            rasRemoveObjectInfo (iter);
    1668            
     1687
    16691688            rasFree (iter);
    16701689        }
    1671        
     1690
    16721691        /* Remove the track record */
    16731692        if (h->next)
     
    16801699            rasdata.lasttrack = h->prev;
    16811700        }
    1682    
     1701
    16831702        if (h->prev)
    16841703        {
     
    16911710        }
    16921711    }
    1693    
     1712
    16941713    EXIT_RAS ();
    16951714}
     
    17001719{
    17011720    ENTER_RAS_RET (h, 0);
    1702    
     1721
    17031722    struct _RAS_OBJECT_INFO *pinfo_next = NULL;
    1704    
     1723
    17051724    struct _RAS_OBJECT_INFO *pinfo = rasSearchObject (h, objhandle, &pinfo_next);
    1706    
     1725
    17071726//    rasLog ("Object added: handle = %8.8X\n", objhandle);
    1708    
     1727
    17091728    if (pinfo != NULL)
    17101729    {
     
    17151734         */
    17161735        rasIncUseCount (pinfo);
    1717        
     1736
    17181737        /* log this event */
    17191738        rasLog ("Dublicate object added: handle = %8.8X\n", objhandle);
     
    17221741            rasLogInternal ("Added object content:\n");
    17231742            rasCallLogObjectContent (h, &ctx, pinfo->objident, objhandle, objdata, cbobjdata, rasLogExternal);
    1724            
     1743
    17251744            rasLogInternal ("Existing object content:\n");
    17261745            rasCallLogObjectContent (h, &ctx, pinfo->objident, objhandle, pinfo->objdata, pinfo->cbobjdata, rasLogExternal);
    1727            
     1746
    17281747            if (rasCallCompareObjectContent (h, &ctx, objhandle, objdata, cbobjdata, pinfo->objdata, pinfo->cbobjdata) != 0)
    17291748            {
     
    17341753    else
    17351754    {
    1736         pinfo = (RAS_OBJECT_INFO *)rasAlloc (sizeof (RAS_OBJECT_INFO) - sizeof (RAS_OBJECT_INFO::userdata) 
    1737                                              + h->cbuserdata 
     1755        pinfo = (RAS_OBJECT_INFO *)rasAlloc (sizeof (RAS_OBJECT_INFO) - sizeof (RAS_OBJECT_INFO::userdata)
     1756                                             + h->cbuserdata
    17381757                                             + (objdata? cbobjdata: 0));
    17391758        if (pinfo)
    17401759        {
    17411760            rasInitObjectInfo (pinfo, h, objhandle, objdata, cbobjdata);
    1742    
     1761
    17431762            int rc = rasAddObjectInfo (pinfo, h, pinfo_next);
    1744            
     1763
    17451764            if (rc != NO_ERROR)
    17461765            {
    1747                 rasFree (pinfo); 
     1766                rasFree (pinfo);
    17481767                pinfo = NULL;
    17491768            }
     
    17521771
    17531772    EXIT_RAS ();
    1754    
     1773
    17551774    if (pinfo)
    17561775    {
    17571776        return pinfo->objident;
    17581777    }
    1759    
     1778
    17601779    return 0;
    17611780}
     
    17641783{
    17651784    ENTER_RAS (h);
    1766    
     1785
    17671786//    rasLog ("Object to remove: handle = %8.8X\n", objhandle);
    1768    
     1787
    17691788    struct _RAS_OBJECT_INFO *pinfo = rasSearchObject (h, objhandle, NULL);
    1770    
     1789
    17711790//    rasLog ("Objects pinfo = %8.8X\n", pinfo);
    1772    
     1791
    17731792    if (pinfo != NULL)
    17741793    {
     
    17761795        {
    17771796            rasRemoveObjectInfo (pinfo);
    1778            
     1797
    17791798            rasFree (pinfo);
    17801799        }
    17811800    }
    1782    
     1801
    17831802    EXIT_RAS ();
    17841803}
    1785              
     1804
    17861805
    17871806void WIN32API RasQueryObjectUserData (RAS_TRACK_HANDLE h, ULONG objident, void *pdata, ULONG cbdata, ULONG *pcbdataret)
    17881807{
    17891808    ENTER_RAS (h);
    1790    
     1809
    17911810    struct _RAS_OBJECT_INFO *pinfo = rasSearchObject2 (h, objident);
    1792    
     1811
    17931812    if (pinfo)
    17941813    {
     
    17971816            cbdata = pinfo->h->cbuserdata;
    17981817        }
    1799    
     1818
    18001819        memcpy (pdata, &pinfo->userdata, cbdata);
    18011820    }
     
    18041823        cbdata = 0;
    18051824    }
    1806    
     1825
    18071826    EXIT_RAS ();
    1808    
     1827
    18091828    if (pcbdataret)
    18101829    {
    18111830        *pcbdataret = cbdata;
    18121831    }
    1813    
     1832
    18141833    return;
    18151834}
     
    18181837{
    18191838    ENTER_RAS (h);
    1820    
     1839
    18211840    struct _RAS_OBJECT_INFO *pinfo = rasSearchObject2 (h, objident);
    1822    
     1841
    18231842    if (pinfo)
    18241843    {
     
    18271846            cbdata = pinfo->h->cbuserdata;
    18281847        }
    1829    
     1848
    18301849        memcpy (&pinfo->userdata, pdata, cbdata);
    18311850    }
     
    18341853        cbdata = 0;
    18351854    }
    1836    
     1855
    18371856    EXIT_RAS ();
    1838    
     1857
    18391858    if (pcbdataret)
    18401859    {
    18411860        *pcbdataret = cbdata;
    18421861    }
    1843    
     1862
    18441863    return;
    18451864}
    18461865
    18471866
    1848 void WIN32API RasLog (char *fmt, ...)
     1867void WIN32API_VA RasLog (const char *fmt, ...)
    18491868{
    18501869    ENTER_RAS (NO_HANDLE);
    1851    
     1870
    18521871    va_list args;
    18531872
    18541873    va_start (args, fmt);
    1855    
     1874
    18561875    rasLogInternalV (NULL, fmt, args);
    1857    
     1876
    18581877    va_end (args);
    1859    
     1878
    18601879    EXIT_RAS ();
    18611880}
    18621881
    1863 void WIN32API RasLogNoEOL (char *fmt, ...)
     1882void WIN32API_VA RasLogNoEOL (const char *fmt, ...)
    18641883{
    18651884    va_list args;
    1866    
     1885
    18671886    ENTER_RAS (NO_HANDLE);
    1868    
     1887
    18691888    va_start (args, fmt);
    1870    
     1889
    18711890    ULONG noeolstate = rasdata.fNoEOL;
    18721891
    18731892    rasdata.fNoEOL = 1;
    1874    
     1893
    18751894    rasLogInternalV (NULL, fmt, args);
    1876    
     1895
    18771896    rasdata.fNoEOL = noeolstate;
    1878    
     1897
    18791898    va_end (args);
    1880    
     1899
    18811900    EXIT_RAS ();
    18821901}
     
    18851904{
    18861905    ENTER_RAS (NO_HANDLE);
    1887    
     1906
    18881907    EXIT_RAS ();
    18891908}
    1890        
     1909
    18911910void WIN32API RasLogObjects (RAS_TRACK_HANDLE h, ULONG flags)
    18921911{
    18931912    ENTER_RAS (h);
    1894    
     1913
    18951914    rasLogInternal ("[%s] objects", h->objname);
    1896    
     1915
    18971916    if (h->fMemory)
    18981917    {
     
    19041923        }
    19051924    }
    1906    
     1925
    19071926    RAS_OBJECT_INFO *iter = h->objfirst;
    1908    
     1927
    19091928    int count = 0;
    19101929    ULONG cb = 0; // count total memory allocated if fMemory is set
    1911    
     1930
    19121931    while (iter)
    19131932    {
     
    19161935            cb += iter->cbobjdata;
    19171936        }
    1918        
     1937
    19191938        if (flags & RAS_FLAG_LOG_OBJECTS)
    19201939        {
     
    19261945            {
    19271946                rasLogInternal ("  handle = %8.8X\n", iter->objhandle);
    1928        
     1947
    19291948                if (h->fLogObjectContent)
    19301949                {
     
    19331952            }
    19341953        }
    1935        
     1954
    19361955        count++;
    1937        
     1956
    19381957        iter = iter->next;
    19391958    }
    1940    
     1959
    19411960    rasLogInternal ("%d [%s] objects", count, h->objname);
    1942    
     1961
    19431962    if (h->fMemory && count > 0)
    19441963    {
    19451964        rasLogInternal ("%d bytes allocated", cb);
    19461965    }
    1947    
     1966
    19481967    EXIT_RAS ();
    1949    
     1968
    19501969    return;
    19511970}
     
    19541973{
    19551974    ENTER_RAS (h);
    1956    
     1975
    19571976    RAS_OBJECT_INFO *iter = h->objfirst;
    1958    
     1977
    19591978    int count = 0;
    19601979    ULONG cb = 0; // count total memory allocated if fMemory is set
    1961    
     1980
    19621981    while (iter)
    19631982    {
     
    19661985            cb += iter->cbobjdata;
    19671986        }
    1968        
     1987
    19691988        count++;
    1970        
     1989
    19711990        iter = iter->next;
    19721991    }
    1973    
     1992
    19741993    if (h->fMemory)
    19751994    {
     
    19791998        }
    19801999    }
    1981    
     2000
    19822001    if (pcount)
    19832002    {
    19842003        *pcount = count;
    19852004    }
    1986    
     2005
    19872006    EXIT_RAS ();
    1988    
     2007
    19892008    return;
    19902009}
    19912010
    1992 void WIN32API RasLog2 (RAS_LOG_CHANNEL_H hchannel, char *fmt, ...)
     2011void WIN32API_VA RasLog2 (RAS_LOG_CHANNEL_H hchannel, char *fmt, ...)
    19932012{
    19942013    ENTER_RAS (NO_HANDLE);
    1995    
     2014
    19962015    va_list args;
    19972016
    19982017    va_start (args, fmt);
    1999    
     2018
    20002019    rasLogInternalV (hchannel, fmt, args);
    2001    
     2020
    20022021    va_end (args);
    2003    
     2022
    20042023    EXIT_RAS ();
    20052024}
    20062025
    2007 void WIN32API RasLogNoEOL2 (RAS_LOG_CHANNEL_H hchannel, char *fmt, ...)
     2026void WIN32API_VA RasLogNoEOL2 (RAS_LOG_CHANNEL_H hchannel, char *fmt, ...)
    20082027{
    20092028    va_list args;
    2010    
     2029
    20112030    ENTER_RAS (NO_HANDLE);
    2012    
     2031
    20132032    va_start (args, fmt);
    2014    
     2033
    20152034    ULONG noeolstate = rasdata.fNoEOL;
    20162035
    20172036    rasdata.fNoEOL = 1;
    2018    
     2037
    20192038    rasLogInternalV (hchannel, fmt, args);
    2020    
     2039
    20212040    rasdata.fNoEOL = noeolstate;
    2022    
     2041
    20232042    va_end (args);
    2024    
     2043
    20252044    EXIT_RAS ();
    20262045}
     
    20292048{
    20302049    ENTER_RAS (NO_HANDLE);
    2031    
     2050
    20322051    EXIT_RAS ();
    20332052}
     
    20472066{
    20482067    ENTER_RAS_RET (NO_HANDLE, ERROR_GEN_FAILURE);
    2049    
     2068
    20502069    int rc = NO_ERROR;
    2051    
     2070
    20522071    RasLogChannel *prlc = (RasLogChannel *)rasAlloc (sizeof (RasLogChannel));
    2053    
     2072
    20542073    if (!prlc)
    20552074    {
     
    20592078    {
    20602079        rc = rasOpenLogChannel (env_loghandler, prlc, filename);
    2061        
     2080
    20622081        if (rc != NO_ERROR)
    20632082        {
     
    20692088        }
    20702089    }
    2071    
     2090
    20722091    EXIT_RAS ();
    2073    
     2092
    20742093    return rc;
    20752094}
    2076        
     2095
    20772096void WIN32API RasWriteLogChannel (RAS_LOG_CHANNEL_H hchannel, const char *msg, ULONG length)
    20782097{
    20792098    ENTER_RAS (NO_HANDLE);
    2080    
     2099
    20812100    if (length > 0)
    20822101    {
    20832102        RasLogChannel *prlc = (RasLogChannel *)hchannel;
    2084      
     2103
    20852104        prlc->pfnWriteLog (prlc->hlogfile, (char *)msg, length);
    20862105    }
    2087    
     2106
    20882107    EXIT_RAS ();
    20892108}
    2090        
     2109
    20912110void WIN32API RasCloseLogChannel (RAS_LOG_CHANNEL_H hchannel)
    20922111{
    20932112    ENTER_RAS (NO_HANDLE);
    2094    
     2113
    20952114    RasLogChannel *prlc = (RasLogChannel *)hchannel;
    2096        
     2115
    20972116    rasCloseLogChannel (prlc);
    2098    
     2117
    20992118    rasFree (prlc);
    2100    
     2119
    21012120    EXIT_RAS ();
    21022121}
    2103        
     2122
    21042123
    21052124void WIN32API RasEntry (ULONG ulEvent, void *p, ULONG cb)
    21062125{
    21072126    ENTER_RAS (NO_HANDLE);
    2108    
     2127
    21092128    if (rasdata.pet.RasEntry)
    21102129    {
    21112130        rasdata.pet.RasEntry (ulEvent, p, cb);
    21122131    }
    2113    
     2132
    21142133    EXIT_RAS ();
    21152134}
     
    21402159{
    21412160    ENTER_RAS (h);
    2142    
     2161
    21432162    if (h->fMemory && size > 0)
    21442163    {
     
    21462165        h->cbTotalAllocated += size;
    21472166    }
    2148    
     2167
    21492168    EXIT_RAS ();
    21502169}
    2151              
     2170
    21522171void WIN32API RasTrackMemRealloc (RAS_TRACK_HANDLE h, ULONG oldsize, ULONG newsize)
    21532172{
    21542173    ENTER_RAS (h);
    2155    
     2174
    21562175    if (h->fMemory)
    21572176    {
     
    21622181        }
    21632182    }
    2164    
     2183
    21652184    EXIT_RAS ();
    21662185}
    2167              
     2186
    21682187void WIN32API RasTrackMemFree (RAS_TRACK_HANDLE h, ULONG size)
    21692188{
    21702189    ENTER_RAS (h);
    2171    
     2190
    21722191    if (h->fMemory && size > 0)
    21732192    {
     
    21752194        h->cbTotalAllocated -= size;
    21762195    }
    2177    
     2196
    21782197    EXIT_RAS ();
    21792198}
    2180              
     2199
     2200} // extern "C"
     2201
  • trunk/src/kernel32/asmutil.asm

    r21343 r21916  
    1111                NAME    except
    1212
    13 DATA32  segment dword use32 public 'DATA'
    14 DATA32  ends
    15 CONST32_RO      segment dword use32 public 'CONST'
    16 CONST32_RO      ends
    17 BSS32   segment dword use32 public 'BSS'
    18 BSS32   ends
    19 DGROUP  group BSS32, DATA32
    20         assume  cs:FLAT, ds:FLAT, ss:FLAT, es:FLAT
     13DATA32  segment dword use32 public 'DATA'
     14DATA32  ends
     15CONST32_RO      segment dword use32 public 'CONST'
     16CONST32_RO      ends
     17BSS32   segment dword use32 public 'BSS'
     18BSS32   ends
     19DGROUP  group BSS32, DATA32
     20        assume  cs:FLAT, ds:FLAT, ss:FLAT, es:FLAT
    2121
    2222extrn   Dos32TIB:abs
     
    2424CODE32          SEGMENT DWORD PUBLIC USE32 'CODE'
    2525
    26         PUBLIC getEAX
    27         PUBLIC getEBX
    28 getEAX  proc near
    29         ret
    30 getEAX  endp
    31 
    32 public  getEDX
    33 getEDX  proc    near
    34         mov     EAX, EDX
    35         ret
    36 endp
    37 
    38 getEBX proc near
     26        PUBLIC _getEAX
     27_getEAX proc near
     28        ret
     29_getEAX endp
     30
     31        PUBLIC  _getEDX
     32_getEDX proc    near
     33        mov     EAX, EDX
     34        ret
     35_getEDX endp
     36
     37        PUBLIC _getEBX
     38_getEBX proc near
    3939        mov  eax, ebx
    4040        ret
    41 getEBX endp
     41_getEBX endp
    4242
    4343        PUBLIC GetFS
     
    5252        mov     fs, eax
    5353        ret
    54 SetFS   endp
    55 
    56         PUBLIC getCS
    57 getCS   proc near
     54SetFS  endp
     55
     56        PUBLIC _getCS
     57_getCS  proc near
    5858        mov     eax, cs
    5959        ret
    60 getCS   endp
    61 
    62         PUBLIC getDS
    63 getDS   proc near
     60_getCS  endp
     61
     62        PUBLIC _getDS
     63_getDS  proc near
    6464        mov     eax, ds
    6565        ret
    66 getDS   endp
     66_getDS  endp
    6767
    6868        PUBLIC SetReturnFS
     
    7575SetReturnFS endp
    7676
    77         PUBLIC getSS
    78 getSS   proc near
     77        PUBLIC _getSS
     78_getSS  proc near
    7979        mov     ax, ss
    8080        ret
    81 getSS   endp
    82 
    83         PUBLIC getES
    84 getES   proc near
     81_getSS  endp
     82
     83        PUBLIC _getES
     84_getES  proc near
    8585        mov     eax, es
    8686        ret
    87 getES   endp
    88 
    89         PUBLIC getGS
    90 getGS   proc near
     87_getES  endp
     88
     89        PUBLIC _getGS
     90_getGS  proc near
    9191        mov     eax, gs
    9292        ret
    93 getGS   endp
    94 
    95         PUBLIC getESP
    96 getESP proc near
     93_getGS  endp
     94
     95        PUBLIC _getESP
     96_getESP proc near
    9797        mov     eax, esp
    9898        ret
    99 getESP endp
     99_getESP endp
    100100
    101101        PUBLIC RestoreOS2FS
     
    129129_Mul32x32to64 endp
    130130
    131         align 4h
    132 
    133         public _Sub64
    134 _Sub64  proc
     131        align 4h
     132
     133        public _Sub64
     134_Sub64  proc
    135135
    136136; 34    c = a - b;
     
    143143        mov     edi, [ebp+10h]  ;&c
    144144        mov     esi, [ebp+08h]  ;&a
    145         mov     eax,[esi]       ;a.low
    146         mov     edx,[esi+04h]   ;a.high
     145        mov     eax,[esi]       ;a.low
     146        mov     edx,[esi+04h]   ;a.high
    147147        mov     esi, [ebp+0ch]  ;&b
    148         sub     eax,[esi]       ;b.low
    149         sbb     edx,[esi+04h]   ;b.high
     148        sub     eax,[esi]       ;b.low
     149        sbb     edx,[esi+04h]   ;b.high
    150150
    151151        mov     [edi], eax      ;c.low
     
    156156        pop     esi
    157157        leave
    158         ret     
    159 _Sub64  endp
    160 
    161         align 4h
    162 
    163         public _Add64
    164 _Add64  proc
     158        ret
     159_Sub64  endp
     160
     161        align 4h
     162
     163        public _Add64
     164_Add64  proc
    165165
    166166; 25     c = a + b;
     
    173173        mov     edi, [ebp+10h]  ;&c
    174174        mov     esi, [ebp+08h]  ;&a
    175         mov     eax,[esi]       ;a.low
    176         mov     edx,[esi+04h]   ;a.high
     175        mov     eax,[esi]       ;a.low
     176        mov     edx,[esi+04h]   ;a.high
    177177        mov     esi, [ebp+0ch]  ;&b
    178         add     eax,[esi]       ;b.low
    179         adc     edx,[esi+04h]   ;b.high
     178        add     eax,[esi]       ;b.low
     179        adc     edx,[esi+04h]   ;b.high
    180180
    181181        mov     [edi], eax      ;c.low
     
    186186        pop     esi
    187187        leave
    188         ret     
    189 
    190 _Add64  endp
    191 
    192 
    193         align 4h
    194 
    195         public _set_bit
     188        ret
     189
     190_Add64  endp
     191
     192
     193        align 4h
     194
     195        public _set_bit
    196196;void CDECL set_bit(int bitnr, void *addr);
    197197_set_bit proc near
     
    207207_set_bit endp
    208208
    209         align 4h
    210 
    211         public _test_bit
     209        align 4h
     210
     211        public _test_bit
    212212;int CDECL test_bit(int bitnr, void *addr);
    213213_test_bit proc near
     
    225225_test_bit endp
    226226
    227         public _clear_bit
     227        public _clear_bit
    228228;void CDECL clear_bit(int bitnr, void *addr);
    229229_clear_bit proc near
  • trunk/src/kernel32/asmutil.h

    r9946 r21916  
    1414#endif
    1515
    16 ULONG  getEAX();
    17 ULONG  getEBX();
    18 ULONG  getESP();
    19 USHORT getSS();
    20 USHORT getDS();
    21 USHORT getCS();
    22 USHORT getSS();
    23 USHORT getES();
    24 USHORT getFS();
    25 USHORT getGS();
     16ULONG  CDECL getEAX();
     17ULONG  CDECL getEBX();
     18ULONG  CDECL getESP();
     19USHORT CDECL getSS();
     20USHORT CDECL getDS();
     21USHORT CDECL getCS();
     22USHORT CDECL getSS();
     23USHORT CDECL getES();
     24USHORT CDECL getFS();
     25USHORT CDECL getGS();
    2626
    2727void CDECL Mul32x32to64(PVOID result, DWORD op1, DWORD op2);
  • trunk/src/kernel32/async.cpp

    r7549 r21916  
    7474static GLOBALS Globals;
    7575
     76extern "C" {
    7677
    7778/*****************************************************************************
     
    108109}
    109110
     111} // extern "C"
     112
  • trunk/src/kernel32/atom.cpp

    r10251 r21916  
    2121#include <misc.h>
    2222
     23#ifdef __GNUC__
     24#include <alloca.h>
     25#endif
     26
    2327#define DBG_LOCALLOG    DBG_atom
    2428#include "dbglocal.h"
     
    2933#define LOOKUP_DELETE   2
    3034#define LOOKUP_NOCASE   0x80000000
     35
     36extern "C" {
    3137
    3238ATOM APIENTRY LookupAtom(HATOMTBL hAtomTbl, PSZ psz, ULONG actionMask);
     
    355361//******************************************************************************
    356362//******************************************************************************
     363
     364} // extern "C"
  • trunk/src/kernel32/char.cpp

    r7886 r21916  
    2626
    2727#include <misc.h>
    28 #include <wine\unicode.h>
     28#include <wine/unicode.h>
    2929
    3030
  • trunk/src/kernel32/codepage.c

    r21355 r21916  
    211211    if (table->info.def_char & 0xff00)
    212212    {
    213         cpinfo->DefaultChar[0] = table->info.def_char & 0xff00;
     213        cpinfo->DefaultChar[0] = (table->info.def_char & 0xff00) >> 8;
    214214        cpinfo->DefaultChar[1] = table->info.def_char & 0x00ff;
    215215    }
  • trunk/src/kernel32/conbuffer.cpp

    r21302 r21916  
    5353 * Includes                                                                  *
    5454 *****************************************************************************/
     55
     56// Vio/Kbd/Mou declarations conflict in GCC and in real OS2TK headers;
     57// force GCC declarations since we link against GCC libs
     58#if defined (__EMX__) && defined (USE_OS2_TOOLKIT_HEADERS)
     59#undef USE_OS2_TOOLKIT_HEADERS
     60#endif
    5561
    5662#define  INCL_WIN
  • trunk/src/kernel32/conbuffervio.cpp

    r10010 r21916  
    5353 * Includes                                                                  *
    5454 *****************************************************************************/
     55
     56// Vio/Kbd/Mou declarations conflict in GCC and in real OS2TK headers;
     57// force GCC declarations since we link against GCC libs
     58#if defined (__EMX__) && defined (USE_OS2_TOOLKIT_HEADERS)
     59#undef USE_OS2_TOOLKIT_HEADERS
     60#endif
    5561
    5662#define  INCL_WIN
  • trunk/src/kernel32/conbuffervio.h

    r10010 r21916  
    6363                                            LPDWORD       lpNumberOfAttrsWritten);
    6464
    65 DWORD HMDeviceConsoleVioBufferClass::FillConsoleOutputCharacterA(PHMHANDLEDATA pHMHandleData,
    66                                                               UCHAR   ucCharacter,
    67                                                               DWORD   nLength,
    68                                                               COORD   dwWriteCoord,
    69                                                               LPDWORD lpNumberOfCharsWritten);
     65  DWORD FillConsoleOutputCharacterA(PHMHANDLEDATA pHMHandleData,
     66                                    UCHAR   ucCharacter,
     67                                    DWORD   nLength,
     68                                    COORD   dwWriteCoord,
     69                                    LPDWORD lpNumberOfCharsWritten);
    7070
    7171};
  • trunk/src/kernel32/conodin32.cpp

    r8774 r21916  
    237237                    if (pNew)
    238238                    {
    239                         pNew->pfnHandler = pfnHandler;
     239                        pNew->pfnHandler = (void *)pfnHandler;
    240240                        pNew->pPrev = NULL;
    241241
  • trunk/src/kernel32/conprop.cpp

    r5308 r21916  
    7070  ULONG     ulID;                  // Resource ID for dialog page
    7171  PFNWP     wpDlgProc;             // dialog window procedure
    72   PSZ       szStatusLineText;      // Text to go on status line
    73   PSZ       szTabText;             // Text to go on major tab
     72  PCSZ      szStatusLineText;      // Text to go on status line
     73  PCSZ      szTabText;             // Text to go on major tab
    7474  ULONG     idFocus;               // ID of the control to get the focus first
    7575  BOOL      fParent;               // Is this a Parent page with minor pages
     
    9292/**********************************************************************/
    9393
    94 static VOID ErrorMsg( PSZ szFormat,
    95                      ... );
     94static VOID ErrorMsg(PCSZ szFormat,
     95                     ...);
    9696
    9797
     
    195195};
    196196
    197 static PSZ priorities[] = {"idle", "normal", "critical", "server"};
     197static PCSZ priorities[] = {"idle", "normal", "critical", "server"};
    198198#define NUMPRIORITIES 4
    199199
     
    216216#define MESSAGE_SIZE 1024
    217217
    218 static VOID ErrorMsg( PSZ szFormat,
    219                      ... )
     218static VOID ErrorMsg(PCSZ szFormat,
     219                     ...)
    220220{
    221221  PSZ     szMsg;
  • trunk/src/kernel32/conprop2.cpp

    r5308 r21916  
    268268                               szKey,
    269269                               0,
    270                                "",
     270                               NULL,
    271271                               0,
    272272                               KEY_ALL_ACCESS,
     
    281281#define REGSAVEVALUE(name,var) \
    282282  lRes = RegSetValueExA(hkConsole, name, 0, REG_DWORD, \
    283                  (LPBYTE)&pConsoleOptions->var, sizeof(pConsoleOptions->var));
     283                 (const BYTE *)&pConsoleOptions->var, sizeof(pConsoleOptions->var));
    284284
    285285  REGSAVEVALUE("AutomaticTermination",     fTerminateAutomatically)
  • trunk/src/kernel32/console.cpp

    r21426 r21916  
    5353*   Header Files                                                               *
    5454*******************************************************************************/
    55 #include <process.h>
    56 #include <stdlib.h>
    57 #include <string.h>
     55
     56// Vio/Kbd/Mou declarations conflict in GCC and in real OS2TK headers;
     57// force GCC declarations since we link against GCC libs
     58#if defined (__EMX__) && defined (USE_OS2_TOOLKIT_HEADERS)
     59#undef USE_OS2_TOOLKIT_HEADERS
     60#endif
    5861
    5962#define  INCL_WIN
     
    6972#define  INCL_AVIO
    7073#include <os2wrap.h>         //Odin32 OS/2 api wrappers
     74
     75#include <process.h>
     76#include <stdlib.h>
     77#include <string.h>
    7178
    7279#include <win32type.h>
     
    23082315}
    23092316
     2317extern "C" {
    23102318
    23112319/*****************************************************************************
     
    37723780  return fResult;
    37733781}
     3782
     3783} // extern "C"
  • trunk/src/kernel32/console2.h

    r6919 r21916  
    221221#define MAX_OS2_ROWS           255
    222222#define MAX_OS2_COLUMNS        255
    223 #define FORMAT_CGA             1
    224223#define CONSOLE_TIMER_ID       1
    225224#define CONSOLE_INPUTQUEUESIZE 256
    226225
     226#ifndef FORMAT_CGA
     227#define FORMAT_CGA             1
     228#endif
    227229
    228230#define CONSOLECURSOR_HIDE         1
  • trunk/src/kernel32/cpu.cpp

    r21343 r21916  
    2828
    2929static BYTE PF[64]          = {0,};
    30 static nrCPUs               = 1;
     30static int nrCPUs           = 1;
    3131static SYSTEM_INFO cachedsi = {0};
    3232
     
    5353 * Note that there is a hierarchy for every processor installed, so this
    5454 * supports multiprocessor systems. This is done like Win95 does it, I think.
    55  *                                                     
     55 *
    5656 * It also creates a cached flag array for IsProcessorFeaturePresent().
    5757 *
     
    104104        }
    105105
    106         if(SupportsCPUID()) 
     106        if(SupportsCPUID())
    107107        {
    108             for(int i=0;i<cachedsi.dwNumberOfProcessors;i++) 
     108            for(int i=0;i<cachedsi.dwNumberOfProcessors;i++)
    109109            {
    110110                // Create a new processor subkey
     
    153153
    154154                                        Sleep(32);      //sleep for about 32 ms
    155                                        
     155
    156156                                        GetTSC((LONG *)&tsc2.LowPart, &tsc2.HighPart);
    157157                                        QueryPerformanceCounter(&time2);
     
    167167                                        tmp1 = (double)tsc1.LowPart + (double)tsc1.HighPart*4.0*1024.0*1024.0;
    168168                                        clockticks = tmp - tmp1;
    169                                         if(millisec > 0) 
     169                                        if(millisec > 0)
    170170                                        {//make sure we have something valid here
    171171                                                tmp = 1000 / millisec;
     
    199199                if (features & CPUID_FPU_PRESENT) {
    200200                        if (i == 0) {
    201                                 if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"HARDWARE\\DESCRIPTION\\System\\FloatingPointProcessor",&fpukey)!=ERROR_SUCCESS) 
     201                                if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"HARDWARE\\DESCRIPTION\\System\\FloatingPointProcessor",&fpukey)!=ERROR_SUCCESS)
    202202                                        dprintf(("Unable to register FPU information\n"));
    203203                        }
     
    208208                        }
    209209                }
    210        
     210
    211211           } //for each cpu
    212212        }
  • trunk/src/kernel32/cpuhlp.asm

    r4407 r21916  
    1414        ASSUME  DS:FLAT,SS:FLAT
    1515
    16         PUBLIC  CPUFeatures
    17 CPUFeatures     dd 0
     16        PUBLIC  _CPUFeatures
     17_CPUFeatures    dd 0
    1818
    1919DATA32  ENDS
     
    8585        mov     eax, edx       
    8686
    87         mov     [CPUFeatures], eax
     87        mov     [_CPUFeatures], eax
    8888
    8989        pop     edx
  • trunk/src/kernel32/critsection.cpp

    r21302 r21916  
    22/*
    33 * Win32 critical sections
    4  * 
     4 *
    55 *
    66 *
     
    238238    return ret;
    239239}
     240
     241extern "C" {
    240242
    241243/***********************************************************************
     
    416418    }
    417419#endif
    418        
     420
    419421    if (--crit->RecursionCount)
    420422    {
     
    470472}
    471473
     474} // extern "C"
     475
  • trunk/src/kernel32/cvtresource.h

    r1454 r21916  
    77#include <winaccel.h>
    88#include <wincursor.h>
    9 #include <winimagebase.h>
     9#include "winimagebase.h"
    1010
    1111void *ConvertAccelerator(WINACCEL *accdata, int size, int cp = 0);
  • trunk/src/kernel32/dbglocal.cpp

    r21302 r21916  
    2020USHORT DbgEnabledLvl2KERNEL32[DBG_MAXFILES] = {0};
    2121
    22 static char *DbgFileNames[DBG_MAXFILES] =
     22static const char *DbgFileNames[DBG_MAXFILES] =
    2323{
    2424"kernel32",
  • trunk/src/kernel32/dbglog.cpp

    r21343 r21916  
    2626#include <string.h>
    2727#include <stdarg.h>
     28#include <process.h>
    2829#include <win32type.h>
    2930#include <win32api.h>
     
    9394/* arguments.                                                        */
    9495/* ----------------------------------------------------------------- */
    95 int SYSTEM WriteLog(char *f, ...)
     96int SYSTEM WriteLog(const char *f, ...)
    9697  {
    9798  TIB    *ptib;                    /* process/thread id structures */
     
    257258static BOOL fLogging = TRUE;
    258259static int  dwEnableLogging = 1;
     260#ifdef __IBMC__
    259261static int  oldcrtmsghandle = 0;
     262#endif
    260263
    261264static BOOL fDisableThread[5] = {0};
    262265static BOOL fFlushLines = TRUE;
    263266
    264 static char *pszLastLogEntry = NULL;
     267static const char *pszLastLogEntry = NULL;
    265268
    266269//#define CHECK_ODINHEAP
     
    305308}
    306309
    307 int SYSTEM WriteLog(char *tekst, ...)
     310int SYSTEM WriteLog(const char *tekst, ...)
    308311{
    309312  USHORT  sel = RestoreOS2FS();
     
    330333#ifdef WIN32_IP_LOGGING
    331334        char *logserver = getenv("WIN32LOG_IPSERVER");
    332         if(logserver && loadNr == 0) {
     335        if(logserver) {
    333336             sock_init();
    334337
     
    346349            pszLogBase = "odin32_";
    347350
    348         sprintf(szLogFile, "%s%d.log", pszLogBase, loadNr);
     351        sprintf(szLogFile, "%s%d.log", pszLogBase, getpid());
    349352        flog = fopen(szLogFile, "w");
    350         if(flog == NULL) 
     353        if(flog == NULL)
    351354        {//probably running exe on readonly device
    352             sprintf(szLogFile, "%sodin32_%d.log", kernel32Path, loadNr);
     355            sprintf(szLogFile, "%sodin32_%d.log", kernel32Path, getpid());
    353356            flog = fopen(szLogFile, "w");
    354357        }
     358#ifdef __IBMC__
    355359        oldcrtmsghandle = _set_crt_msg_handle(fileno(flog));
     360#endif
    356361    }
    357362    else
     
    385390    if(logSocket == -1) {
    386391#endif
    387     if(teb) 
     392    if(teb)
    388393    {
    389394      ULONG ulCallDepth;
     
    393398      ulCallDepth = 0;
    394399#endif
    395      
     400
    396401      teb->o.odin.logfile = (DWORD)flog;
    397      
     402
    398403#ifdef LOG_TIME
    399404      if(sel == 0x150b && fSwitchTIBSel)
    400         fprintf(flog, 
     405        fprintf(flog,
    401406                "t%02d (%3d): (%x) (FS=150B) ",
    402407                LOWORD(teb->o.odin.threadId),
    403408                ulCallDepth,
    404409                GetTickCount());
    405       else 
    406         fprintf(flog, 
     410      else
     411        fprintf(flog,
    407412                "t%02d (%3d): (%x) ",
    408413                LOWORD(teb->o.odin.threadId),
     
    410415                GetTickCount());
    411416#else
    412       if(sel == 0x150b && fSwitchTIBSel) 
    413         fprintf(flog, 
     417      if(sel == 0x150b && fSwitchTIBSel)
     418        fprintf(flog,
    414419#ifdef SHOW_FPU_CONTROLREG
    415420                "t%02d (%3d)(%3x): ",
     
    422427                ulCallDepth);
    423428#endif
    424       else 
    425         fprintf(flog, 
     429      else
     430        fprintf(flog,
    426431#ifdef SHOW_FPU_CONTROLREG
    427432                "t%02d (%3d)(%3x): ",
     
    450455        int  prefixlen = 0;
    451456
    452         if(teb) 
     457        if(teb)
    453458        {
    454459            ULONG ulCallDepth;
     
    459464#endif
    460465#ifdef LOG_TIME
    461             if(sel == 0x150b && fSwitchTIBSel) 
     466            if(sel == 0x150b && fSwitchTIBSel)
    462467                sprintf(logbuffer, "t%02d (%3d): %x (FS=150B) ",
    463468                        LOWORD(teb->o.odin.threadId), ulCallDepth, GetTickCount());
    464             else 
     469            else
    465470                sprintf(logbuffer, "t%02d (%3d): %x ",
    466471                        LOWORD(teb->o.odin.threadId), ulCallDepth, GetTickCount());
    467472#else
    468             if(sel == 0x150b && fSwitchTIBSel) 
     473            if(sel == 0x150b && fSwitchTIBSel)
    469474                sprintf(logbuffer, "t%02d (%3d): (FS=150B) ",
    470475                        LOWORD(teb->o.odin.threadId), ulCallDepth);
    471             else 
     476            else
    472477                sprintf(logbuffer, "t%02d (%3d): ",
    473478                        LOWORD(teb->o.odin.threadId), ulCallDepth);
     
    497502        if(tekst[strlen(tekst)-1] != '\n')
    498503            fprintf(flog, "\n");
    499 #if 0       
     504#if 0
    500505if (teb && LOWORD(teb->o.odin.threadId) > 1)
    501506{
     
    514519            break;
    515520        }
    516        
     521
    517522        if ((ULONG)pframe < getESP())
    518523        {
     
    554559//******************************************************************************
    555560//******************************************************************************
    556 int SYSTEM WriteLogNoEOL(char *tekst, ...)
     561int SYSTEM WriteLogNoEOL(const char *tekst, ...)
    557562{
    558563  USHORT  sel = RestoreOS2FS();
     
    572577        char logname[CCHMAXPATH];
    573578
    574         sprintf(logname, "odin32_%d.log", loadNr);
     579        sprintf(logname, "odin32_%d.log", getpid());
    575580        flog = fopen(logname, "w");
    576581        if(flog == NULL) {//probably running exe on readonly device
    577             sprintf(logname, "%sodin32_%d.log", kernel32Path, loadNr);
     582            sprintf(logname, "%sodin32_%d.log", kernel32Path, getpid());
    578583            flog = fopen(logname, "w");
    579584        }
     
    612617//******************************************************************************
    613618//******************************************************************************
    614 int SYSTEM WritePrivateLog(void *logfile, char *tekst, ...)
     619int SYSTEM WritePrivateLog(void *logfile, const char *tekst, ...)
    615620{
    616621  USHORT  sel = RestoreOS2FS();
     
    717722void CloseLogFile()
    718723{
     724#ifdef __IBMC__
    719725  if(oldcrtmsghandle)
    720726    _set_crt_msg_handle(oldcrtmsghandle);
     727#endif
    721728
    722729#ifdef WIN32_IP_LOGGING
     
    789796              "int 3"
    790797#endif
     798extern "C"
    791799void WIN32API DebugBreak()
    792800{
  • trunk/src/kernel32/dbgwrap.cpp

    r21567 r21916  
    1313
    1414#define DBG_LOCALLOG    DBG_trace
    15 #include <dbglocal.h>
     15#include "dbglocal.h"
    1616
    1717#define DBGWRAP_MODULE "KERNEL32"
    1818#include <dbgwrap.h>
    1919
     20extern "C" {
    2021
    2122BOOL WINAPI TryEnterCriticalSection( CRITICAL_SECTION *crit );
     
    950951DEBUGWRAP_LVL2_12(OemToCharBuffW)
    951952DEBUGWRAP_LVL2_8(OemToCharW)
     953
     954} // extern "C"
  • trunk/src/kernel32/directory.cpp

    r21302 r21916  
    66 * Copyright 1998 Sander van Leeuwen
    77 *
    8  * NOTE: Directory creation has to be done in install program (odin\win) 
     8 * NOTE: Directory creation has to be done in install program (odin\win)
    99 *
    1010 * Parts based on Wine code (991031) (files\directory.c)
     
    1414 * Copyright 1995 Alexandre Julliard
    1515 *
    16  * TODO: 
     16 * TODO:
    1717 *  - System/window directories should be created by install program!
    1818 *
     
    3030#include <os2win.h>
    3131#include <stdlib.h>
     32#include <string.h>
     33#ifdef __GNUC__
     34#include <alloca.h>
     35#endif
    3236#include <unicode.h>
    3337#include <heapstring.h>
    3438#include <options.h>
    3539#include "initterm.h"
    36 #include <win\file.h>
    37 #include <string.h>
     40#include <win/file.h>
    3841#include "oslibdos.h"
    3942#include "profile.h"
     
    8083   len = strlen(DIR_System);
    8184   if(DIR_System[len-1] == '\\') {
    82         DIR_System[len-1] = 0; 
     85        DIR_System[len-1] = 0;
    8386   }
    8487   len = PROFILE_GetOdinIniString(ODINDIRECTORIES,"WINDOWS","",DIR_Windows,sizeof(DIR_Windows));
    8588   if (len > 2) {
    8689        if(DIR_Windows[len-1] == '\\') {
    87                 DIR_Windows[len-1] = 0; 
     90                DIR_Windows[len-1] = 0;
    8891        }
    8992   }
     
    116119   len = strlen(DIR_System);
    117120   if(DIR_System[len-1] == '\\') {
    118         DIR_System[len-1] = 0; 
     121        DIR_System[len-1] = 0;
    119122   }
    120123   strcpy(DIR_Windows, szWindowsDir);
    121124   len = strlen(DIR_Windows);
    122125   if(DIR_Windows[len-1] == '\\') {
    123         DIR_Windows[len-1] = 0; 
     126        DIR_Windows[len-1] = 0;
    124127   }
    125128
     
    146149  rc = OSLibDosQueryDir(nBufferLength, lpBuffer);
    147150  if(rc && rc < nBufferLength) {
    148        dprintf(("CurrentDirectory = %s (%d)", lpBuffer, rc)); 
    149   }
    150   else dprintf(("CurrentDirectory returned %d", rc)); 
     151       dprintf(("CurrentDirectory = %s (%d)", lpBuffer, rc));
     152  }
     153  else dprintf(("CurrentDirectory returned %d", rc));
    151154  return rc;
    152155}
     
    196199    return FALSE;
    197200  }
    198  
     201
    199202  // cut off trailing backslashes
    200203  // not if a process wants to change to the root directory
     
    204207       (len != 1) )
    205208  {
    206     LPSTR lpTemp = (LPSTR)_alloca(len);
     209    LPSTR lpTemp = (LPSTR)alloca(len);
    207210    lstrcpynA(lpTemp,
    208211              lpstrDirectory,
     
    264267
    265268  int len = strlen(lpstrDirectory);
    266  
     269
    267270  // cut off trailing backslashes
    268271  if ( (lpstrDirectory[len - 1] == '\\') ||
    269272       (lpstrDirectory[len - 1] == '/') )
    270273  {
    271     LPSTR lpTemp = (LPSTR)_alloca(len);
     274    LPSTR lpTemp = (LPSTR)alloca(len);
    272275    lstrcpynA(lpTemp,
    273276              lpstrDirectory,
     
    275278    lpstrDirectory = lpTemp;
    276279  }
    277  
     280
    278281  dprintf(("CreateDirectoryA %s", lpstrDirectory));
    279  
     282
    280283  // Creation of an existing directory will fail (verified in NT4 & XP)
    281284  DWORD dwAttr = GetFileAttributesA(lpstrDirectory);
    282   if(dwAttr != -1) 
     285  if(dwAttr != -1)
    283286  {
    284287      if (dwAttr & FILE_ATTRIBUTE_DIRECTORY)
     
    287290          return FALSE;
    288291      }
    289   } 
     292  }
    290293  return(OSLibDosCreateDirectory(lpstrDirectory));
    291294}
     
    437440    asciibuffer = (char *)alloca(uSize+1);
    438441
    439   if(lpBuffer && asciibuffer == NULL) 
     442  if(lpBuffer && asciibuffer == NULL)
    440443  {
    441444    DebugInt3();
     
    445448  if(rc && asciibuffer)
    446449    AsciiToUnicode(asciibuffer, lpBuffer);
    447  
     450
    448451  return(rc);
    449452}
     
    495498    asciibuffer = (char *)alloca(uSize+1);
    496499
    497   if(lpBuffer && asciibuffer == NULL) 
     500  if(lpBuffer && asciibuffer == NULL)
    498501  {
    499502    DebugInt3();
     
    503506  if(rc && asciibuffer)
    504507    AsciiToUnicode(asciibuffer, lpBuffer);
    505  
     508
    506509  return(rc);
    507510}
     
    524527{
    525528  int len = strlen(lpstrDirectory);
    526  
     529
    527530  if(lpstrDirectory == NULL) {
    528531     SetLastError(ERROR_INVALID_PARAMETER);
     
    533536       (lpstrDirectory[len - 1] == '/') )
    534537  {
    535     LPSTR lpTemp = (LPSTR)_alloca(len);
     538    LPSTR lpTemp = (LPSTR)alloca(len);
    536539    lstrcpynA(lpTemp,
    537540              lpstrDirectory,
     
    539542    lpstrDirectory = lpTemp;
    540543  }
    541  
     544
    542545  dprintf(("RemoveDirectory %s", lpstrDirectory));
    543546
     
    619622       those (according to SDK docs) */
    620623    if ((path != NULL) && strchr(path, ';')) {
    621         ret = OSLibDosSearchPath(OSLIB_SEARCHDIR, (LPSTR)path, (LPSTR)name, 
     624        ret = OSLibDosSearchPath(OSLIB_SEARCHDIR, (LPSTR)path, (LPSTR)name,
    622625                                 full_name, MAX_PATHNAME_LEN);
    623626        goto done;
     
    647650        name = tmp;
    648651    }
    649    
     652
    650653    /* If we have an explicit path, everything's easy */
    651654
     
    704707 *             filename is returned.
    705708 *    Failure: Zero
    706  * 
     709 *
    707710 * NOTES
    708711 *    Should call SetLastError(but currently doesn't).
     
    732735    LPSTR nameA = HEAP_strdupWtoA( GetProcessHeap(), 0, name );
    733736    LPSTR extA  = HEAP_strdupWtoA( GetProcessHeap(), 0, ext );
    734  
     737
    735738    dprintf(("SearchPathA %s %s %s", pathA, nameA, extA));
    736739    DWORD ret = DIR_SearchPath( pathA, nameA, extA, (LPSTR)full_name );
    737  
     740
    738741    if (NULL != extA)
    739742      HeapFree( GetProcessHeap(), 0, extA );
    740  
     743
    741744    if (NULL != nameA)
    742745      HeapFree( GetProcessHeap(), 0, nameA );
    743  
     746
    744747    if (NULL != pathA)
    745748      HeapFree( GetProcessHeap(), 0, pathA );
    746  
     749
    747750    if (!ret) return 0;
    748751
  • trunk/src/kernel32/dosdevice.cpp

    r21355 r21916  
    99 * Copyright 1993 Erik Bos
    1010 * Copyright 1996 Alexandre Julliard
    11  * 
     11 *
    1212 * Project Odin Software License can be found in LICENSE.TXT
    1313 *
     
    2424#include <os2win.h>
    2525#include <stdio.h>
     26#include <string.h>
    2627#include <winnls.h>
    2728#include "unicode.h"
    2829#include "handlemanager.h"
    2930#include "handlenames.h"
    30 #include <string.h>
    3131
    3232
     
    150150        }
    151151        *ptr = 0;
    152        
     152
    153153        SetLastError(ERROR_SUCCESS);
    154154        return sizeof(devices)+len;
     
    176176        if(devname[1] == ':' && devname[2] == 0) {
    177177            int ret = GetDriveTypeA(devname);
    178             if(ret != DRIVE_UNKNOWN) 
     178            if(ret != DRIVE_UNKNOWN)
    179179            {
    180180                if(bufsize < 16) {
  • trunk/src/kernel32/dosqss.h

    r1924 r21916  
    77#endif
    88
    9 #ifdef __cplusplus
    10 extern "C" {
    11 #endif
    12 APIRET APIENTRY DosQuerySysState(ULONG func,ULONG arg1,ULONG arg2,
    13                                  ULONG _res_,PVOID buf,ULONG bufsz);
    14 
    15 #ifdef __cplusplus
    16 }
    17 #endif
    18 
    19 inline APIRET _DosQuerySysState(ULONG func,ULONG arg1,ULONG arg2,
    20                                 ULONG _res_,PVOID buf,ULONG bufsz)
    21 {
    22  APIRET yyrc;
    23  USHORT sel = RestoreOS2FS();
    24 
    25     yyrc = DosQuerySysState(func, arg1, arg2, _res_, buf, bufsz);
    26     SetFS(sel);
    27 
    28     return yyrc;
    29 }
     9/* DosQuerySysState is declared in os2wrap.h */
    3010
    3111#undef  DosAllocMem
  • trunk/src/kernel32/environ.cpp

    r21355 r21916  
    4141//list of important OS/2 environment variables that must not be removed
    4242//when creating a new process
    43 static char *lpReservedEnvStrings[] = {
     43static const char *lpReservedEnvStrings[] = {
    4444"HOSTNAME",
    4545"TZ",
     
    7676  //TEMP is a standard environment variable in Windows, but is not always
    7777  //present in OS/2, so make sure it is.
    78   if(GetEnvironmentVariableA("TEMP", szVar, sizeof(szVar)) == 0) 
     78  if(GetEnvironmentVariableA("TEMP", szVar, sizeof(szVar)) == 0)
    7979  {
    8080      if(GetEnvironmentVariableA("TMP", szVar, sizeof(szVar)) == 0) {
     
    8585  }
    8686}
     87
     88extern "C" {
     89
    8790//******************************************************************************
    8891//******************************************************************************
     
    226229 *             If the function fails, the return value is zero
    227230 * Remark    :
    228  * Status    : 
     231 * Status    :
    229232 *
    230233 *****************************************************************************/
     
    254257            if ((p = strchr( src + 1, '%' )) != NULL)
    255258            {
    256                 len = p - src - 1;  /* Length of the variable name */   
     259                len = p - src - 1;  /* Length of the variable name */
    257260                if ((var = ENV_FindVariable( GetEnvironmentStringsA(),
    258261                                             src + 1, len )) != NULL)
     
    309312 *             If the function fails, the return value is zero
    310313 * Remark    :
    311  * Status    : 
     314 * Status    :
    312315 *
    313316 *****************************************************************************/
     
    330333  return ret;
    331334}
     335
     336} // extern "C"
     337
    332338//******************************************************************************
    333339// Create a new process environment block based on input from the application
     
    340346    char *tmpenvnew, *newenv;
    341347    int newsize = 0, len;
    342        
     348
    343349    dprintf(("New environment:"));
    344350    while(*tmpenvold) {
     
    374380        tmpenvold += len+1;
    375381    }
     382    int i;
    376383    for(i=0;i<sizeof(lpReservedEnvStrings)/sizeof(char *);i++) {
    377384        if(!ENV_FindVariable(lpEnvironment, lpReservedEnvStrings[i], strlen(lpReservedEnvStrings[i]))) {
  • trunk/src/kernel32/exceptions.cpp

    r21662 r21916  
    109109static PEXCEPTION_HANDLER           StartupCodeHandler = NULL;
    110110
    111 extern "C" PWINEXCEPTION_FRAME GetExceptionRecord(ULONG offset, ULONG segment);
     111extern "C" {
     112
     113PWINEXCEPTION_FRAME GetExceptionRecord(ULONG offset, ULONG segment);
    112114
    113115LONG WIN32API UnhandledExceptionFilter(PWINEXCEPTION_POINTERS lpexpExceptionInfo);
     
    118120                             PCONTEXTRECORD pCtxRec, PVOID p, PSZ szTrapDump);
    119121
    120 extern "C"
    121122int __cdecl __seh_handler(PWINEXCEPTION_RECORD pRec,
    122123                          PWINEXCEPTION_FRAME pFrame,
    123124                          PCONTEXTRECORD pContext, PVOID pVoid);
    124125
    125 extern "C"
    126126PWINEXCEPTION_FRAME __cdecl __seh_get_prev_frame(PWINEXCEPTION_FRAME pFrame);
    127127
     
    162162}
    163163
    164 #if 0
     164#ifdef __EMX__
    165165static inline WINEXCEPTION_FRAME * EXC_push_frame( WINEXCEPTION_FRAME *frame )
    166166{
     
    182182
    183183/*****************************************************************************
    184  * Name      : VOID _Pascal OS2RaiseException
     184 * Name      : VOID __cdecl OS2RaiseException
    185185 * Purpose   : Unwinds exception handlers (heavily influenced by Wine)
    186186 * Parameters: ...
     
    195195void WIN32API RtlRaiseException(WINEXCEPTION_RECORD *rec, WINCONTEXT *context);
    196196
    197 VOID _Pascal OS2RaiseException(DWORD dwExceptionCode,
     197VOID __cdecl OS2RaiseException(DWORD dwExceptionCode,
    198198                               DWORD dwExceptionFlags,
    199199                               DWORD cArguments,
     
    308308}
    309309
    310 #if 1
     310#ifndef __EMX__
     311extern "C"
    311312DWORD EXC_CallHandler( WINEXCEPTION_RECORD *record, WINEXCEPTION_FRAME *frame,
    312313                       WINCONTEXT *context, WINEXCEPTION_FRAME **dispatcher,
     
    441442}
    442443/*****************************************************************************
    443  * Name      : int _Pascal OS2RtlUnwind
     444 * Name      : int __cdecl OS2RtlUnwind
    444445 * Purpose   : Unwinds exception handlers (heavily influenced by Wine)
    445446 * Parameters: ...
     
    452453 *****************************************************************************/
    453454
    454 int _Pascal OS2RtlUnwind(PWINEXCEPTION_FRAME  pEndFrame,
     455int __cdecl OS2RtlUnwind(PWINEXCEPTION_FRAME  pEndFrame,
    455456                         LPVOID unusedEip,
    456457                         PWINEXCEPTION_RECORD pRecord,
     
    756757    }
    757758
    758     PSZ    pszExceptionName = "<unknown>";        /* points to name/type excpt */
     759    PCSZ   pszExceptionName = "<unknown>";        /* points to name/type excpt */
    759760    APIRET rc               = XCPT_CONTINUE_SEARCH;        /* excpt-dep.  code */
    760761    BOOL   fExcptSoftware   = FALSE;         /* software/hardware gen. exceptn */
     
    11811182
    11821183            if(lpszExeName) {
    1183                 DosWrite(hFile, "\n", 2, &ulBytesWritten);
     1184                DosWrite(hFile, (PVOID)"\n", 2, &ulBytesWritten);
    11841185                DosWrite(hFile, lpszExeName, strlen(lpszExeName), &ulBytesWritten);
    1185                 DosWrite(hFile, "\n", 2, &ulBytesWritten);
     1186                DosWrite(hFile, (PVOID)"\n", 2, &ulBytesWritten);
    11861187            }
    11871188        }
     
    17911792 * Author    : Sander van Leeuwen [Sun, 1999/08/21 12:16]
    17921793 *****************************************************************************/
    1793 void OS2SetExceptionHandler(void *exceptframe)
     1794void SYSTEM OS2SetExceptionHandler(void *exceptframe)
    17941795{
    17951796 PEXCEPTIONREGISTRATIONRECORD pExceptRec = (PEXCEPTIONREGISTRATIONRECORD)exceptframe;
     
    19541955 * Author    : Sander van Leeuwen [Sun, 1999/08/21 12:16]
    19551956 *****************************************************************************/
    1956 void OS2UnsetExceptionHandler(void *exceptframe)
     1957void SYSTEM OS2UnsetExceptionHandler(void *exceptframe)
    19571958{
    19581959 PEXCEPTIONREGISTRATIONRECORD pExceptRec = (PEXCEPTIONREGISTRATIONRECORD)exceptframe;
     
    19861987//*****************************************************************************
    19871988
     1989} // extern "C"
     1990
  • trunk/src/kernel32/exceptstackdump.cpp

    r21611 r21916  
    1414#define INCL_MISC
    1515#define INCL_BASE
    16 #include <os2.h>                     //No wrappers needed
     16#include <os2wrap.h>    //Odin32 OS/2 api wrappers
    1717#include <stdio.h>
    1818#include <string.h>
     
    3030#include "dbglocal.h"
    3131
    32 int SYSTEM EXPORT WriteLogNoEOL(char *tekst, ...);
     32int SYSTEM EXPORT WriteLogNoEOL(const char *tekst, ...);
    3333
    3434#define FIX64KLIMIT
     
    160160                            Buffer[SymDef32.cbSymName] = 0x00;
    161161//                          dprintf(("%s\n", Buffer));
    162 #ifdef RAS
     162#if defined(RAS) || defined(__GNUC__)
    163163                            strncpy(Info, Buffer, cbInfo);
    164164                            strncat(Info, "\n", cbInfo);
     
    183183                    {
    184184                        // symbol found
    185 #ifdef RAS
     185#if defined(RAS) || defined(__GNUC__)
    186186                        snprintf(Info, cbInfo, "between %s + 0x%X", Buffer, TrapOffset - LastVal);
    187187#else
     
    197197                    {
    198198                        // symbol found, as above
    199 #ifdef RAS
     199#if defined(RAS) || defined(__GNUC__)
    200200                        snprintf(&Info[strlen(Info)], cbInfo - strlen(Info),  " and %s - 0x%X\n", Buffer, LastVal - TrapOffset);
    201201#else
     
    223223                            Buffer[SymDef16.cbSymName] = 0x00;
    224224//                            dprintf(("%s\n", Buffer));
    225 #ifdef RAS
     225#if defined(RAS) || defined(__GNUC__)
    226226                            strncpy(Info, Buffer, cbInfo);
    227227                            strncat(Info, "\n", cbInfo);
     
    245245                    if (SymDef16.wSymVal > TrapOffset)
    246246                    {
    247 #ifdef RAS
     247#if defined(RAS) || defined(__GNUC__)
    248248                        snprintf(Info, cbInfo, "between %s + 0x%X", Buffer, TrapOffset - LastVal);
    249249#else
     
    257257                    if (SymDef16.wSymVal > TrapOffset)
    258258                    {
    259 #ifdef RAS
     259#if defined(RAS) || defined(__GNUC__)
    260260                        snprintf(&Info[strlen(Info)], cbInfo - strlen(Info),  " and %s - 0x%X\n", Buffer, LastVal - TrapOffset);
    261261#else
  • trunk/src/kernel32/exceptutil.asm

    r10409 r21916  
    3333
    3434CODE32          SEGMENT DWORD PUBLIC USE32 'CODE'
     35
     36
    3537        public  _RaiseException@16
    36         extrn   OS2RAISEEXCEPTION : near
     38        extrn   _OS2RaiseException : near
    3739
    3840_RaiseException@16 proc near
    39         push dword ptr [esp+4]  ;DWORD dwExceptionCode
    40         push dword ptr [esp+12] ;DWORD dwExceptionFlags
    41         push dword ptr [esp+20] ;DWORD cArguments
    42         push dword ptr [esp+28] ;DWORD *lpArguments
    43         push dword ptr [esp+16] ;return address
    44         push esp
    45         add  dword ptr [esp], 20
     41
     42        ; _OS2RaiseException is _cdecl
     43
    4644        push ebp
     45        mov  ebp, esp
     46        push eax
     47
     48        mov  eax, 0
     49        mov  eax, ss
     50        push eax
     51        mov  eax, gs
     52        push eax
     53        mov  eax, fs
     54        push eax
     55        mov  eax, es
     56        push eax
     57        mov  eax, ds
     58        push eax
     59        mov  eax, cs
     60        push cs
     61        push esi
     62        push edi
     63        push edx
     64        push ecx
     65        push ebx
     66        push dword ptr [ebp-4]      ; original eax
    4767        pushfd
    48         push eax
     68        push dword ptr [ebp]        ; original ebp
     69        push ebp
     70        add  dword ptr [esp], 4     ; original esp
     71        push dword ptr [ebp + 4]    ; original eip (return address)
     72
     73        push dword ptr [ebp + 20]   ; arg 4 (DWORD *lpArguments)
     74        push dword ptr [ebp + 16]   ; arg 3 (DWORD cArguments)
     75        push dword ptr [ebp + 12]   ; arg 2 (DWORD dwExceptionFlags)
     76        push dword ptr [ebp + 8]    ; arg 1 (DWORD dwExceptionCode)
     77
     78        call _OS2RaiseException
     79
     80        add esp, 20 * 4
     81
     82        pop eax
     83        pop ebp
     84
     85        ret 16      ;__stdcall
     86
     87_RaiseException@16 endp
     88
     89
     90        public  _RtlUnwind@16
     91        extrn   _OS2RtlUnwind : near
     92
     93_RtlUnwind@16 proc near
     94
     95        ; OS2RtlUnwind is _cdecl
     96
     97        push ebp
     98        mov  ebp, esp
     99        push eax
     100
     101        mov  eax, 0
     102        mov  eax, ss
     103        push eax
     104        mov  eax, gs
     105        push eax
     106        mov  eax, fs
     107        push eax
     108        mov  eax, es
     109        push eax
     110        mov  eax, ds
     111        push eax
     112        mov  eax, cs
     113        push cs
     114        push esi
     115        push edi
     116        push edx
     117        push ecx
    49118        push ebx
    50         push ecx
    51         push edx
    52         push edi
    53         push esi
    54         xor  eax, eax
    55         mov  eax, cs
    56         push eax
    57         mov  eax, ds
    58         push eax
    59         mov  eax, es
    60         push eax
    61         mov  eax, fs
    62         push eax
    63         mov  eax, gs
    64         push eax
    65         mov  eax, ss
    66         push eax
    67         call OS2RAISEEXCEPTION
     119        push dword ptr [ebp-4]      ; original eax
     120        pushfd
     121        push dword ptr [ebp]        ; original ebp
     122        push ebp
     123        add  dword ptr [esp], 4     ; original esp
     124        push dword ptr [ebp + 4]    ; original eip (return address)
     125
     126        push dword ptr [ebp + 20]   ; arg 4 (DWORD returnEax)
     127        push dword ptr [ebp + 16]   ; arg 3 (PWINEXCEPTION_RECORD pRecord)
     128        push dword ptr [ebp + 12]   ; arg 2 (LPVOID unusedEip)
     129        push dword ptr [ebp + 8]    ; arg 1 (PWINEXCEPTION_FRAME pEndFrame)
     130
     131        call _OS2RtlUnwind
     132
     133        add esp, 20 * 4
     134
     135        pop eax
     136        pop ebp
    68137
    69138        ret 16      ;__stdcall
    70 _RaiseException@16 endp
    71 
    72         public  _RtlUnwind@16
    73         extrn   OS2RTLUNWIND : near
    74 
    75 _RtlUnwind@16 proc near
    76         push dword ptr [esp+4]  ;PWINEXCEPTION_FRAME  pEndFrame
    77         push dword ptr [esp+12] ;LPVOID unusedEip
    78         push dword ptr [esp+20] ;PWINEXCEPTION_RECORD pRecord
    79         push dword ptr [esp+28] ;DWORD  returnEax
    80         push dword ptr [esp+16] ;return address
    81         push esp
    82         add  dword ptr [esp], 20
    83         push ebp
    84         pushfd
    85         push eax
    86         push ebx
    87         push ecx
    88         push edx
    89         push edi
    90         push esi
    91         xor  eax, eax
    92         mov  eax, cs
    93         push eax
    94         mov  eax, ds
    95         push eax
    96         mov  eax, es
    97         push eax
    98         mov  eax, fs
    99         push eax
    100         mov  eax, gs
    101         push eax
    102         mov  eax, ss
    103         push eax
    104         call OS2RTLUNWIND
    105 
    106         ret 16      ;__stdcall
     139
    107140_RtlUnwind@16 endp
    108141
     
    118151OS2ExceptionHandler endp
    119152
    120         PUBLIC QueryExceptionChain
    121 
    122 QueryExceptionChain proc near
     153        PUBLIC _QueryExceptionChain
     154
     155_QueryExceptionChain proc near
    123156        mov  eax, fs:[0]
    124157        ret
    125 QueryExceptionChain endp
     158_QueryExceptionChain endp
    126159
    127160        PUBLIC GetExceptionRecord
     
    279312_CallEntryPoint endp
    280313
    281 
    282 ; 281 static DWORD EXC_CallHandler( WINEXCEPTION_RECORD *record, WINEXCEPTION_FRAME *frame,
     314ifndef __EMX__
     315
    283316        EXTRN WriteLog:PROC
    284317        EXTRN _GetThreadTEB@0:PROC
    285318IFDEF DEBUG
    286         EXTRN DbgEnabledKERNEL32:DWORD
     319        EXTRN _DbgEnabledKERNEL32:DWORD
    287320ENDIF
    288321
    289 EXC_push_frame__FP19_WINEXCEPTION_FRAME proc
     322; 129 static inline WINEXCEPTION_FRAME * EXC_push_frame( WINEXCEPTION_FRAME *frame )
     323        align 04h
     324
     325EXC_push_frame  proc
    290326        push    ebp
    291327        mov     ebp,esp
     
    313349        leave   
    314350        ret     
    315 EXC_push_frame__FP19_WINEXCEPTION_FRAME endp
     351EXC_push_frame  endp
    316352
    317353; 138 static inline WINEXCEPTION_FRAME * EXC_pop_frame( WINEXCEPTION_FRAME *frame )
    318354        align 04h
    319355
    320 EXC_pop_frame__FP19_WINEXCEPTION_FRAME  proc
     356EXC_pop_frame   proc
    321357        push    ebp
    322358        mov     ebp,esp
     
    339375        leave   
    340376        ret     
    341 EXC_pop_frame__FP19_WINEXCEPTION_FRAME  endp
    342 
     377EXC_pop_frame   endp
     378
     379; 281 static extern "C" DWORD EXC_CallHandler( WINEXCEPTION_RECORD *record, WINEXCEPTION_FRAME *frame,
    343380        align 04h
    344         PUBLIC EXC_CallHandler__FP20_WINEXCEPTION_RECORDP19_WINEXCEPTION_FRAMEP10WINCONTEXTPP19_WINEXCEPTION_FRAMEPFP20_WINEXCEPTION_RECORDP19_WINEXCEPTION_FRAMEP10WINCONTEXTPv_UlT5
    345 
    346 EXC_CallHandler__FP20_WINEXCEPTION_RECORDP19_WINEXCEPTION_FRAMEP10WINCONTEXTPP19_WINEXCEPTION_FRAMEPFP20_WINEXCEPTION_RECORDP19_WINEXCEPTION_FRAMEP10WINCONTEXTPv_UlT5  proc
     381        PUBLIC _EXC_CallHandler
     382
     383_EXC_CallHandler        proc
    347384        push    ebp
    348385        mov     ebp,esp
     
    363400; 298     EXC_push_frame( &newframe.frame );
    364401        lea     eax,[ebp-0ch];  newframe
    365         call    EXC_push_frame__FP19_WINEXCEPTION_FRAME
     402        call    EXC_push_frame
    366403
    367404; 299     dprintf(("KERNEL32: Calling handler at %p code=%lx flags=%lx\n",
    368405IFDEF DEBUG
    369         cmp     word ptr  DbgEnabledKERNEL32+020h,01h
     406        cmp     word ptr  _DbgEnabledKERNEL32+020h,01h
    370407        jne     @BLBL20
    371408        mov     eax,[ebp+08h];  record
     
    392429IFDEF DEBUG
    393430; 302     dprintf(("KERNEL32: Handler returned %lx\n", ret));
    394         cmp     word ptr  DbgEnabledKERNEL32+020h,01h
     431        cmp     word ptr  _DbgEnabledKERNEL32+020h,01h
    395432        jne     @BLBL21
    396433        push    dword ptr [ebp-010h];   ret
     
    403440; 303     EXC_pop_frame( &newframe.frame );
    404441        lea     eax,[ebp-0ch];  newframe
    405         call    EXC_pop_frame__FP19_WINEXCEPTION_FRAME
     442        call    EXC_pop_frame
    406443
    407444; 304     return ret;
     
    410447        leave   
    411448        ret     
    412 EXC_CallHandler__FP20_WINEXCEPTION_RECORDP19_WINEXCEPTION_FRAMEP10WINCONTEXTPP19_WINEXCEPTION_FRAMEPFP20_WINEXCEPTION_RECORDP19_WINEXCEPTION_FRAMEP10WINCONTEXTPv_UlT5  endp
     449_EXC_CallHandler        endp
     450
     451endif ; ifndef __EMX__
    413452
    414453CODE32          ENDS
  • trunk/src/kernel32/exceptutil.h

    r21619 r21916  
    2020void  __cdecl SetExceptionChain(DWORD);
    2121
    22 extern "C" PVOID QueryExceptionChain();
     22PVOID QueryExceptionChain();
    2323
    24 void OS2SetExceptionHandler(void *exceptframe);
    25 void OS2UnsetExceptionHandler(void *exceptframe);
     24void SYSTEM OS2SetExceptionHandler(void *exceptframe);
     25void SYSTEM OS2UnsetExceptionHandler(void *exceptframe);
    2626
    2727#ifdef DEBUG
  • trunk/src/kernel32/handlenames.cpp

    r21302 r21916  
    2727#define INCL_DOSSEMAPHORES
    2828#define INCL_DOSERRORS
    29 #include <os2.h>
     29#include <os2wrap.h>
    3030
    3131#include <stdlib.h>
     
    5353  PSZ   pszTarget;
    5454  ULONG ulTargetLength;
    55  
     55
    5656  // the alias prefix
    5757  PSZ   pszSymbolicLink;
     
    6565    VMutex       mtxHandleNameMgr;
    6666    CLinearList* pSymbolicLinks;
    67  
    68     PHANDLENAME findSymbolicLink(PSZ pszSymbolicLink,
     67
     68    PHANDLENAME findSymbolicLink(PCSZ pszSymbolicLink,
    6969                                 BOOL fCaseInsensitive);
    70  
    71     PHANDLENAME findSymbolicLinkExact(PSZ pszSymbolicLink);
    72  
     70
     71    PHANDLENAME findSymbolicLinkExact(PCSZ pszSymbolicLink);
     72
    7373  public:
    7474    HandleNames(void);
    7575    ~HandleNames();
    76  
    77     BOOL addSymbolicLink(PSZ pszSymbolicLink,
    78                          PSZ pszTarget);
    79  
    80     BOOL removeSymbolicLink(PSZ pszSymbolicLink);
    81  
    82     BOOL removeTarget(PSZ pszTarget);
    83  
    84     BOOL resolveName(PSZ pszName,
    85                      PSZ pszTarget, 
    86                      ULONG ulTargetLength, 
     76
     77    BOOL addSymbolicLink(PCSZ pszSymbolicLink,
     78                         PCSZ pszTarget);
     79
     80    BOOL removeSymbolicLink(PCSZ pszSymbolicLink);
     81
     82    BOOL removeTarget(PCSZ pszTarget);
     83
     84    BOOL resolveName(PCSZ pszName,
     85                     PSZ pszTarget,
     86                     ULONG ulTargetLength,
    8787                     BOOL fCaseInsensitive);
    8888};
     
    107107 * Name      : HandleNames::HandleNames
    108108 * Purpose   : Constructor for handle name mapper
    109  * Parameters: 
    110  * Variables :
    111  * Result    : 
     109 * Parameters:
     110 * Variables :
     111 * Result    :
    112112 * Remark    :
    113113 * Status    :
     
    127127 * Name      : HandleNames::~HandleNames
    128128 * Purpose   : destructor for handle name mapper
    129  * Parameters: 
    130  * Variables :
    131  * Result    : 
     129 * Parameters:
     130 * Variables :
     131 * Result    :
    132132 * Remark    :
    133133 * Status    :
     
    148148 *             BOOL fCaseInsensitive - TRUE for a case-insensitive lookup
    149149 * Variables :
    150  * Result    : 
     150 * Result    :
    151151 * Remark    : The comparison here is not meant to be "identity" but
    152152 *             "startsWith" because for the name resolver, the first
     
    161161 *****************************************************************************/
    162162
    163 PHANDLENAME HandleNames::findSymbolicLink(PSZ pszSymbolicLink,
     163PHANDLENAME HandleNames::findSymbolicLink(PCSZ pszSymbolicLink,
    164164                                          BOOL fCaseInsensitive)
    165165{
     
    170170    PHANDLENAME pHandleName = (PHANDLENAME)pLE->pObject;
    171171    int cch = pHandleName->ulSymbolicLinkLength; //strlen(pHandleName->pszSymbolicLink);
    172    
     172
    173173    /* pszSymbolicLink must end a path component at cch. */
    174174    if (    cch <= cchSymbolicLink
     
    186186    }
    187187    }
    188    
     188
    189189    // skip to the next entry
    190190    pLE = pSymbolicLinks->getNext(pLE);
    191191  }
    192  
     192
    193193  // not found
    194194  return NULL;
     
    202202 *             BOOL fCaseInsensitive - TRUE for a case-insensitive lookup
    203203 * Variables :
    204  * Result    : 
     204 * Result    :
    205205 * Remark    : The comparison here is not meant to be "identity" but
    206206 *             "startsWith" because for the name resolver, the first
     
    215215 *****************************************************************************/
    216216
    217 PHANDLENAME HandleNames::findSymbolicLinkExact(PSZ pszSymbolicLink)
     217PHANDLENAME HandleNames::findSymbolicLinkExact(PCSZ pszSymbolicLink)
    218218{
    219219  PLINEARLISTENTRY pLE = pSymbolicLinks->getFirst();
     
    221221  {
    222222    PHANDLENAME pHandleName = (PHANDLENAME)pLE->pObject;
    223    
     223
    224224    if (strcmp(pHandleName->pszSymbolicLink, pszSymbolicLink) == 0)
    225225      return pHandleName;
    226    
     226
    227227    // skip to the next entry
    228228    pLE = pSymbolicLinks->getNext(pLE);
    229229  }
    230  
     230
    231231  // not found
    232232  return NULL;
     
    248248 *****************************************************************************/
    249249
    250 BOOL HandleNames::addSymbolicLink(PSZ pszSymbolicLink,
    251                                   PSZ pszTarget)
     250BOOL HandleNames::addSymbolicLink(PCSZ pszSymbolicLink,
     251                                  PCSZ pszTarget)
    252252{
    253253  BOOL rc = TRUE;
    254  
     254
    255255  mtxHandleNameMgr.enter();
    256  
     256
    257257  // 1 - find symbolic link with same name
    258258  PHANDLENAME pHandleName = findSymbolicLinkExact(pszSymbolicLink);
    259  
    260   // 2 - if found 
     259
     260  // 2 - if found
    261261  if (NULL != pHandleName)
    262262  {
     
    264264    if (strcmp(pszTarget, pHandleName->pszTarget) == 0)
    265265      rc = TRUE;
    266    
     266
    267267    // 2.2 - and targets are identical, return TRUE
    268268    else
     
    297297          pHandleName->ulTargetLength = strlen(pszTarget);
    298298          pHandleName->ulSymbolicLinkLength = strlen(pszSymbolicLink);
    299          
     299
    300300          // OK, finally add to the list
    301301          pSymbolicLinks->addFirst(pHandleName);
     
    304304    }
    305305  }
    306  
     306
    307307  mtxHandleNameMgr.leave();
    308  
     308
    309309  return rc;
    310310}
     
    312312
    313313/*****************************************************************************
    314  * Name      : 
    315  * Purpose   : 
    316  * Parameters: 
     314 * Name      :
     315 * Purpose   :
     316 * Parameters:
    317317 * Variables :
    318318 * Result    : TRUE if successful, FALSE if otherwise
     
    323323 *****************************************************************************/
    324324
    325 BOOL HandleNames::removeSymbolicLink(PSZ pszSymbolicLink)
     325BOOL HandleNames::removeSymbolicLink(PCSZ pszSymbolicLink)
    326326{
    327327  BOOL rc = TRUE;
    328  
     328
    329329  mtxHandleNameMgr.enter();
    330  
     330
    331331  // 1 - find symbolic name
    332332  PHANDLENAME pHandleName = findSymbolicLinkExact(pszSymbolicLink);
     
    337337    // 2 - remove the link
    338338    pSymbolicLinks->removeObject(pHandleName);
    339    
     339
    340340    if (NULL != pHandleName->pszSymbolicLink )
    341341      free( pHandleName->pszSymbolicLink );
    342    
     342
    343343    if (NULL != pHandleName->pszTarget )
    344344      free( pHandleName->pszTarget );
    345    
     345
    346346    free( pHandleName );
    347347  }
    348  
     348
    349349  mtxHandleNameMgr.leave();
    350  
     350
    351351  return rc;
    352352}
     
    365365 *****************************************************************************/
    366366
    367 BOOL HandleNames::removeTarget(PSZ pszTarget)
     367BOOL HandleNames::removeTarget(PCSZ pszTarget)
    368368{
    369369  BOOL rc = FALSE;
    370  
     370
    371371  mtxHandleNameMgr.enter();
    372  
     372
    373373  // iterate over all registered symbolic links
    374374  PLINEARLISTENTRY pLE = pSymbolicLinks->getFirst();
     
    376376  {
    377377    PHANDLENAME pHandleName = (PHANDLENAME)pLE->pObject;
    378    
     378
    379379    // check the name
    380380    if (strcmp(pszTarget, pHandleName->pszTarget) == 0)
    381381    {
    382382      pSymbolicLinks->removeElement(pLE);
    383      
     383
    384384      // at least one removal succeeded
    385385      rc = TRUE;
    386386    }
    387387  }
    388  
     388
    389389  mtxHandleNameMgr.leave();
    390  
     390
    391391  return rc;
    392392}
     
    403403 * Variables :
    404404 * Result    : FALSE if name was not modified, TRUE if name was resolved
    405  * Remark    : This is a very easy, cheesy implementation of a pathname 
     405 * Remark    : This is a very easy, cheesy implementation of a pathname
    406406 *             cracker. Should be sufficient at the moment though.
    407407 * Status    :
     
    410410 *****************************************************************************/
    411411
    412 BOOL HandleNames::resolveName(PSZ pszName,
    413                               PSZ pszTarget, 
     412BOOL HandleNames::resolveName(PCSZ pszName,
     413                              PSZ pszTarget,
    414414                              ULONG ulTargetLength,
    415415                              BOOL fCaseInsensitive)
    416416{
    417417  BOOL rc = FALSE;
    418  
     418
    419419  mtxHandleNameMgr.enter();
    420  
     420
    421421  // scan through the names (case-insensitive)
    422422  PHANDLENAME pHandleName = findSymbolicLink(pszName, fCaseInsensitive);
     
    425425    // rebuild the target name
    426426    int iNameLength     = strlen(pszName);
    427    
     427
    428428    // first copy the resolved target name fragment
    429429    strncpy(pszTarget,
    430430            pHandleName->pszTarget,
    431431            ulTargetLength);
    432    
     432
    433433    // now append the rest of the specified name with the
    434434    // now resolved symbolic cut away
     
    437437              pszName + pHandleName->ulSymbolicLinkLength,
    438438              ulTargetLength - pHandleName->ulTargetLength);
    439    
     439
    440440    // tell caller the name has been resolved
    441441    // (is different from the source name)
    442442    rc = TRUE;
    443443  }
    444  
     444
    445445  mtxHandleNameMgr.leave();
    446  
     446
    447447  return rc;
    448448}
     
    454454 * Exported Wrapper Functions
    455455 *****************************************************************************/
    456  
    457 BOOL HandleNamesResolveName(PSZ pszName,
     456
     457BOOL HandleNamesResolveName(PCSZ pszName,
    458458                            PSZ pszTarget,
    459459                            ULONG ulTargetLength,
     
    467467
    468468
    469 BOOL HandleNamesAddSymbolicLink(PSZ pszSymbolicLink,
    470                                 PSZ pszTarget)
     469BOOL HandleNamesAddSymbolicLink(PCSZ pszSymbolicLink,
     470                                PCSZ pszTarget)
    471471{
    472472  return pHandleNameMgr->addSymbolicLink(pszSymbolicLink,
    473473                                         pszTarget);
    474474}
    475  
    476 
    477 BOOL HandleNamesRemoveSymbolicLink(PSZ pszSymbolicLink)
     475
     476
     477BOOL HandleNamesRemoveSymbolicLink(PCSZ pszSymbolicLink)
    478478{
    479479  return pHandleNameMgr->removeSymbolicLink(pszSymbolicLink);
    480480}
    481  
    482 
    483 BOOL HandleNamesRemoveTarget(PSZ pszTarget)
     481
     482
     483BOOL HandleNamesRemoveTarget(PCSZ pszTarget)
    484484{
    485485  return pHandleNameMgr->removeTarget(pszTarget);
  • trunk/src/kernel32/handlenames.h

    r7441 r21916  
    1717 * Exported Wrapper Functions
    1818 *****************************************************************************/
    19  
    20 BOOL HandleNamesResolveName(PSZ pszName,
     19
     20BOOL HandleNamesResolveName(PCSZ pszName,
    2121                            PSZ pszTarget,
    2222                            ULONG ulTargetLength,
    2323                            BOOL fCaseInsensitive);
    2424
    25 BOOL HandleNamesAddSymbolicLink(PSZ pszSymbolicLink,
    26                                 PSZ pszTarget);
     25BOOL HandleNamesAddSymbolicLink(PCSZ pszSymbolicLink,
     26                                PCSZ pszTarget);
    2727
    28 BOOL HandleNamesRemoveSymbolicLink(PSZ pszSymbolicLink);
     28BOOL HandleNamesRemoveSymbolicLink(PCSZ pszSymbolicLink);
    2929
    30 BOOL HandleNamesRemoveTarget(PSZ pszTarget);
     30BOOL HandleNamesRemoveTarget(PCSZ pszTarget);
    3131
    3232
  • trunk/src/kernel32/heap.cpp

    r21435 r21916  
    264264
    265265#pragma pack()
     266
     267extern "C" {
    266268
    267269/***********************************************************************
     
    10131015}
    10141016
     1017} // extern "C"
     1018
  • trunk/src/kernel32/heapshared.cpp

    r21302 r21916  
    88 *
    99 * TODO: Not process/thread safe (initializing/destroying heap)
    10  * 
     10 *
    1111 * ASSUMPTION: Rtl library takes care of protection of heap increase/decrease
    1212 *             (from multiple threads/processes)
     
    3131#include "dbglocal.h"
    3232
    33 #define MAX_HEAPSIZE            (2048*1024)
     33#define MAX_HEAPSIZE        (2048*1024)
    3434#define MAX_HEAPPAGES           (MAX_HEAPSIZE/PAGE_SIZE)
    3535#define INCR_HEAPSIZE           (16*1024)
    3636
    37 //Global DLL Data
    38 #pragma data_seg(_GLOBALDATA)
    39        Heap_t  sharedHeap = 0;
    40 static PVOID   pSharedMem = NULL;
    41 static BYTE    pageBitmap[MAX_HEAPPAGES] = {0};
    42 static ULONG   refCount = 0;
    43 #pragma data_seg()
     37//
     38// Global DLL Data (keep it in sync with globaldata.asm!)
     39//
     40extern Heap_t  sharedHeap; // = 0
     41extern PVOID   pSharedMem; // = NULL
     42extern BYTE    pageBitmap[MAX_HEAPPAGES]; // = {0}
     43extern ULONG   refCount; // = 0;
    4444
    4545static int     privateRefCount = 0;
     
    158158    dprintf(("KERNEL32: GetPageRangeFree(%08xh)", pageoffset));
    159159
    160     for(int i=pageoffset;i<MAX_HEAPPAGES;i++) {
     160    int i;
     161    for(i=pageoffset;i<MAX_HEAPPAGES;i++) {
    161162        if(pageBitmap[i] == 1) {
    162163                    break;
     
    184185    {
    185186        int nrpagesfree = GetPageRangeFree(i);
    186         if(nrpagesfree >= *size/PAGE_SIZE) 
     187        if(nrpagesfree >= *size/PAGE_SIZE)
    187188        {
    188189                    newblock = (PVOID)((ULONG)pSharedMem + i*PAGE_SIZE);
     
    254255//******************************************************************************
    255256//******************************************************************************
    256 void * _System _debug_smalloc(int size, char *pszFile, int linenr)
     257void * _System _debug_smalloc(int size, const char *pszFile, int linenr)
    257258{
    258259    void *chunk;
     
    268269//******************************************************************************
    269270//******************************************************************************
    270 void * _System _debug_smallocfill(int size, int filler, char *pszFile, int linenr)
     271void * _System _debug_smallocfill(int size, int filler, const char *pszFile, int linenr)
    271272{
    272273    void *chunk;
     
    285286//******************************************************************************
    286287//******************************************************************************
    287 void   _System _debug_sfree(void *chunk, char *pszFile, int linenr)
     288void   _System _debug_sfree(void *chunk, const char *pszFile, int linenr)
    288289{
    289290    dprintf(("_sfree %x", chunk));
  • trunk/src/kernel32/heapstring.cpp

    r21361 r21916  
    2525#include <unicode.h>
    2626#include <ctype.h>
     27#include <wchar.h>
     28#ifndef __GNUC__
    2729#include <wcstr.h>
     30#endif
    2831#include "heap.h"
    29 #include <wine\unicode.h>
     32#include <wine/unicode.h>
    3033#include "misc.h"
    3134#include "codepage.h"
     
    443446      return 1;
    444447
    445   return strcmpi(arg1, arg2);
     448  return stricmp(arg1, arg2);
    446449}
    447450
  • trunk/src/kernel32/hmcomm.cpp

    r21302 r21916  
    233233        {
    234234            OSLibDosClose(pHMHandleData->hHMHandle);
    235             delete pHMHandleData->lpHandlerData;
     235            delete (PHMDEVCOMDATA)pHMHandleData->lpHandlerData;
    236236            return rc;
    237237        }
     
    274274fail:
    275275
    276     delete pHMHandleData->lpHandlerData;
     276    delete (PHMDEVCOMDATA)pHMHandleData->lpHandlerData;
    277277    OSLibDosClose(pHMHandleData->hHMHandle);
    278278    return ret;
     
    300300BOOL HMDeviceCommClass::CloseHandle(PHMHANDLEDATA pHMHandleData)
    301301{
    302     PHMDEVCOMDATA pDevData = (PHMDEVCOMDATA)pHMHandleData->lpHandlerData;
    303302    dprintf(("HMComm: Serial communication port close request"));
    304303
    305     delete pHMHandleData->lpHandlerData;
     304    delete (PHMDEVCOMDATA)pHMHandleData->lpHandlerData;
    306305    return OSLibDosClose(pHMHandleData->hHMHandle);
    307306}
  • trunk/src/kernel32/hmdevice.h

    r21302 r21916  
    446446
    447447
     448#ifdef __cplusplus
     449extern "C" {
     450#endif
     451
    448452/*****************************************************************************
    449453 * Prototypes                                                                *
     
    451455
    452456                            /* register a new device with the handle manager */
    453 DWORD  HMDeviceRegister(LPSTR           pszDeviceName,
     457DWORD  HMDeviceRegister(LPCSTR           pszDeviceName,
    454458                        HMDeviceHandler *pDeviceHandler);
    455459
    456 DWORD  HMDeviceRegisterEx(LPSTR           pszDeviceName,
     460DWORD  HMDeviceRegisterEx(LPCSTR           pszDeviceName,
    457461                          HMDeviceHandler *pDeviceHandler,
    458462                          VOID            *pDevData);
    459463
     464#ifdef __cplusplus
     465} // extern "C"
     466#endif
    460467
    461468#include "hmhandle.h"
  • trunk/src/kernel32/hmdevio.cpp

    r21302 r21916  
    2525#include <win32api.h>
    2626#include <misc.h>
    27 #include <win\winioctl.h>
     27#include <win/winioctl.h>
    2828#include "hmdevio.h"
    2929#include "exceptutil.h"
     
    4747 DWORD rc;
    4848
    49     for(int i=0;i<nrKnownDrivers;i++) 
     49    for(int i=0;i<nrKnownDrivers;i++)
    5050    {
    5151            driver = new HMDeviceDriver(knownDriver[i].szWin32Name,
     
    101101                        if (rc != NO_ERROR)                                  /* check for errors */
    102102                          dprintf(("KERNEL32:RegisterDevices: registering %s failed with %u.\n", szDrvName, rc));
    103                      
     103
    104104                        // @@@PH
    105105                        // there should be an symbolic link:
     
    109109                rc = 0;
    110110            }
    111         }   
     111        }
    112112        RegCloseKey(hkDrivers);
    113113    }
     
    117117//******************************************************************************
    118118//******************************************************************************
    119 BOOL WIN32API RegisterCustomDriver(PFNDRVOPEN pfnDriverOpen, PFNDRVCLOSE pfnDriverClose, 
     119BOOL WIN32API RegisterCustomDriver(PFNDRVOPEN pfnDriverOpen, PFNDRVCLOSE pfnDriverClose,
    120120                                   PFNDRVIOCTL pfnDriverIOCtl, PFNDRVREAD pfnDriverRead,
    121121                                   PFNDRVWRITE pfnDriverWrite, PFNDRVCANCELIO pfnDriverCancelIo,
     
    141141//******************************************************************************
    142142//******************************************************************************
    143 HMDeviceDriver::HMDeviceDriver(LPCSTR lpDeviceName, LPSTR lpOS2DevName, BOOL fCreate, 
     143HMDeviceDriver::HMDeviceDriver(LPCSTR lpDeviceName, LPSTR lpOS2DevName, BOOL fCreate,
    144144                               WINIOCTL pDevIOCtl)
    145145                : HMDeviceHandler(lpDeviceName)
     
    215215  dprintf(("DosOpen %s returned %d\n", szOS2Name, rc));
    216216
    217   if(rc == NO_ERROR) 
     217  if(rc == NO_ERROR)
    218218  {
    219219    pHMHandleData->hHMHandle = hfFileHandle;
    220220    return (NO_ERROR);
    221221  }
    222   else 
     222  else
    223223    return(error2WinError(rc));
    224224}
     
    259259//******************************************************************************
    260260//******************************************************************************
    261 HMCustomDriver::HMCustomDriver(PFNDRVOPEN pfnDriverOpen, PFNDRVCLOSE pfnDriverClose, 
     261HMCustomDriver::HMCustomDriver(PFNDRVOPEN pfnDriverOpen, PFNDRVCLOSE pfnDriverClose,
    262262                               PFNDRVIOCTL pfnDriverIOCtl, PFNDRVREAD pfnDriverRead,
    263263                               PFNDRVWRITE pfnDriverWrite, PFNDRVCANCELIO pfnDriverCancelIo,
     
    461461        return FALSE;
    462462    }
    463     return pfnDriverGetOverlappedResult(lpDriverData, pHMHandleData->hHMHandle, pHMHandleData->dwFlags, 
     463    return pfnDriverGetOverlappedResult(lpDriverData, pHMHandleData->hHMHandle, pHMHandleData->dwFlags,
    464464                                        lpOverlapped, lpcbTransfer, fWait, (LPVOID)pHMHandleData->dwUserData);
    465465}
     466
     467extern "C" {
     468
    466469//******************************************************************************
    467470//******************************************************************************
     
    507510//******************************************************************************
    508511//******************************************************************************
     512
     513} // extern "C"
     514
  • trunk/src/kernel32/hmdisk.cpp

    r9911 r21916  
    1818#include "hmdisk.h"
    1919#include "mmap.h"
    20 #include <win\winioctl.h>
    21 #include <win\ntddscsi.h>
    22 #include <win\wnaspi32.h>
     20#include <win/winioctl.h>
     21#include <win/ntddscsi.h>
     22#include <win/wnaspi32.h>
    2323#include "oslibdos.h"
    2424#include "osliblvm.h"
     
    4343typedef struct
    4444{
    45     BOOL      fCDIoSupported;   
     45    BOOL      fCDIoSupported;
    4646    ULONG     driveLetter;
    4747    ULONG     driveType;
     
    163163    szDrive[2] = '\0';
    164164
    165     //if volume name, query 
    166     if(!strncmp(lpFileName, VOLUME_NAME_PREFIX, sizeof(VOLUME_NAME_PREFIX)-1)) 
     165    //if volume name, query
     166    if(!strncmp(lpFileName, VOLUME_NAME_PREFIX, sizeof(VOLUME_NAME_PREFIX)-1))
    167167    {
    168168        int length;
     
    171171            return ERROR_FILE_NOT_FOUND;    //not allowed
    172172        }
    173         if(OSLibLVMStripVolumeName(lpFileName, szVolumeName, sizeof(szVolumeName))) 
     173        if(OSLibLVMStripVolumeName(lpFileName, szVolumeName, sizeof(szVolumeName)))
    174174        {
    175175            BOOL fLVMVolume;
     
    184184                return ERROR_FILE_NOT_FOUND;    //not found
    185185            }
    186             if(szDrive[0] == 0) 
     186            if(szDrive[0] == 0)
    187187            {
    188188                //volume isn't mounted
    189                
     189
    190190                //Note: this only works on Warp 4.5 and up
    191                 sprintf(szDiskName, "\\\\.\\Physical_Disk%d", volext.Extents[0].DiskNumber+1); 
     191                sprintf(szDiskName, "\\\\.\\Physical_Disk%d", volext.Extents[0].DiskNumber+1);
    192192                fPhysicalDisk    = TRUE;
    193193                dwPhysicalDiskNr = volext.Extents[0].DiskNumber + 1;
     
    211211        else return ERROR_FILE_NOT_FOUND;
    212212    }
    213     else 
    214     if(strncmp(lpFileName, "\\\\.\\PHYSICALDRIVE", 17) == 0) 
     213    else
     214    if(strncmp(lpFileName, "\\\\.\\PHYSICALDRIVE", 17) == 0)
    215215    {
    216216        if(!fPhysicalDiskAccess) {
     
    304304        drvInfo->fLocked   = FALSE;
    305305
    306         //save volume start & length if volume must be accessed through the physical disk 
     306        //save volume start & length if volume must be accessed through the physical disk
    307307        //(no other choice for unmounted volumes)
    308308        drvInfo->fPhysicalDisk    = fPhysicalDisk;
     
    348348        if(pHMHandleData->hHMHandle && drvInfo->dwShare == 0) {
    349349            dprintf(("Locking drive"));
    350             if(OSLibDosDevIOCtl(pHMHandleData->hHMHandle,IOCTL_DISK,DSK_LOCKDRIVE,0,0,0,0,0,0)) 
     350            if(OSLibDosDevIOCtl(pHMHandleData->hHMHandle,IOCTL_DISK,DSK_LOCKDRIVE,0,0,0,0,0,0))
    351351            {
    352352                dprintf(("Sharing violation while attempting to lock the drive"));
     
    411411        if(hFile && drvInfo->dwShare == 0) {
    412412            dprintf(("Locking drive"));
    413             if(OSLibDosDevIOCtl(hFile,IOCTL_DISK,DSK_LOCKDRIVE,0,0,0,0,0,0)) 
     413            if(OSLibDosDevIOCtl(hFile,IOCTL_DISK,DSK_LOCKDRIVE,0,0,0,0,0,0))
    414414            {
    415415                dprintf(("Sharing violation while attempting to lock the drive"));
     
    522522{
    523523#ifdef DEBUG
    524     char *msg = NULL;
     524    const char *msg = NULL;
    525525
    526526    switch(dwIoControlCode)
     
    890890        //label has changed
    891891        //TODO: Find better way to determine if floppy was removed or switched
    892         if(drvInfo->driveType != DRIVE_FIXED) 
     892        if(drvInfo->driveType != DRIVE_FIXED)
    893893        {
    894894            rc = OSLibDosQueryVolumeSerialAndName(1 + drvInfo->driveLetter - 'A', &volumelabel, NULL, 0);
     
    14391439        return (ret == ERROR_SUCCESS);
    14401440    }
    1441    
     1441
    14421442    case IOCTL_CDROM_RAW_READ:
    14431443    {
    14441444#pragma pack(1)
    1445        struct 
     1445       struct
    14461446       {
    14471447        ULONG       ID_code;
     
    14971497
    14981498        if(lpBytesReturned) {
    1499             *lpBytesReturned = dwDataSize; 
     1499            *lpBytesReturned = dwDataSize;
    15001500        }
    15011501
     
    16331633    case IOCTL_SCSI_GET_CAPABILITIES:
    16341634    {
    1635         PIO_SCSI_CAPABILITIES pPacket = (PIO_SCSI_CAPABILITIES)lpOutBuffer; 
     1635        PIO_SCSI_CAPABILITIES pPacket = (PIO_SCSI_CAPABILITIES)lpOutBuffer;
    16361636
    16371637        if(nOutBufferSize < sizeof(IO_SCSI_CAPABILITIES) ||
     
    16771677            return FALSE;
    16781678        }
    1679        
     1679
    16801680        if(!drvInfo || drvInfo->fCDIoSupported == FALSE) {
    16811681            dprintf(("os2cdrom.dmd CD interface not supported!!"));
     
    18421842        if((nNumberOfBytesToRead+offset) & 0xfff)
    18431843            nrpages++;
    1844    
     1844
    18451845        map->commitRange((ULONG)lpBuffer, offset & ~0xfff, TRUE, nrpages);
    18461846        map->Release();
     
    21062106        if((nNumberOfBytesToWrite+offset) & 0xfff)
    21072107            nrpages++;
    2108    
     2108
    21092109        map->commitRange((ULONG)lpBuffer, offset & ~0xfff, TRUE, nrpages);
    21102110        map->Release();
     
    22022202
    22032203    dprintf2(("KERNEL32: HMDeviceDiskClass::GetFileSize %s(%08xh,%08xh)\n",
    2204               lpHMDeviceName, pHMHandleData, lpdwFileSizeHigh)); 
     2204              lpHMDeviceName, pHMHandleData, lpdwFileSizeHigh));
    22052205
    22062206    //If we didn't get an OS/2 handle for the disk before, get one now
  • trunk/src/kernel32/hmhandle.h

    r21302 r21916  
    3434
    3535
    36 
     36#ifdef __cplusplus
     37extern "C" {
     38#endif
    3739
    3840PHMHANDLE     HMHandleQueryPtr(HANDLE hHandle);
     
    4042PHMHANDLEDATA HMQueryHandleData(HANDLE handle);
    4143
     44#ifdef __cplusplus
     45} // extern "C"
     46#endif
     47
    4248
    4349#endif
  • trunk/src/kernel32/hmparport.cpp

    r8404 r21916  
    6060
    6161#define MAX_PARALLEL_PORTS_CONFIGURATION 3
    62 static PARALLELPORTCONFIGURATION arrParallelPorts[MAX_PARALLEL_PORTS_CONFIGURATION] = 
     62static PARALLELPORTCONFIGURATION arrParallelPorts[MAX_PARALLEL_PORTS_CONFIGURATION] =
    6363{
    6464  {1, 0x378, 8, 0x778, 3},
     
    7171{
    7272  ULONG ulMagic;
    73  
     73
    7474  // Win32 Device Control Block
    7575  COMMCONFIG   CommCfg;
    76  
     76
    7777  // hardware configuration block
    7878  PPARALLELPORTCONFIGURATION pHardwareConfiguration;
     
    8383static VOID *CreateDevData()
    8484{
    85    HFILE  hfFileHandle = 0L;   
    86    UCHAR   uchParms[2] = {0, RM_COMMAND_PHYS}; 
    87    ULONG   ulParmLen = 0; 
     85   HFILE  hfFileHandle = 0L;
     86   UCHAR   uchParms[2] = {0, RM_COMMAND_PHYS};
     87   ULONG   ulParmLen = 0;
    8888   UCHAR   uchDataArea[MAX_ENUM_SIZE] = {0};
    89    UCHAR   uchDataArea2[MAX_RM_NODE_SIZE] = {0}; 
    90    ULONG   ulDataLen = 0;           
     89   UCHAR   uchDataArea2[MAX_RM_NODE_SIZE] = {0};
     90   ULONG   ulDataLen = 0;
    9191   int rc,portCount = 0;
    92  
     92
    9393   PRM_ENUMNODES_DATA enumData;
    9494   PNODEENTRY pNode;
     
    105105  }
    106106  else
    107   { 
     107  {
    108108            dprintf(("HMDeviceParPortClass: Succesfully opened Resource Manager"));
    109109
     
    114114                    CAT_RM,FUNC_RM_ENUM_NODES, uchParms, sizeof(uchParms),
    115115                    &ulParmLen,
    116                     uchDataArea,         
    117                     sizeof(uchDataArea), 
    118                     &ulDataLen);         
    119                                        
     116                    uchDataArea,
     117                    sizeof(uchDataArea),
     118                    &ulDataLen);
     119
    120120            if (rc)
    121121            {
    122                   dprintf(("HMDeviceParPortClass: Failed to get resource list (IOCTL)"));     
     122                  dprintf(("HMDeviceParPortClass: Failed to get resource list (IOCTL)"));
    123123            goto resourceLoopEnd;
    124124            }
    125125
    126126            enumData = (PRM_ENUMNODES_DATA)uchDataArea;
    127  
     127
    128128            inputData.RMHandle = enumData->NodeEntry[0].RMHandle;
    129129            inputData.Linaddr = (ULONG)&uchDataArea2[0];
    130          
     130
    131131        for (int i=0;i<enumData->NumEntries;i++)
    132132        {
    133133            ulParmLen = sizeof(inputData);                        /* Length of input parameters */
    134134            ulDataLen = sizeof(uchDataArea2);                      /* Length of data  */
    135        
     135
    136136            rc = OSLibDosDevIOCtl(hfFileHandle,           /* Handle to device */
    137137                   CAT_RM,FUNC_RM_GET_NODEINFO,
     
    146146            if (rc)
    147147            {
    148                 dprintf(("HMDeviceParPortClass: Failed to get resource node (IOCTL)"));     
    149                 break; 
     148                dprintf(("HMDeviceParPortClass: Failed to get resource node (IOCTL)"));
     149                break;
    150150            }
    151151            inputData.RMHandle = enumData->NodeEntry[i].RMHandle;
     
    163163                // @@PF Hack, but what to do no ECP info from Resource Manager!
    164164                    if (arrParallelPorts[portCount].ulPortBase == 0x378)
    165                 {       
     165                {
    166166                    arrParallelPorts[portCount].ulEcpPortBase = 0x778;
    167167                    arrParallelPorts[portCount].ulEcpPortSpan = 3;
    168168                }
    169                     else       
     169                    else
    170170                    if (arrParallelPorts[portCount].ulPortBase == 0x278)
    171                 {       
     171                {
    172172                    arrParallelPorts[portCount].ulEcpPortBase = 0x678;
    173173                    arrParallelPorts[portCount].ulEcpPortSpan = 3;
     
    178178                arrParallelPorts[portCount].ulEcpPortSpan = 0;
    179179                dprintf(("HMDeviceParPortClass: Found and registered LPT%d with Base I/O: 0x%x",portCount,arrParallelPorts[portCount].ulPortBase));
    180                 portCount ++ ;   
     180                portCount ++ ;
    181181            }
    182182        }
    183183    }
    184184resourceLoopEnd:
    185     OSLibDosClose(hfFileHandle); 
     185    OSLibDosClose(hfFileHandle);
    186186
    187187    pData = new HMDEVPARPORTDATA();
     
    194194        pData->CommCfg.dwProviderSubType = PST_PARALLELPORT;
    195195    }
    196    
     196
    197197    return pData;
    198198}
    199199//******************************************************************************
    200200//******************************************************************************
    201 HMDeviceParPortClass::HMDeviceParPortClass(LPCSTR lpDeviceName) : 
     201HMDeviceParPortClass::HMDeviceParPortClass(LPCSTR lpDeviceName) :
    202202  HMDeviceHandler(lpDeviceName)
    203203{
    204204  dprintf(("HMDeviceParPortClass::HMDevParPortClass(%s)\n",
    205205           lpDeviceName));
    206  
     206
    207207#ifndef DEVINFO_PRINTER
    208208#define DEVINFO_PRINTER         0
    209209#endif
    210  
     210
    211211  // first, we determine the number of parallel port devices available
    212  
     212
    213213  // PH 2001-12-04 Note:
    214214  // This call will not return any information about redirected LPT ports.
     
    223223  if (0 == bNumberOfParallelPorts)
    224224    return;
    225  
     225
    226226  VOID *pData;
    227227  dprintf(("HMDeviceParPortClass: Registering LPTs with Handle Manager\n"));
    228  
     228
    229229  pData = CreateDevData();
    230230  if(pData!= NULL)
    231231    HMDeviceRegisterEx("LPT1", this, pData);
    232  
     232
    233233  // add symbolic links to the "real name" of the device
    234234  if (bNumberOfParallelPorts > 0)
     
    246246    free(pszLPT);
    247247    free(pszLPT2);
    248    
     248
    249249    // add "PRN" device
    250250    HandleNamesAddSymbolicLink("PRN",        "LPT1");
     
    272272  if (bNumberOfParallelPorts == 0)
    273273    return FALSE;
    274  
     274
    275275  // can be both, "LPT1" and "LPT1:"
    276276  if(namelength > 5)
     
    283283  if(namelength == 5 && lpDeviceName[4] != ':')
    284284    return FALSE;
    285  
     285
    286286  // can support up tp LPT9
    287287  if ( (lpDeviceName[3] >= '1') &&
     
    305305           lpSecurityAttributes,
    306306           pHMHandleDataTemplate));
    307  
     307
    308308  char lptname[6];
    309309
    310310  dprintf(("HMDeviceParPortClass: Parallel port %s open request\n", lpFileName));
    311  
     311
    312312  // Don't accept any name if no parallel ports have been detected
    313313  if (bNumberOfParallelPorts == 0)
     
    315315    return ERROR_DEV_NOT_EXIST;
    316316  }
    317  
     317
    318318  strcpy(lptname, lpFileName);
    319319  lptname[4] = 0;   //get rid of : (if present) (eg LPT1:)
     
    326326                                          OSLIB_ACCESS_SHAREDENYWRITE);
    327327  SetErrorMode(oldmode);
    328  
     328
    329329  // check if handle could be opened properly
    330330  if (0 == pHMHandleData->hHMHandle)
     
    337337    APIRET rc;
    338338    pHMHandleData->lpHandlerData = new HMDEVPARPORTDATA();
    339    
     339
    340340    // Init The handle instance with the default default device config
    341341    memcpy( pHMHandleData->lpHandlerData,
    342342            pHMHandleData->lpDeviceData,
    343343            sizeof(HMDEVPARPORTDATA));
    344    
     344
    345345    // determine which port was opened
    346346    ULONG ulPortNo = lptname[3] - '1';
    347    
     347
    348348    // safety check (device no 0..8 -> LPT1..9)
    349349    if (ulPortNo > MAX_PARALLEL_PORTS_CONFIGURATION)
     
    352352      return ERROR_DEV_NOT_EXIST;
    353353    }
    354    
     354
    355355    // and save the hardware information
    356356    PHMDEVPARPORTDATA pPPD = (PHMDEVPARPORTDATA)pHMHandleData->lpHandlerData;
    357357    pPPD->pHardwareConfiguration = &arrParallelPorts[ulPortNo];
    358  
     358
    359359    return NO_ERROR;
    360360  }
     
    387387  dprintf(("HMDeviceParPortClass: Parallel port close request(%08xh)\n",
    388388           pHMHandleData));
    389  
    390   delete pHMHandleData->lpHandlerData;
     389
     390  delete (PHMDEVPARPORTDATA)pHMHandleData->lpHandlerData;
    391391  return OSLibDosClose(pHMHandleData->hHMHandle);
    392392}
     
    511511//******************************************************************************
    512512//******************************************************************************
    513 BOOL HMDeviceParPortClass::DeviceIoControl(PHMHANDLEDATA pHMHandleData, 
     513BOOL HMDeviceParPortClass::DeviceIoControl(PHMHANDLEDATA pHMHandleData,
    514514                                           DWORD dwIoControlCode,
    515                                            LPVOID lpInBuffer, 
     515                                           LPVOID lpInBuffer,
    516516                                           DWORD nInBufferSize,
    517                                            LPVOID lpOutBuffer, 
     517                                           LPVOID lpOutBuffer,
    518518                                           DWORD nOutBufferSize,
    519                                            LPDWORD lpBytesReturned, 
     519                                           LPDWORD lpBytesReturned,
    520520                                           LPOVERLAPPED lpOverlapped)
    521521{
    522522#ifdef DEBUG
    523     char *msg = NULL;
     523    const char *msg = NULL;
    524524
    525525    switch(dwIoControlCode)
     
    528528        msg = "IOCTL_INTERNAL_GET_PARALLEL_PORT_INFO";
    529529        break;
    530      
     530
    531531      case IOCTL_INTERNAL_GET_PARALLEL_PNP_INFO:
    532532        msg = "IOCTL_INTERNAL_GET_PARALLEL_PNP_INFO";
    533533        break;
    534534    }
    535  
     535
    536536    if(msg) {
    537537        dprintf(("HMDeviceParPortClass::DeviceIoControl %s %x %d %x %d %x %x", msg, lpInBuffer, nInBufferSize,
     
    545545      {
    546546        PPARALLEL_PORT_INFORMATION pPPI = (PPARALLEL_PORT_INFORMATION)lpOutBuffer;
    547        
    548         if(nOutBufferSize < sizeof(PARALLEL_PORT_INFORMATION) || !pPPI) 
     547
     548        if(nOutBufferSize < sizeof(PARALLEL_PORT_INFORMATION) || !pPPI)
    549549        {
    550550          SetLastError(ERROR_INSUFFICIENT_BUFFER);
    551551          return FALSE;
    552552        }
    553        
     553
    554554        if(lpBytesReturned)
    555555          *lpBytesReturned = sizeof(PARALLEL_PORT_INFORMATION);
    556        
     556
    557557        // fill in the data values
    558558        PHMDEVPARPORTDATA pPPD = (PHMDEVPARPORTDATA)pHMHandleData->lpHandlerData;
    559        
     559
    560560        // @@@PH
    561561        // Specifies the bus relative base I/O address of the parallel port registers.
    562562        pPPI->OriginalController.LowPart  = pPPD->pHardwareConfiguration->ulPortBase;
    563563        pPPI->OriginalController.HighPart = 0;
    564        
     564
    565565        // Pointer to the system-mapped base I/O location of the parallel port registers.
    566566        pPPI->Controller = NULL;
    567        
     567
    568568        // Specifies the size, in bytes, of the I/O space, allocated to the parallel port.
    569569        pPPI->SpanOfController = pPPD->pHardwareConfiguration->ulPortSpan;
    570        
     570
    571571        // Pointer to a callback routine that a kernel-mode driver can use to try to allocate the parallel port.
    572572        pPPI->TryAllocatePort = NULL;
    573        
     573
    574574        // Pointer to a callback routine that a kernel-mode driver can use to free the parallel port.
    575575        pPPI->FreePort = NULL;
    576        
     576
    577577        // Pointer to a callback routine that a kernel-mode driver can use to determine the number of requests on the work queue of the parallel port.
    578578        pPPI->QueryNumWaiters = NULL;
    579        
     579
    580580        // Pointer to the device extension of parallel port.
    581581        pPPI->Context = NULL;
     
    583583        return TRUE;
    584584      }
    585      
    586      
     585
     586
    587587      case IOCTL_INTERNAL_GET_PARALLEL_PNP_INFO:
    588588      {
    589589        PPARALLEL_PNP_INFORMATION pPPI = (PPARALLEL_PNP_INFORMATION)lpOutBuffer;
    590        
     590
    591591        if(nOutBufferSize < sizeof(PARALLEL_PNP_INFORMATION) || !pPPI)
    592592        {
     
    594594          return FALSE;
    595595        }
    596        
     596
    597597        if(lpBytesReturned)
    598598          *lpBytesReturned = sizeof(PARALLEL_PNP_INFORMATION);
    599        
     599
    600600        // fill in the data values
    601601        PHMDEVPARPORTDATA pPPD = (PHMDEVPARPORTDATA)pHMHandleData->lpHandlerData;
    602        
     602
    603603        // @@@PH
    604         // Specifies the base physical address that the system-supplied 
    605         // function driver for parallel ports uses to control the ECP 
     604        // Specifies the base physical address that the system-supplied
     605        // function driver for parallel ports uses to control the ECP
    606606        // operation of the parallel port.
    607607        pPPI->OriginalEcpController.LowPart  = pPPD->pHardwareConfiguration->ulEcpPortBase;
    608608        pPPI->OriginalEcpController.HighPart = 0;
    609        
    610         // Pointer to the I/O port resource that is used to control the 
     609
     610        // Pointer to the I/O port resource that is used to control the
    611611        // port in ECP mode.
    612612        pPPI->EcpController = NULL;
    613        
     613
    614614        // Specifies the size, in bytes, of the I/O port resource.
    615615        pPPI->SpanOfEcpController = pPPD->pHardwareConfiguration->ulEcpPortSpan;
    616        
     616
    617617        // Not used.
    618618        pPPI->PortNumber = 0;
    619        
     619
    620620        // Specifies the hardware capabilities of the parallel port. The following capabilities can be set using a bitwise OR of the following constants:
    621621        pPPI->HardwareCapabilities = 0;
     
    626626        //  PPT_EPP_PRESENT
    627627        //  PT_NO_HARDWARE_PRESENT
    628        
     628
    629629        // Pointer to a callback routine that a kernel-mode driver can use to change the operating mode of the parallel port.
    630630        pPPI->TrySetChipMode = 0;
    631        
     631
    632632        // Pointer to a callback routine that a kernel-mode driver can use to clear the operating mode of the parallel port.
    633633        pPPI->ClearChipMode = 0;
    634        
     634
    635635        // Specifies the size, in words, of the hardware first in/first out (FIFO) buffer. The FIFO word size, in bits, is the value of FifoWidth.
    636636        pPPI->FifoDepth = 0;
    637        
     637
    638638        // Specifies the FIFO word size, in bits, which is the number of bits handled in parallel.
    639639        pPPI->FifoWidth = 0;
    640        
     640
    641641        // Not used.
    642642        pPPI->EppControllerPhysicalAddress.LowPart = 0;
    643643        pPPI->EppControllerPhysicalAddress.HighPart = 0;
    644        
     644
    645645        // Not used.
    646646        pPPI->SpanOfEppController = 0;
    647        
     647
    648648        // Specifies the number of daisy-chain devices currently attached to a parallel port. In Microsoftÿ Windowsÿ XP, from zero to two devices can be simultaneously connected to a
    649649        // parallel port. In Windows 2000, from zero to four devices can be simultaneously connected to a parallel port.
    650650        pPPI->Ieee1284_3DeviceCount = 0;
    651        
     651
    652652        // Pointer to a callback routine that a kernel-mode driver can use to try to select an IEEE 1284.3 device.
    653653        pPPI->TrySelectDevice = 0;
    654        
     654
    655655        // Pointer to a callback routine that a kernel-mode driver can use to deselect an IEEE 1284.3 device.
    656656        pPPI->DeselectDevice = 0;
    657        
     657
    658658        // Pointer to the device extension of a parallel port's function device object (FDO).
    659659        pPPI->Context = 0;
    660        
     660
    661661        // The current operating mode of the parallel port.
    662662        pPPI->CurrentMode = 0;
    663        
     663
    664664        // The symbolic link name of the parallel port.
    665665        pPPI->PortName = 0;
    666        
     666
    667667        return TRUE;
    668668      }
  • trunk/src/kernel32/hmthread.cpp

    r21457 r21916  
    3434#include "oslibmem.h"
    3535
    36 #include <win\thread.h>
     36#include <win/thread.h>
    3737#include "thread.h"
    3838#include "asmutil.h"
     
    6565    HANDLE       hThread = pHMHandleData->hHMHandle;
    6666
    67     if(lpIDThread == NULL) { 
     67    if(lpIDThread == NULL) {
    6868        lpIDThread = &threadid;
    6969    }
     
    124124
    125125    *lpIDThread = MAKE_THREADID(O32_GetCurrentProcessId(), *lpIDThread);
    126    
     126
    127127    TEB *teb = GetTEBFromThreadHandle(hThread);
    128128    if(teb) {
     
    134134
    135135    dprintf(("CreateThread created %08x, id %x", pHMHandleData->hHMHandle, *lpIDThread));
    136  
     136
    137137    return pHMHandleData->hHMHandle;
    138138}
     
    603603           pHMHandleData->hHMHandle,
    604604           dwTimeout));
    605  
     605
    606606  //This doesn't work very well in Open32 (object's state never signaled)
    607607  if(threadobj && threadobj->dwState == THREAD_TERMINATED) {
  • trunk/src/kernel32/initterm.h

    r9878 r21916  
    2828void CloseLogFile(); //misc.cpp
    2929
    30 extern int globLoadNr; //global data
    31 extern int loadNr;
    3230extern BOOL fVersionWarp3;
    3331extern BOOL fInit;
  • trunk/src/kernel32/kdbhookhlp.cpp

    r10382 r21916  
    3434//******************************************************************************
    3535//******************************************************************************
    36 char *WIN32API QueryCustomStdClassName()
     36const char *WIN32API QueryCustomStdClassName()
    3737{
    3838   return ODIN_WIN32_STDCLASS;
  • trunk/src/kernel32/kernel32dbg.def

    r21914 r21916  
    88DESCRIPTION 'Odin32 System DLL - Kernel32'
    99
    10 SEGMENTS
    11 
    12    _GLOBALDATA CLASS 'DATA'       SHARED LOADONCALL READWRITE
     10;
     11; Segments are done with LDFLAGS (emxomfld limitation)
     12;
     13; SEGMENTS
     14;
     15;   _GLOBALDATA CLASS 'DATA'       SHARED LOADONCALL READWRITE
     16;
    1317
    1418IMPORTS
     
    6569;  Ordinal0014 = _OS2Ordinal0014@??           @14
    6670;  Ordinal0015 = _OS2Ordinal0015@??           @15
    67    Ordinal0016 = _KERNEL32_16@12              @16
    68    Ordinal0017 = _KERNEL32_17@4               @17
     71   Ordinal0016 = "_KERNEL32_16@12"            @16
     72   Ordinal0017 = "_KERNEL32_17@4"             @17
    6973;  Ordinal0018 = _OS2Ordinal0018@??           @18
    7074;  Ordinal0019 = _OS2Ordinal0019@??           @19
     
    9195;  Ordinal0040 = _OS2Ordinal0040@??           @40
    9296;  Ordinal0041 = _OS2Ordinal0041@??           @41
    93    Ordinal0042 = _NullFunction@0              @42
     97   Ordinal0042 = "_NullFunction@0"            @42
    9498;  Ordinal0043 = _OS2Ordinal0043@??           @43
    9599;  Ordinal0044 = _OS2Ordinal0044@??           @44
    96100;  Ordinal0045 = _OS2Ordinal0045@??           @45
    97101;  Ordinal0046 = _OS2Ordinal0046@??           @46
    98    Ordinal0047 = _NullFunction@0              @47
     102   Ordinal0047 = "_NullFunction@0"            @47
    99103;  Ordinal0048 = _OS2Ordinal0048@??           @49
    100104;  Ordinal0049 = _OS2Ordinal0049@??           @49
     
    147151;  Ordinal0097 = _OS2Ordinal0097@??           @97
    148152;  Ordinal0098 = _OS2Ordinal0098@??           @98
    149                  _KERNEL32_99@4               @99 NONAME
    150                  _KERNEL32_100@12             @100 NONAME
     153                 "_KERNEL32_99@4"             @99 NONAME
     154                 "_KERNEL32_100@12"           @100 NONAME
    151155;  Ordinal0101 = _OS2Ordinal0101@??           @101
    152156
     
    157161
    158162;;Not supported; just present
    159      LoadLibrary16              = _DbgLoadLibrary16@4                @35
    160      FreeLibrary16              = _DbgFreeLibrary16@4                @36
    161      GetProcAddress16           = _DbgGetProcAddress16@8             @37
    162      ReleaseThunkLock           = _DbgReleaseThunkLock@4             @48
    163      RestoreThunkLock           = _DbgRestoreThunkLock@4             @49
    164      _ConfirmWin16Lock          = _Dbg_ConfirmWin16Lock@0            @96
    165 
    166      AddAtomA                   = _DbgAddAtomA@4                      @50
    167      AddAtomW                   = _DbgAddAtomW@4                      @102
     163     LoadLibrary16              = "_DbgLoadLibrary16@4"              @35
     164     FreeLibrary16              = "_DbgFreeLibrary16@4"              @36
     165     GetProcAddress16           = "_DbgGetProcAddress16@8"           @37
     166     ReleaseThunkLock           = "_DbgReleaseThunkLock@4"           @48
     167     RestoreThunkLock           = "_DbgRestoreThunkLock@4"           @49
     168     _ConfirmWin16Lock          = "_Dbg_ConfirmWin16Lock@0"          @96
     169
     170     AddAtomA                   = "_DbgAddAtomA@4"                    @50
     171     AddAtomW                   = "_DbgAddAtomW@4"                    @102
    168172;    AddConsoleAliasA           = _DbgAddConsoleAliasA@??             @2    ;NT
    169173;    AddConsoleAliasW           = _DbgAddConsoleAliasW@??             @3     ;NT
    170      AllocConsole               = _DbgAllocConsole@0                  @103
     174     AllocConsole               = "_DbgAllocConsole@0"                @103
    171175;    AllocLSCallback            = _DbgAllocLSCallback@??              @104  ;W95
    172176;    AllocSLCallback            = _DbgAllocSLCallback@??              @105  ;W95
    173      AreFileApisANSI            = _DbgAreFileApisANSI@0               @106
    174      BackupRead                 = _DbgBackupRead@28                   @107
    175      BackupSeek                 = _DbgBackupSeek@24                   @108
    176      BackupWrite                = _DbgBackupWrite@28                  @109
     177     AreFileApisANSI            = "_DbgAreFileApisANSI@0"             @106
     178     BackupRead                 = "_DbgBackupRead@28"                 @107
     179     BackupSeek                 = "_DbgBackupSeek@24"                 @108
     180     BackupWrite                = "_DbgBackupWrite@28"                @109
    177181;    BaseAttachCompleteThunk    = _DbgBaseAttachCompleteThunk@??      @9     ;NT
    178      Beep                       = _DbgBeep@8                          @110
    179      BeginUpdateResourceA       = _DbgBeginUpdateResourceA@8          @111
    180      BeginUpdateResourceW       = _DbgBeginUpdateResourceW@8          @112
    181      BuildCommDCBA              = _DbgBuildCommDCBA@8                 @113
    182      BuildCommDCBAndTimeoutsA   = _DbgBuildCommDCBAndTimeoutsA@12     @114
    183      BuildCommDCBAndTimeoutsW   = _DbgBuildCommDCBAndTimeoutsW@12     @115
    184      BuildCommDCBW              = _DbgBuildCommDCBW@8                 @116
    185      CallNamedPipeA             = _DbgCallNamedPipeA@28               @117
    186      CallNamedPipeW             = _DbgCallNamedPipeW@28               @118
     182     Beep                       = "_DbgBeep@8"                        @110
     183     BeginUpdateResourceA       = "_DbgBeginUpdateResourceA@8"        @111
     184     BeginUpdateResourceW       = "_DbgBeginUpdateResourceW@8"        @112
     185     BuildCommDCBA              = "_DbgBuildCommDCBA@8"               @113
     186     BuildCommDCBAndTimeoutsA   = "_DbgBuildCommDCBAndTimeoutsA@12"   @114
     187     BuildCommDCBAndTimeoutsW   = "_DbgBuildCommDCBAndTimeoutsW@12"   @115
     188     BuildCommDCBW              = "_DbgBuildCommDCBW@8"               @116
     189     CallNamedPipeA             = "_DbgCallNamedPipeA@28"             @117
     190     CallNamedPipeW             = "_DbgCallNamedPipeW@28"             @118
    187191;    Callback12                 = _DbgCallback12@??                   @119  ;W95
    188192;    Callback16                 = _DbgCallback16@??                   @120  ;W95
     
    201205;    Callback64                 = _DbgCallback64@??                   @133  ;W95
    202206;    Callback8                  = _DbgCallback8@??                    @134  ;W95
    203      CancelIo                   = _DbgCancelIo@4                      @19   ;NT
    204      CancelWaitableTimer        = _DbgCancelWaitableTimer@4           @20   ;NT
    205      ClearCommBreak             = _DbgClearCommBreak@4                @135
    206      ClearCommError             = _DbgClearCommError@12               @136
    207      CloseHandle                = _DbgCloseHandle@4                   @137
     207     CancelIo                   = "_DbgCancelIo@4"                    @19   ;NT
     208     CancelWaitableTimer        = "_DbgCancelWaitableTimer@4"         @20   ;NT
     209     ClearCommBreak             = "_DbgClearCommBreak@4"              @135
     210     ClearCommError             = "_DbgClearCommError@12"             @136
     211     CloseHandle                = "_DbgCloseHandle@4"                 @137
    208212;    CloseConsoleHandle         = _DbgCloseConsoleHandle@??           @22   ;NT
    209      CloseProfileUserMapping    = _DbgCloseProfileUserMapping@0       @138
     213     CloseProfileUserMapping    = "_DbgCloseProfileUserMapping@0"     @138
    210214;    CloseSystemHandle          = _DbgCloseSystemHandle@??            @139  ;W95
    211      CmdBatNotification         = _DbgCmdBatNotification@4            @26   ;NT
    212      CommConfigDialogA          = _DbgCommConfigDialogA@12            @140
    213      CommConfigDialogW          = _DbgCommConfigDialogW@12            @141
    214      CompareFileTime            = _DbgCompareFileTime@8               @142
    215      CompareStringA             = _DbgCompareStringA@24               @143
    216      CompareStringW             = _DbgCompareStringW@24               @144
    217      ConnectNamedPipe           = _DbgConnectNamedPipe@8              @145
     215     CmdBatNotification         = "_DbgCmdBatNotification@4"          @26   ;NT
     216     CommConfigDialogA          = "_DbgCommConfigDialogA@12"          @140
     217     CommConfigDialogW          = "_DbgCommConfigDialogW@12"          @141
     218     CompareFileTime            = "_DbgCompareFileTime@8"             @142
     219     CompareStringA             = "_DbgCompareStringA@24"             @143
     220     CompareStringW             = "_DbgCompareStringW@24"             @144
     221     ConnectNamedPipe           = "_DbgConnectNamedPipe@8"            @145
    218222;    ConsoleMenuControl         = _DbgConsoleMenuControl@??           @33   ;NT
    219      ContinueDebugEvent         = _DbgContinueDebugEvent@12           @146
    220      ConvertDefaultLocale       = _DbgConvertDefaultLocale@4          @147
    221      ConvertToGlobalHandle      = _DbgConvertToGlobalHandle@4         @148  ;W95
    222      CopyFileA                  = _DbgCopyFileA@12                    @149
    223      CopyFileExA                = _DbgCopyFileExA@24                  @38   ;NT
    224      CopyFileExW                = _DbgCopyFileExW@24                  @39   ;NT
    225      CopyFileW                  = _DbgCopyFileW@12                    @150
    226      CreateConsoleScreenBuffer  = _DbgCreateConsoleScreenBuffer@20    @151
    227      CreateDirectoryA           = _DbgCreateDirectoryA@8              @152
    228      CreateDirectoryExA         = _DbgCreateDirectoryExA@12           @153
    229      CreateDirectoryExW         = _DbgCreateDirectoryExW@12           @154
    230      CreateDirectoryW           = _DbgCreateDirectoryW@8              @155
    231      CreateEventA               = _DbgCreateEventA@16                 @156
    232      CreateEventW               = _DbgCreateEventW@16                 @157
    233      CreateFiber                = _DbgCreateFiber@12                  @1048    ;NT
    234      CreateFileA                = _DbgCreateFileA@28                  @158
    235      CreateFileW                = _DbgCreateFileW@28                  @161
    236      CreateFileMappingA         = _DbgCreateFileMappingA@24           @159
    237      CreateFileMappingW         = _DbgCreateFileMappingW@24           @160
    238      CreateIoCompletionPort     = _DbgCreateIoCompletionPort@16       @162
     223     ContinueDebugEvent         = "_DbgContinueDebugEvent@12"         @146
     224     ConvertDefaultLocale       = "_DbgConvertDefaultLocale@4"        @147
     225     ConvertToGlobalHandle      = "_DbgConvertToGlobalHandle@4"       @148  ;W95
     226     CopyFileA                  = "_DbgCopyFileA@12"                  @149
     227     CopyFileExA                = "_DbgCopyFileExA@24"                @38   ;NT
     228     CopyFileExW                = "_DbgCopyFileExW@24"                @39   ;NT
     229     CopyFileW                  = "_DbgCopyFileW@12"                  @150
     230     CreateConsoleScreenBuffer  = "_DbgCreateConsoleScreenBuffer@20"  @151
     231     CreateDirectoryA           = "_DbgCreateDirectoryA@8"            @152
     232     CreateDirectoryExA         = "_DbgCreateDirectoryExA@12"         @153
     233     CreateDirectoryExW         = "_DbgCreateDirectoryExW@12"         @154
     234     CreateDirectoryW           = "_DbgCreateDirectoryW@8"            @155
     235     CreateEventA               = "_DbgCreateEventA@16"               @156
     236     CreateEventW               = "_DbgCreateEventW@16"               @157
     237     CreateFiber                = "_DbgCreateFiber@12"                @1048    ;NT
     238     CreateFileA                = "_DbgCreateFileA@28"                @158
     239     CreateFileW                = "_DbgCreateFileW@28"                @161
     240     CreateFileMappingA         = "_DbgCreateFileMappingA@24"         @159
     241     CreateFileMappingW         = "_DbgCreateFileMappingW@24"         @160
     242     CreateIoCompletionPort     = "_DbgCreateIoCompletionPort@16"     @162
    239243;    CreateKernelThread         = _DbgCreateKernelThread@??           @163  ;W95
    240      CreateMailslotA            = _DbgCreateMailslotA@16              @164
    241      CreateMailslotW            = _DbgCreateMailslotW@16              @165
    242      CreateMutexA               = _DbgCreateMutexA@12                 @166
    243      CreateMutexW               = _DbgCreateMutexW@12                 @167
    244      CreateNamedPipeA           = _DbgCreateNamedPipeA@32             @168
    245      CreateNamedPipeW           = _DbgCreateNamedPipeW@32             @169
    246      CreatePipe                 = _DbgCreatePipe@16                   @170
    247      CreateProcessA             = _DbgCreateProcessA@40               @171
    248      CreateProcessW             = _DbgCreateProcessW@40               @172
    249      CreateRemoteThread         = _DbgCreateRemoteThread@28           @173
    250      CreateSemaphoreA           = _DbgCreateSemaphoreA@16             @174
    251      CreateSemaphoreW           = _DbgCreateSemaphoreW@16             @175
     244     CreateMailslotA            = "_DbgCreateMailslotA@16"            @164
     245     CreateMailslotW            = "_DbgCreateMailslotW@16"            @165
     246     CreateMutexA               = "_DbgCreateMutexA@12"               @166
     247     CreateMutexW               = "_DbgCreateMutexW@12"               @167
     248     CreateNamedPipeA           = "_DbgCreateNamedPipeA@32"           @168
     249     CreateNamedPipeW           = "_DbgCreateNamedPipeW@32"           @169
     250     CreatePipe                 = "_DbgCreatePipe@16"                 @170
     251     CreateProcessA             = "_DbgCreateProcessA@40"             @171
     252     CreateProcessW             = "_DbgCreateProcessW@40"             @172
     253     CreateRemoteThread         = "_DbgCreateRemoteThread@28"         @173
     254     CreateSemaphoreA           = "_DbgCreateSemaphoreA@16"           @174
     255     CreateSemaphoreW           = "_DbgCreateSemaphoreW@16"           @175
    252256;    CreateSocketHandle         = _DbgCreateSocketHandle@??           @176  ;W95
    253      CreateTapePartition        = _DbgCreateTapePartition@16          @177
    254      CreateThread               = _DbgCreateThread@24                 @178
     257     CreateTapePartition        = "_DbgCreateTapePartition@16"        @177
     258     CreateThread               = "_DbgCreateThread@24"               @178
    255259;;;;     CreateToolhelp32Snapshot   = _DbgCreateToolhelp32Snapshot@8      @179  ;W95
    256260;    CreateVirtualBuffer        = _DbgCreateVirtualBuffer@??          @68   ;NT
    257      CreateWaitableTimerA       = _DbgCreateWaitableTimerA@12         @69   ;NT
    258      CreateWaitableTimerW       = _DbgCreateWaitableTimerW@12         @70   ;NT
    259      DebugActiveProcess         = _DbgDebugActiveProcess@4            @180
    260      DebugBreak                 = _DbgDebugBreak@0                    @181
    261      DefineDosDeviceA           = _DbgDefineDosDeviceA@12             @182
    262      DefineDosDeviceW           = _DbgDefineDosDeviceW@12             @183
    263      DeleteAtom                 = _DbgDeleteAtom@4                    @184
    264      DeleteCriticalSection      = _DbgDeleteCriticalSection@4         @185
    265      DeleteFiber                = _DbgDeleteFiber@4                   @77   ;NT
    266      DeleteFileA                = _DbgDeleteFileA@4                   @186
    267      DeleteFileW                = _DbgDeleteFileW@4                   @187
    268      DeviceIoControl            = _DbgDeviceIoControl@32              @188
    269      DisableThreadLibraryCalls  = _DbgDisableThreadLibraryCalls@4     @189
    270      DisconnectNamedPipe        = _DbgDisconnectNamedPipe@4           @190
    271      DosDateTimeToFileTime      = _DbgDosDateTimeToFileTime@12        @191
     261     CreateWaitableTimerA       = "_DbgCreateWaitableTimerA@12"       @69   ;NT
     262     CreateWaitableTimerW       = "_DbgCreateWaitableTimerW@12"       @70   ;NT
     263     DebugActiveProcess         = "_DbgDebugActiveProcess@4"          @180
     264     DebugBreak                 = "_DbgDebugBreak@0"                  @181
     265     DefineDosDeviceA           = "_DbgDefineDosDeviceA@12"           @182
     266     DefineDosDeviceW           = "_DbgDefineDosDeviceW@12"           @183
     267     DeleteAtom                 = "_DbgDeleteAtom@4"                  @184
     268     DeleteCriticalSection      = "_DbgDeleteCriticalSection@4"       @185
     269     DeleteFiber                = "_DbgDeleteFiber@4"                 @77   ;NT
     270     DeleteFileA                = "_DbgDeleteFileA@4"                 @186
     271     DeleteFileW                = "_DbgDeleteFileW@4"                 @187
     272     DeviceIoControl            = "_DbgDeviceIoControl@32"            @188
     273     DisableThreadLibraryCalls  = "_DbgDisableThreadLibraryCalls@4"   @189
     274     DisconnectNamedPipe        = "_DbgDisconnectNamedPipe@4"         @190
     275     DosDateTimeToFileTime      = "_DbgDosDateTimeToFileTime@12"      @191
    272276;    DuplicateConsoleHandle     = _DbgDuplicateConsoleHandle@??             ;NT
    273      DuplicateHandle            = _DbgDuplicateHandle@28              @192
    274      EndUpdateResourceA         = _DbgEndUpdateResourceA@8            @193
    275      EndUpdateResourceW         = _DbgEndUpdateResourceW@8            @194
    276      EnterCriticalSection       = _DbgEnterCriticalSection@4          @195
    277      EnumCalendarInfoA          = _DbgEnumCalendarInfoA@16            @196
    278      EnumCalendarInfoW          = _DbgEnumCalendarInfoW@16            @197
    279      EnumDateFormatsA           = _DbgEnumDateFormatsA@12             @198
    280      EnumDateFormatsW           = _DbgEnumDateFormatsW@12             @199
    281      EnumResourceLanguagesA     = _DbgEnumResourceLanguagesA@20       @200
    282      EnumResourceLanguagesW     = _DbgEnumResourceLanguagesW@20       @201
    283      EnumResourceNamesA         = _DbgEnumResourceNamesA@16           @202
    284      EnumResourceNamesW         = _DbgEnumResourceNamesW@16           @203
    285      EnumResourceTypesA         = _DbgEnumResourceTypesA@12           @204
    286      EnumResourceTypesW         = _DbgEnumResourceTypesW@12           @205
    287      EnumSystemCodePagesA       = _DbgEnumSystemCodePagesA@8          @206
    288      EnumSystemCodePagesW       = _DbgEnumSystemCodePagesW@8          @207
    289      EnumSystemLocalesA         = _DbgEnumSystemLocalesA@8            @208
    290      EnumSystemLocalesW         = _DbgEnumSystemLocalesW@8            @209
    291      EnumTimeFormatsA           = _DbgEnumTimeFormatsA@12             @210
    292      EnumTimeFormatsW           = _DbgEnumTimeFormatsW@12             @211
    293      EraseTape                  = _DbgEraseTape@12                    @212
    294      EscapeCommFunction         = _DbgEscapeCommFunction@8            @213
    295      ExitProcess                = _DbgExitProcess@4                   @214
    296      ExitThread                 = _DbgExitThread@4                    @215
     277     DuplicateHandle            = "_DbgDuplicateHandle@28"            @192
     278     EndUpdateResourceA         = "_DbgEndUpdateResourceA@8"          @193
     279     EndUpdateResourceW         = "_DbgEndUpdateResourceW@8"          @194
     280     EnterCriticalSection       = "_DbgEnterCriticalSection@4"        @195
     281     EnumCalendarInfoA          = "_DbgEnumCalendarInfoA@16"          @196
     282     EnumCalendarInfoW          = "_DbgEnumCalendarInfoW@16"          @197
     283     EnumDateFormatsA           = "_DbgEnumDateFormatsA@12"           @198
     284     EnumDateFormatsW           = "_DbgEnumDateFormatsW@12"           @199
     285     EnumResourceLanguagesA     = "_DbgEnumResourceLanguagesA@20"     @200
     286     EnumResourceLanguagesW     = "_DbgEnumResourceLanguagesW@20"     @201
     287     EnumResourceNamesA         = "_DbgEnumResourceNamesA@16"         @202
     288     EnumResourceNamesW         = "_DbgEnumResourceNamesW@16"         @203
     289     EnumResourceTypesA         = "_DbgEnumResourceTypesA@12"         @204
     290     EnumResourceTypesW         = "_DbgEnumResourceTypesW@12"         @205
     291     EnumSystemCodePagesA       = "_DbgEnumSystemCodePagesA@8"        @206
     292     EnumSystemCodePagesW       = "_DbgEnumSystemCodePagesW@8"        @207
     293     EnumSystemLocalesA         = "_DbgEnumSystemLocalesA@8"          @208
     294     EnumSystemLocalesW         = "_DbgEnumSystemLocalesW@8"          @209
     295     EnumTimeFormatsA           = "_DbgEnumTimeFormatsA@12"           @210
     296     EnumTimeFormatsW           = "_DbgEnumTimeFormatsW@12"           @211
     297     EraseTape                  = "_DbgEraseTape@12"                  @212
     298     EscapeCommFunction         = "_DbgEscapeCommFunction@8"          @213
     299     ExitProcess                = "_DbgExitProcess@4"                 @214
     300     ExitThread                 = "_DbgExitThread@4"                  @215
    297301;    ExitVDM                    = _DbgExitVDM@??                           ;NT
    298      ExpandEnvironmentStringsA  = _DbgExpandEnvironmentStringsA@12    @216
    299      ExpandEnvironmentStringsW  = _DbgExpandEnvironmentStringsW@12    @217
     302     ExpandEnvironmentStringsA  = "_DbgExpandEnvironmentStringsA@12"  @216
     303     ExpandEnvironmentStringsW  = "_DbgExpandEnvironmentStringsW@12"  @217
    300304;    ExpungeConsoleCommandHistoryA = _DbgExpungeConsoleCommandHistoryA@??   ;NT
    301305;    ExpungeConsoleCommandHistoryW = _DbgExpungeConsoleCommandHistoryW@??   ;NT
    302306;    ExtendVirtualBuffer        = _DbgExtendVirtualBuffer@??                ;NT
    303      FT_Exit0                   = _DbgFT_Exit0@4                     @218   ;W95
    304      FT_Exit12                  = _DbgFT_Exit12@4                    @219   ;W95
    305      FT_Exit16                  = _DbgFT_Exit16@4                    @220   ;W95
    306      FT_Exit20                  = _DbgFT_Exit20@4                    @221   ;W95
    307      FT_Exit24                  = _DbgFT_Exit24@4                    @222   ;W95
    308      FT_Exit28                  = _DbgFT_Exit28@4                    @223   ;W95
    309      FT_Exit32                  = _DbgFT_Exit32@4                    @224   ;W95
    310      FT_Exit36                  = _DbgFT_Exit36@4                    @225   ;W95
    311      FT_Exit4                   = _DbgFT_Exit4@4                     @226   ;W95
    312      FT_Exit40                  = _DbgFT_Exit40@4                    @227   ;W95
    313      FT_Exit44                  = _DbgFT_Exit44@4                    @228   ;W95
    314      FT_Exit48                  = _DbgFT_Exit48@4                    @229   ;W95
    315      FT_Exit52                  = _DbgFT_Exit52@4                    @230   ;W95
    316      FT_Exit56                  = _DbgFT_Exit56@4                    @231   ;W95
    317      FT_Exit8                   = _DbgFT_Exit8@4                     @232   ;W95
    318      FT_Prolog                  = _DbgFT_Prolog@4                    @233   ;W95
    319      FT_Thunk                   = _DbgFT_Thunk@4                     @234   ;W95
    320      FatalAppExitA              = _DbgFatalAppExitA@8                @235
    321      FatalAppExitW              = _DbgFatalAppExitW@8                @236
    322      FatalExit                  = _DbgFatalExit@4                    @237
    323      FileTimeToDosDateTime      = _DbgFileTimeToDosDateTime@12       @238
    324      FileTimeToLocalFileTime    = _DbgFileTimeToLocalFileTime@8      @239
    325      FileTimeToSystemTime       = _DbgFileTimeToSystemTime@8         @240
    326      FillConsoleOutputAttribute  = _DbgFillConsoleOutputAttribute@20 @241
    327      FillConsoleOutputCharacterA  = _DbgFillConsoleOutputCharacterA@20 @242
    328      FillConsoleOutputCharacterW  = _DbgFillConsoleOutputCharacterW@20 @243
    329      FindAtomA                  = _DbgFindAtomA@4                    @244
    330      FindAtomW                  = _DbgFindAtomW@4                    @245
    331      FindClose                  = _DbgFindClose@4                    @246
    332      FindCloseChangeNotification  = _DbgFindCloseChangeNotification@4 @247
    333      FindFirstChangeNotificationA  = _DbgFindFirstChangeNotificationA@12 @248
    334      FindFirstChangeNotificationW  = _DbgFindFirstChangeNotificationW@12 @249
    335      FindFirstFileA             = _DbgFindFirstFileA@8               @250
    336      FindFirstFileExA           = _DbgFindFirstFileExA@24            @850
    337      FindFirstFileExW           = _DbgFindFirstFileExW@24            @851
    338      FindFirstFileW             = _DbgFindFirstFileW@8               @251
    339      FindNextChangeNotification = _DbgFindNextChangeNotification@4  @252
    340      FindNextFileA              = _DbgFindNextFileA@8                @253
    341      FindNextFileW              = _DbgFindNextFileW@8                @254
    342      FindResourceA              = _DbgFindResourceA@12               @255
    343      FindResourceExA            = _DbgFindResourceExA@16             @256
    344      FindResourceExW            = _DbgFindResourceExW@16             @257
    345      FindResourceW              = _DbgFindResourceW@12               @258
    346      FlushConsoleInputBuffer    = _DbgFlushConsoleInputBuffer@4      @259
    347      FlushFileBuffers           = _DbgFlushFileBuffers@4             @260
    348      FlushInstructionCache      = _DbgFlushInstructionCache@12       @261
    349      FlushViewOfFile            = _DbgFlushViewOfFile@8              @262
    350      FoldStringA                = _DbgFoldStringA@20                 @263
    351      FoldStringW                = _DbgFoldStringW@20                 @264
    352      FormatMessageA             = _DbgFormatMessageA@28              @265
    353      FormatMessageW             = _DbgFormatMessageW@28              @266
    354      FreeConsole                = _DbgFreeConsole@0                  @267
    355      FreeEnvironmentStringsA    = _DbgFreeEnvironmentStringsA@4      @268
    356      FreeEnvironmentStringsW    = _DbgFreeEnvironmentStringsW@4      @269
     307     FT_Exit0                   = "_DbgFT_Exit0@4"                   @218   ;W95
     308     FT_Exit12                  = "_DbgFT_Exit12@4"                  @219   ;W95
     309     FT_Exit16                  = "_DbgFT_Exit16@4"                  @220   ;W95
     310     FT_Exit20                  = "_DbgFT_Exit20@4"                  @221   ;W95
     311     FT_Exit24                  = "_DbgFT_Exit24@4"                  @222   ;W95
     312     FT_Exit28                  = "_DbgFT_Exit28@4"                  @223   ;W95
     313     FT_Exit32                  = "_DbgFT_Exit32@4"                  @224   ;W95
     314     FT_Exit36                  = "_DbgFT_Exit36@4"                  @225   ;W95
     315     FT_Exit4                   = "_DbgFT_Exit4@4"                   @226   ;W95
     316     FT_Exit40                  = "_DbgFT_Exit40@4"                  @227   ;W95
     317     FT_Exit44                  = "_DbgFT_Exit44@4"                  @228   ;W95
     318     FT_Exit48                  = "_DbgFT_Exit48@4"                  @229   ;W95
     319     FT_Exit52                  = "_DbgFT_Exit52@4"                  @230   ;W95
     320     FT_Exit56                  = "_DbgFT_Exit56@4"                  @231   ;W95
     321     FT_Exit8                   = "_DbgFT_Exit8@4"                   @232   ;W95
     322     FT_Prolog                  = "_DbgFT_Prolog@4"                  @233   ;W95
     323     FT_Thunk                   = "_DbgFT_Thunk@4"                   @234   ;W95
     324     FatalAppExitA              = "_DbgFatalAppExitA@8"              @235
     325     FatalAppExitW              = "_DbgFatalAppExitW@8"              @236
     326     FatalExit                  = "_DbgFatalExit@4"                  @237
     327     FileTimeToDosDateTime      = "_DbgFileTimeToDosDateTime@12"     @238
     328     FileTimeToLocalFileTime    = "_DbgFileTimeToLocalFileTime@8"    @239
     329     FileTimeToSystemTime       = "_DbgFileTimeToSystemTime@8"       @240
     330     FillConsoleOutputAttribute  = "_DbgFillConsoleOutputAttribute@20" @241
     331     FillConsoleOutputCharacterA  = "_DbgFillConsoleOutputCharacterA@20" @242
     332     FillConsoleOutputCharacterW  = "_DbgFillConsoleOutputCharacterW@20" @243
     333     FindAtomA                  = "_DbgFindAtomA@4"                  @244
     334     FindAtomW                  = "_DbgFindAtomW@4"                  @245
     335     FindClose                  = "_DbgFindClose@4"                  @246
     336     FindCloseChangeNotification  = "_DbgFindCloseChangeNotification@4" @247
     337     FindFirstChangeNotificationA  = "_DbgFindFirstChangeNotificationA@12" @248
     338     FindFirstChangeNotificationW  = "_DbgFindFirstChangeNotificationW@12" @249
     339     FindFirstFileA             = "_DbgFindFirstFileA@8"             @250
     340     FindFirstFileExA           = "_DbgFindFirstFileExA@24"          @850
     341     FindFirstFileExW           = "_DbgFindFirstFileExW@24"          @851
     342     FindFirstFileW             = "_DbgFindFirstFileW@8"             @251
     343     FindNextChangeNotification = "_DbgFindNextChangeNotification@4" @252
     344     FindNextFileA              = "_DbgFindNextFileA@8"              @253
     345     FindNextFileW              = "_DbgFindNextFileW@8"              @254
     346     FindResourceA              = "_DbgFindResourceA@12"             @255
     347     FindResourceExA            = "_DbgFindResourceExA@16"           @256
     348     FindResourceExW            = "_DbgFindResourceExW@16"           @257
     349     FindResourceW              = "_DbgFindResourceW@12"             @258
     350     FlushConsoleInputBuffer    = "_DbgFlushConsoleInputBuffer@4"    @259
     351     FlushFileBuffers           = "_DbgFlushFileBuffers@4"           @260
     352     FlushInstructionCache      = "_DbgFlushInstructionCache@12"     @261
     353     FlushViewOfFile            = "_DbgFlushViewOfFile@8"            @262
     354     FoldStringA                = "_DbgFoldStringA@20"               @263
     355     FoldStringW                = "_DbgFoldStringW@20"               @264
     356     FormatMessageA             = "_DbgFormatMessageA@28"            @265
     357     FormatMessageW             = "_DbgFormatMessageW@28"            @266
     358     FreeConsole                = "_DbgFreeConsole@0"                @267
     359     FreeEnvironmentStringsA    = "_DbgFreeEnvironmentStringsA@4"    @268
     360     FreeEnvironmentStringsW    = "_DbgFreeEnvironmentStringsW@4"    @269
    357361;    FreeLSCallback             = _DbgFreeLSCallback@??              @270   ;W95
    358      FreeLibrary                = _DbgFreeLibrary@4                  @271
    359      FreeLibraryAndExitThread   = _DbgFreeLibraryAndExitThread@8    @272
    360      FreeResource               = _DbgFreeResource@4                 @273
     362     FreeLibrary                = "_DbgFreeLibrary@4"                @271
     363     FreeLibraryAndExitThread   = "_DbgFreeLibraryAndExitThread@8"  @272
     364     FreeResource               = "_DbgFreeResource@4"               @273
    361365;    FreeSLCallback             = _DbgFreeSLCallback@??              @274   ;W95
    362366;    FreeVirtualBuffer          = _DbgFreeVirtualBuffer@??                  ;NT
    363      GenerateConsoleCtrlEvent   = _DbgGenerateConsoleCtrlEvent@8     @275
    364      GetACP                     = _DbgGetACP@0                       @276
    365      GetAtomNameA               = _DbgGetAtomNameA@12                @277
    366      GetAtomNameW               = _DbgGetAtomNameW@12                @278
    367      GetBinaryType              = _DbgGetBinaryTypeA@8               @279
    368      GetBinaryTypeA             = _DbgGetBinaryTypeA@8               @280
    369      GetBinaryTypeW             = _DbgGetBinaryTypeW@8               @281
    370      GetCPInfo                  = _DbgGetCPInfo@8                    @282
    371      GetCommConfig              = _DbgGetCommConfig@12               @283
    372      GetCommMask                = _DbgGetCommMask@8                  @284
    373      GetCommModemStatus         = _DbgGetCommModemStatus@8           @285
    374      GetCommProperties          = _DbgGetCommProperties@8            @286
    375      GetCommState               = _DbgGetCommState@8                 @287
    376      GetCommTimeouts            = _DbgGetCommTimeouts@8              @288
    377      GetCommandLineA            = _DbgGetCommandLineA@0              @289
    378      GetCommandLineW            = _DbgGetCommandLineW@0              @290
    379      GetCompressedFileSizeA     = _DbgGetCompressedFileSizeA@8       @291
    380      GetCompressedFileSizeW     = _DbgGetCompressedFileSizeW@8       @292
    381      GetComputerNameA           = _DbgGetComputerNameA@8             @293
    382      GetComputerNameW           = _DbgGetComputerNameW@8             @294
     367     GenerateConsoleCtrlEvent   = "_DbgGenerateConsoleCtrlEvent@8"   @275
     368     GetACP                     = "_DbgGetACP@0"                     @276
     369     GetAtomNameA               = "_DbgGetAtomNameA@12"              @277
     370     GetAtomNameW               = "_DbgGetAtomNameW@12"              @278
     371     GetBinaryType              = "_DbgGetBinaryTypeA@8"             @279
     372     GetBinaryTypeA             = "_DbgGetBinaryTypeA@8"             @280
     373     GetBinaryTypeW             = "_DbgGetBinaryTypeW@8"             @281
     374     GetCPInfo                  = "_DbgGetCPInfo@8"                  @282
     375     GetCommConfig              = "_DbgGetCommConfig@12"             @283
     376     GetCommMask                = "_DbgGetCommMask@8"                @284
     377     GetCommModemStatus         = "_DbgGetCommModemStatus@8"         @285
     378     GetCommProperties          = "_DbgGetCommProperties@8"          @286
     379     GetCommState               = "_DbgGetCommState@8"               @287
     380     GetCommTimeouts            = "_DbgGetCommTimeouts@8"            @288
     381     GetCommandLineA            = "_DbgGetCommandLineA@0"            @289
     382     GetCommandLineW            = "_DbgGetCommandLineW@0"            @290
     383     GetCompressedFileSizeA     = "_DbgGetCompressedFileSizeA@8"     @291
     384     GetCompressedFileSizeW     = "_DbgGetCompressedFileSizeW@8"     @292
     385     GetComputerNameA           = "_DbgGetComputerNameA@8"           @293
     386     GetComputerNameW           = "_DbgGetComputerNameW@8"           @294
    383387;    GetConsoleAliasA           = _DbgGetConsoleAliasA@??                   ;NT
    384388;    GetConsoleAliasExesA       = _DbgGetConsoleAliasExesA@??               ;NT
     
    391395;    GetConsoleAliasesLengthW   = _DbgGetConsoleAliasesLengthW@??           ;NT
    392396;    GetConsoleAliasesW         = _DbgGetConsoleAliasesW@??                 ;NT
    393      GetConsoleCP               = _DbgGetConsoleCP@0                 @295
     397     GetConsoleCP               = "_DbgGetConsoleCP@0"               @295
    394398;    GetConsoleCommandHistoryA       = _DbgGetConsoleCommandHistoryA@??     ;NT
    395399;    GetConsoleCommandHistoryLengthA = _DbgGetConsoleCommandHistoryLengthA@?? ;NT
    396400;    GetConsoleCommandHistoryLengthW = _DbgGetConsoleCommandHistoryLengthW@?? ;NT
    397401;    GetConsoleCommandHistoryW       = _DbgGetConsoleCommandHistoryW@??     ;NT
    398      GetConsoleCursorInfo       = _DbgGetConsoleCursorInfo@8         @296
     402     GetConsoleCursorInfo       = "_DbgGetConsoleCursorInfo@8"       @296
    399403;    GetConsoleDisplayMode         = _DbgGetConsoleDisplayMode@??           ;NT
    400404;    GetConsoleFontInfo            = _DbgGetConsoleFontInfo@??              ;NT
     
    406410;    GetConsoleKeyboardLayoutNameA = _DbgGetConsoleKeyboardLayoutNameA@??   ;NT
    407411;    GetConsoleKeyboardLayoutNameW = _DbgGetConsoleKeyboardLayoutNameW@??   ;NT
    408      GetConsoleMode             = _DbgGetConsoleMode@8           @297
    409      GetConsoleOutputCP         = _DbgGetConsoleOutputCP@0       @298
    410      GetConsoleScreenBufferInfo  = _DbgGetConsoleScreenBufferInfo@8 @299
    411      GetConsoleTitleA           = _DbgGetConsoleTitleA@8         @300
    412      GetConsoleTitleW           = _DbgGetConsoleTitleW@8         @301
    413      GetCurrencyFormatA         = _DbgGetCurrencyFormatA@24      @302
    414      GetCurrencyFormatW         = _DbgGetCurrencyFormatW@24      @303
     412     GetConsoleMode             = "_DbgGetConsoleMode@8"         @297
     413     GetConsoleOutputCP         = "_DbgGetConsoleOutputCP@0"     @298
     414     GetConsoleScreenBufferInfo  = "_DbgGetConsoleScreenBufferInfo@8" @299
     415     GetConsoleTitleA           = "_DbgGetConsoleTitleA@8"       @300
     416     GetConsoleTitleW           = "_DbgGetConsoleTitleW@8"       @301
     417     GetCurrencyFormatA         = "_DbgGetCurrencyFormatA@24"    @302
     418     GetCurrencyFormatW         = "_DbgGetCurrencyFormatW@24"    @303
    415419;    GetCurrentConsoleFont      = _DbgGetCurrentConsoleFont@??              ;NT
    416      GetCurrentDirectoryA       = _DbgGetCurrentDirectoryA@8     @304
    417      GetCurrentDirectoryW       = _DbgGetCurrentDirectoryW@8     @305
    418      GetCurrentProcess          = _DbgGetCurrentProcess@0        @306
    419      GetCurrentProcessId        = _DbgGetCurrentProcessId@0      @307
    420      GetCurrentThread           = _DbgGetCurrentThread@0         @308
    421      GetCurrentThreadId         = _DbgGetCurrentThreadId@0       @309
    422      GetDateFormatA             = _DbgGetDateFormatA@24          @310
    423      GetDateFormatW             = _DbgGetDateFormatW@24          @311
     420     GetCurrentDirectoryA       = "_DbgGetCurrentDirectoryA@8"   @304
     421     GetCurrentDirectoryW       = "_DbgGetCurrentDirectoryW@8"   @305
     422     GetCurrentProcess          = "_DbgGetCurrentProcess@0"      @306
     423     GetCurrentProcessId        = "_DbgGetCurrentProcessId@0"    @307
     424     GetCurrentThread           = "_DbgGetCurrentThread@0"       @308
     425     GetCurrentThreadId         = "_DbgGetCurrentThreadId@0"     @309
     426     GetDateFormatA             = "_DbgGetDateFormatA@24"        @310
     427     GetDateFormatW             = "_DbgGetDateFormatW@24"        @311
    424428;    GetDaylightFlag            = _DbgGetDaylightFlag@??         @312       ;W95
    425      GetDefaultCommConfigA      = _DbgGetDefaultCommConfigA@12  @313
    426      GetDefaultCommConfigW      = _DbgGetDefaultCommConfigW@12  @314
    427      GetDiskFreeSpaceA          = _DbgGetDiskFreeSpaceA@20       @315
    428      GetDiskFreeSpaceW          = _DbgGetDiskFreeSpaceW@20       @316
    429      GetDriveTypeA              = _DbgGetDriveTypeA@4            @317
    430      GetDriveTypeW              = _DbgGetDriveTypeW@4            @318
    431      GetEnvironmentStrings      = _DbgGetEnvironmentStringsA@0  @319
    432      GetEnvironmentStringsA     = _DbgGetEnvironmentStringsA@0  @320
    433      GetEnvironmentStringsW     = _DbgGetEnvironmentStringsW@0  @321
    434      GetEnvironmentVariableA    = _DbgGetEnvironmentVariableA@12 @322
    435      GetEnvironmentVariableW    = _DbgGetEnvironmentVariableW@12 @323
     429     GetDefaultCommConfigA      = "_DbgGetDefaultCommConfigA@12" @313
     430     GetDefaultCommConfigW      = "_DbgGetDefaultCommConfigW@12" @314
     431     GetDiskFreeSpaceA          = "_DbgGetDiskFreeSpaceA@20"     @315
     432     GetDiskFreeSpaceW          = "_DbgGetDiskFreeSpaceW@20"     @316
     433     GetDriveTypeA              = "_DbgGetDriveTypeA@4"          @317
     434     GetDriveTypeW              = "_DbgGetDriveTypeW@4"          @318
     435     GetEnvironmentStrings      = "_DbgGetEnvironmentStringsA@0" @319
     436     GetEnvironmentStringsA     = "_DbgGetEnvironmentStringsA@0" @320
     437     GetEnvironmentStringsW     = "_DbgGetEnvironmentStringsW@0" @321
     438     GetEnvironmentVariableA    = "_DbgGetEnvironmentVariableA@12" @322
     439     GetEnvironmentVariableW    = "_DbgGetEnvironmentVariableW@12" @323
    436440;    GetErrorMode               = _DbgGetErrorMode@??            @324      ;undocumented
    437      GetExitCodeProcess         = _DbgGetExitCodeProcess@8       @325
    438      GetExitCodeThread          = _DbgGetExitCodeThread@8        @326
    439      GetFileAttributesA         = _DbgGetFileAttributesA@4       @327      ;W95
    440      GetFileAttributesW         = _DbgGetFileAttributesW@4       @328      ;W95
    441      GetFileInformationByHandle  = _DbgGetFileInformationByHandle@8 @329
    442      GetFileSize                = _DbgGetFileSize@8              @330
    443      GetFileTime                = _DbgGetFileTime@16             @331
    444      GetFileType                = _DbgGetFileType@4              @332
    445      GetFullPathNameA           = _DbgGetFullPathNameA@16        @333
    446      GetFullPathNameW           = _DbgGetFullPathNameW@16        @334
     441     GetExitCodeProcess         = "_DbgGetExitCodeProcess@8"     @325
     442     GetExitCodeThread          = "_DbgGetExitCodeThread@8"      @326
     443     GetFileAttributesA         = "_DbgGetFileAttributesA@4"     @327      ;W95
     444     GetFileAttributesW         = "_DbgGetFileAttributesW@4"     @328      ;W95
     445     GetFileInformationByHandle  = "_DbgGetFileInformationByHandle@8" @329
     446     GetFileSize                = "_DbgGetFileSize@8"            @330
     447     GetFileTime                = "_DbgGetFileTime@16"           @331
     448     GetFileType                = "_DbgGetFileType@4"            @332
     449     GetFullPathNameA           = "_DbgGetFullPathNameA@16"      @333
     450     GetFullPathNameW           = "_DbgGetFullPathNameW@16"      @334
    447451;    GetHandleContext           = _DbgGetHandleContext@??        @335      ;W95
    448      GetHandleInformation       = _DbgGetHandleInformation@8     @336
     452     GetHandleInformation       = "_DbgGetHandleInformation@8"   @336
    449453;    GetLSCallbackTarget        = _DbgGetLSCallbackTarget@??     @337      ;W95
    450454;    GetLSCallbackTemplate      = _DbgGetLSCallbackTemplate@??   @338      ;W95
    451      GetLargestConsoleWindowSize  = _DbgGetLargestConsoleWindowSize@4 @339
    452      GetLastError               = _GetLastError@0             @340
    453      GetLocalTime               = _DbgGetLocalTime@4             @341
    454      GetLocaleInfoA             = _DbgGetLocaleInfoA@16          @342
    455      GetLocaleInfoW             = _DbgGetLocaleInfoW@16          @343
    456      GetLogicalDriveStringsA    = _DbgGetLogicalDriveStringsA@8  @344
    457      GetLogicalDriveStringsW    = _DbgGetLogicalDriveStringsW@8  @345
    458      GetLogicalDrives           = _DbgGetLogicalDrives@0         @346
    459      GetMailslotInfo            = _DbgGetMailslotInfo@20         @347
    460      GetModuleFileNameA         = _DbgGetModuleFileNameA@12      @348
    461      GetModuleFileNameW         = _DbgGetModuleFileNameW@12      @349
    462      GetModuleHandleA           = _DbgGetModuleHandleA@4         @350
    463      GetModuleHandleW           = _DbgGetModuleHandleW@4         @351
    464      GetNamedPipeHandleStateA   = _DbgGetNamedPipeHandleStateA@28 @352
    465      GetNamedPipeHandleStateW   = _DbgGetNamedPipeHandleStateW@28 @353
    466      GetNamedPipeInfo           = _DbgGetNamedPipeInfo@20        @354
     455     GetLargestConsoleWindowSize  = "_DbgGetLargestConsoleWindowSize@4" @339
     456     GetLastError               = "_GetLastError@0"           @340
     457     GetLocalTime               = "_DbgGetLocalTime@4"           @341
     458     GetLocaleInfoA             = "_DbgGetLocaleInfoA@16"        @342
     459     GetLocaleInfoW             = "_DbgGetLocaleInfoW@16"        @343
     460     GetLogicalDriveStringsA    = "_DbgGetLogicalDriveStringsA@8"  @344
     461     GetLogicalDriveStringsW    = "_DbgGetLogicalDriveStringsW@8"  @345
     462     GetLogicalDrives           = "_DbgGetLogicalDrives@0"       @346
     463     GetMailslotInfo            = "_DbgGetMailslotInfo@20"       @347
     464     GetModuleFileNameA         = "_DbgGetModuleFileNameA@12"    @348
     465     GetModuleFileNameW         = "_DbgGetModuleFileNameW@12"    @349
     466     GetModuleHandleA           = "_DbgGetModuleHandleA@4"       @350
     467     GetModuleHandleW           = "_DbgGetModuleHandleW@4"       @351
     468     GetNamedPipeHandleStateA   = "_DbgGetNamedPipeHandleStateA@28" @352
     469     GetNamedPipeHandleStateW   = "_DbgGetNamedPipeHandleStateW@28" @353
     470     GetNamedPipeInfo           = "_DbgGetNamedPipeInfo@20"      @354
    467471;    GetNextVDMCommand          = _DbgGetNextVDMCommand@??                 ;NT
    468      GetNumberFormatA           = _DbgGetNumberFormatA@24        @355
    469      GetNumberFormatW           = _DbgGetNumberFormatW@24        @356
     472     GetNumberFormatA           = "_DbgGetNumberFormatA@24"      @355
     473     GetNumberFormatW           = "_DbgGetNumberFormatW@24"      @356
    470474;    GetNumberOfConsoleFonts    = _DbgGetNumberOfConsoleFonts@??           ;NT
    471      GetNumberOfConsoleInputEvents  = _DbgGetNumberOfConsoleInputEvents@8 @357
    472      GetNumberOfConsoleMouseButtons  = _DbgGetNumberOfConsoleMouseButtons@4 @358
    473      GetOEMCP                   = _DbgGetOEMCP@0                 @359
    474      GetOverlappedResult        = _DbgGetOverlappedResult@16     @360
    475      GetPriorityClass           = _DbgGetPriorityClass@4         @361
    476      GetPrivateProfileIntA      = _DbgGetPrivateProfileIntA@16  @362
    477      GetPrivateProfileIntW      = _DbgGetPrivateProfileIntW@16  @363
    478      GetPrivateProfileSectionA  = _DbgGetPrivateProfileSectionA@16 @364
    479      GetPrivateProfileSectionNamesA  = _DbgGetPrivateProfileSectionNamesA@12 @365
    480      GetPrivateProfileSectionNamesW  = _DbgGetPrivateProfileSectionNamesW@12 @366
    481      GetPrivateProfileSectionW  = _DbgGetPrivateProfileSectionW@16 @367
    482      GetPrivateProfileStringA   = _DbgGetPrivateProfileStringA@24 @368
    483      GetPrivateProfileStringW   = _DbgGetPrivateProfileStringW@24 @369
    484      GetPrivateProfileStructA   = _DbgGetPrivateProfileStructA@20 @370
    485      GetPrivateProfileStructW   = _DbgGetPrivateProfileStructW@20 @371
    486      GetProcAddress             = _DbgGetProcAddress@8           @372
    487      GetProcessAffinityMask     = _DbgGetProcessAffinityMask@12  @373
    488      GetProcessDword            = _DbgGetProcessDword@8          @18
    489      GetProcessFlags            = _DbgGetProcessFlags@4          @374      ;W95
    490      GetProcessHeap             = _DbgGetProcessHeap@0           @375
    491      GetProcessHeaps            = _DbgGetProcessHeaps@8          @376
     475     GetNumberOfConsoleInputEvents  = "_DbgGetNumberOfConsoleInputEvents@8" @357
     476     GetNumberOfConsoleMouseButtons  = "_DbgGetNumberOfConsoleMouseButtons@4" @358
     477     GetOEMCP                   = "_DbgGetOEMCP@0"               @359
     478     GetOverlappedResult        = "_DbgGetOverlappedResult@16"   @360
     479     GetPriorityClass           = "_DbgGetPriorityClass@4"       @361
     480     GetPrivateProfileIntA      = "_DbgGetPrivateProfileIntA@16" @362
     481     GetPrivateProfileIntW      = "_DbgGetPrivateProfileIntW@16" @363
     482     GetPrivateProfileSectionA  = "_DbgGetPrivateProfileSectionA@16" @364
     483     GetPrivateProfileSectionNamesA  = "_DbgGetPrivateProfileSectionNamesA@12" @365
     484     GetPrivateProfileSectionNamesW  = "_DbgGetPrivateProfileSectionNamesW@12" @366
     485     GetPrivateProfileSectionW  = "_DbgGetPrivateProfileSectionW@16" @367
     486     GetPrivateProfileStringA   = "_DbgGetPrivateProfileStringA@24" @368
     487     GetPrivateProfileStringW   = "_DbgGetPrivateProfileStringW@24" @369
     488     GetPrivateProfileStructA   = "_DbgGetPrivateProfileStructA@20" @370
     489     GetPrivateProfileStructW   = "_DbgGetPrivateProfileStructW@20" @371
     490     GetProcAddress             = "_DbgGetProcAddress@8"         @372
     491     GetProcessAffinityMask     = "_DbgGetProcessAffinityMask@12"  @373
     492     GetProcessDword            = "_DbgGetProcessDword@8"        @18
     493     GetProcessFlags            = "_DbgGetProcessFlags@4"        @374      ;W95
     494     GetProcessHeap             = "_DbgGetProcessHeap@0"         @375
     495     GetProcessHeaps            = "_DbgGetProcessHeaps@8"        @376
    492496;     GetProcessPriorityBoost    = _DbgGetProcessPriorityBoost@??           ;NT
    493      GetProcessShutdownParameters  = _DbgGetProcessShutdownParameters@8 @377
    494      GetProcessTimes            = _DbgGetProcessTimes@20         @378
    495      GetProcessVersion          = _DbgGetProcessVersion@4        @379
    496      GetProcessWorkingSetSize   = _DbgGetProcessWorkingSetSize@12 @380
     497     GetProcessShutdownParameters  = "_DbgGetProcessShutdownParameters@8" @377
     498     GetProcessTimes            = "_DbgGetProcessTimes@20"       @378
     499     GetProcessVersion          = "_DbgGetProcessVersion@4"      @379
     500     GetProcessWorkingSetSize   = "_DbgGetProcessWorkingSetSize@12" @380
    497501;    GetProductName             = _DbgGetProductName@??          @381      ;W95
    498      GetProfileIntA             = _DbgGetProfileIntA@12          @382
    499      GetProfileIntW             = _DbgGetProfileIntW@12          @383
    500      GetProfileSectionA         = _DbgGetProfileSectionA@12      @384
    501      GetProfileSectionW         = _DbgGetProfileSectionW@12      @385
    502      GetProfileStringA          = _DbgGetProfileStringA@20       @386
    503      GetProfileStringW          = _DbgGetProfileStringW@20       @387
    504      GetQueuedCompletionStatus  = _DbgGetQueuedCompletionStatus@20 @388
     502     GetProfileIntA             = "_DbgGetProfileIntA@12"        @382
     503     GetProfileIntW             = "_DbgGetProfileIntW@12"        @383
     504     GetProfileSectionA         = "_DbgGetProfileSectionA@12"    @384
     505     GetProfileSectionW         = "_DbgGetProfileSectionW@12"    @385
     506     GetProfileStringA          = "_DbgGetProfileStringA@20"     @386
     507     GetProfileStringW          = "_DbgGetProfileStringW@20"     @387
     508     GetQueuedCompletionStatus  = "_DbgGetQueuedCompletionStatus@20" @388
    505509;    GetSLCallbackTarget        = _DbgGetSLCallbackTarget@??     @389      ;W95
    506510;    GetSLCallbackTemplate      = _DbgGetSLCallbackTemplate@??   @390      ;W95
    507      GetShortPathNameA          = _DbgGetShortPathNameA@12       @391
    508      GetShortPathNameW          = _DbgGetShortPathNameW@12       @392
    509      GetStartupInfoA            = _DbgGetStartupInfoA@4          @393
    510      GetStartupInfoW            = _DbgGetStartupInfoW@4          @394
    511      GetStdHandle               = _DbgGetStdHandle@4             @395
    512      GetStringTypeA             = _DbgGetStringTypeA@20          @396
    513      GetStringTypeExA           = _DbgGetStringTypeExA@20        @397
    514      GetStringTypeExW           = _DbgGetStringTypeExW@20        @398
    515      GetStringTypeW             = _DbgGetStringTypeW@16          @399
    516      GetSystemDefaultLCID       = _DbgGetSystemDefaultLCID@0     @400
    517      GetSystemDefaultLangID     = _DbgGetSystemDefaultLangID@0  @401
    518      GetSystemDirectoryA        = _DbgGetSystemDirectoryA@8      @402
    519      GetSystemDirectoryW        = _DbgGetSystemDirectoryW@8      @403
    520      GetSystemInfo              = _DbgGetSystemInfo@4            @404
    521      GetSystemPowerStatus       = _DbgGetSystemPowerStatus@4     @405
    522      GetSystemTime              = _DbgGetSystemTime@4            @406
    523      GetSystemTimeAdjustment    = _DbgGetSystemTimeAdjustment@12 @407
    524      GetSystemTimeAsFileTime    = _DbgGetSystemTimeAsFileTime@4  @408
    525      GetTapeParameters          = _DbgGetTapeParameters@16       @409
    526      GetTapePosition            = _DbgGetTapePosition@20         @410
    527      GetTapeStatus              = _DbgGetTapeStatus@4            @411
    528      GetTempFileNameA           = _DbgGetTempFileNameA@16        @412
    529      GetTempFileNameW           = _DbgGetTempFileNameW@16        @413
    530      GetTempPathA               = _DbgGetTempPathA@8             @414
    531      GetTempPathW               = _DbgGetTempPathW@8             @415
    532      GetThreadContext           = _DbgGetThreadContext@8         @416
    533      GetThreadLocale            = _DbgGetThreadLocale@0          @417
    534      GetThreadPriority          = _DbgGetThreadPriority@4        @418
     511     GetShortPathNameA          = "_DbgGetShortPathNameA@12"     @391
     512     GetShortPathNameW          = "_DbgGetShortPathNameW@12"     @392
     513     GetStartupInfoA            = "_DbgGetStartupInfoA@4"        @393
     514     GetStartupInfoW            = "_DbgGetStartupInfoW@4"        @394
     515     GetStdHandle               = "_DbgGetStdHandle@4"           @395
     516     GetStringTypeA             = "_DbgGetStringTypeA@20"        @396
     517     GetStringTypeExA           = "_DbgGetStringTypeExA@20"      @397
     518     GetStringTypeExW           = "_DbgGetStringTypeExW@20"      @398
     519     GetStringTypeW             = "_DbgGetStringTypeW@16"        @399
     520     GetSystemDefaultLCID       = "_DbgGetSystemDefaultLCID@0"   @400
     521     GetSystemDefaultLangID     = "_DbgGetSystemDefaultLangID@0" @401
     522     GetSystemDirectoryA        = "_DbgGetSystemDirectoryA@8"    @402
     523     GetSystemDirectoryW        = "_DbgGetSystemDirectoryW@8"    @403
     524     GetSystemInfo              = "_DbgGetSystemInfo@4"          @404
     525     GetSystemPowerStatus       = "_DbgGetSystemPowerStatus@4"   @405
     526     GetSystemTime              = "_DbgGetSystemTime@4"          @406
     527     GetSystemTimeAdjustment    = "_DbgGetSystemTimeAdjustment@12" @407
     528     GetSystemTimeAsFileTime    = "_DbgGetSystemTimeAsFileTime@4"  @408
     529     GetTapeParameters          = "_DbgGetTapeParameters@16"     @409
     530     GetTapePosition            = "_DbgGetTapePosition@20"       @410
     531     GetTapeStatus              = "_DbgGetTapeStatus@4"          @411
     532     GetTempFileNameA           = "_DbgGetTempFileNameA@16"      @412
     533     GetTempFileNameW           = "_DbgGetTempFileNameW@16"      @413
     534     GetTempPathA               = "_DbgGetTempPathA@8"           @414
     535     GetTempPathW               = "_DbgGetTempPathW@8"           @415
     536     GetThreadContext           = "_DbgGetThreadContext@8"       @416
     537     GetThreadLocale            = "_DbgGetThreadLocale@0"        @417
     538     GetThreadPriority          = "_DbgGetThreadPriority@4"      @418
    535539;    GetThreadPriorityBoost     = _DbgGetThreadPriorityBoost@??            ;NT
    536      GetThreadSelectorEntry     = _DbgGetThreadSelectorEntry@12  @419
    537      GetThreadTimes             = _DbgGetThreadTimes@20          @420
    538      GetTickCount               = _DbgGetTickCount@0             @421
    539      GetTimeFormatA             = _DbgGetTimeFormatA@24          @422
    540      GetTimeFormatW             = _DbgGetTimeFormatW@24          @423
    541      GetTimeZoneInformation     = _DbgGetTimeZoneInformation@4  @424
    542      GetUserDefaultLCID         = _DbgGetUserDefaultLCID@0       @425
    543      GetUserDefaultLangID       = _DbgGetUserDefaultLangID@0     @426
    544      GetVDMCurrentDirectories   = _DbgGetVDMCurrentDirectories@4           ;NT
    545      GetVersion                 = _DbgGetVersion@0               @427
    546      GetVersionExA              = _DbgGetVersionExA@4            @428
    547      GetVersionExW              = _DbgGetVersionExW@4            @429
    548      GetVolumeInformationA      = _DbgGetVolumeInformationA@32  @430
    549      GetVolumeInformationW      = _DbgGetVolumeInformationW@32  @431
    550      GetWindowsDirectoryA       = _DbgGetWindowsDirectoryA@8     @432
    551      GetWindowsDirectoryW       = _DbgGetWindowsDirectoryW@8     @433
    552      GlobalAddAtomA             = _DbgGlobalAddAtomA@4           @434
    553      GlobalAddAtomW             = _DbgGlobalAddAtomW@4           @435
    554      GlobalAlloc                = _DbgGlobalAlloc@8              @436
    555      GlobalCompact              = _DbgGlobalCompact@4            @437
    556      GlobalDeleteAtom           = _DbgGlobalDeleteAtom@4         @438
    557      GlobalFindAtomA            = _GlobalFindAtomA@4          @439
    558      GlobalFindAtomW            = _GlobalFindAtomW@4          @440
    559      GlobalFix                  = _DbgGlobalFix@4                @441
    560      GlobalFlags                = _DbgGlobalFlags@4              @442
    561      GlobalFree                 = _DbgGlobalFree@4               @443
    562      GlobalGetAtomNameA         = _DbgGlobalGetAtomNameA@12      @444
    563      GlobalGetAtomNameW         = _DbgGlobalGetAtomNameW@12      @445
    564      GlobalHandle               = _DbgGlobalHandle@4             @446
    565      GlobalLock                 = _DbgGlobalLock@4               @447
    566      GlobalMemoryStatus         = _DbgGlobalMemoryStatus@4       @448
    567      GlobalReAlloc              = _DbgGlobalReAlloc@12           @449
    568      GlobalSize                 = _DbgGlobalSize@4               @450
    569      GlobalUnWire               = _DbgGlobalUnWire@4             @451      ;obsolete
    570      GlobalUnfix                = _DbgGlobalUnfix@4              @452      ;obsolete
    571      GlobalUnlock               = _DbgGlobalUnlock@4             @453
    572      GlobalWire                 = _DbgGlobalWire@4               @454      ;obsolete
     540     GetThreadSelectorEntry     = "_DbgGetThreadSelectorEntry@12"  @419
     541     GetThreadTimes             = "_DbgGetThreadTimes@20"        @420
     542     GetTickCount               = "_DbgGetTickCount@0"           @421
     543     GetTimeFormatA             = "_DbgGetTimeFormatA@24"        @422
     544     GetTimeFormatW             = "_DbgGetTimeFormatW@24"        @423
     545     GetTimeZoneInformation     = "_DbgGetTimeZoneInformation@4" @424
     546     GetUserDefaultLCID         = "_DbgGetUserDefaultLCID@0"     @425
     547     GetUserDefaultLangID       = "_DbgGetUserDefaultLangID@0"   @426
     548;     GetVDMCurrentDirectories   = "_DbgGetVDMCurrentDirectories@4"         ;NT
     549     GetVersion                 = "_DbgGetVersion@0"             @427
     550     GetVersionExA              = "_DbgGetVersionExA@4"          @428
     551     GetVersionExW              = "_DbgGetVersionExW@4"          @429
     552     GetVolumeInformationA      = "_DbgGetVolumeInformationA@32" @430
     553     GetVolumeInformationW      = "_DbgGetVolumeInformationW@32" @431
     554     GetWindowsDirectoryA       = "_DbgGetWindowsDirectoryA@8"   @432
     555     GetWindowsDirectoryW       = "_DbgGetWindowsDirectoryW@8"   @433
     556     GlobalAddAtomA             = "_DbgGlobalAddAtomA@4"         @434
     557     GlobalAddAtomW             = "_DbgGlobalAddAtomW@4"         @435
     558     GlobalAlloc                = "_DbgGlobalAlloc@8"            @436
     559     GlobalCompact              = "_DbgGlobalCompact@4"          @437
     560     GlobalDeleteAtom           = "_DbgGlobalDeleteAtom@4"       @438
     561     GlobalFindAtomA            = "_GlobalFindAtomA@4"        @439
     562     GlobalFindAtomW            = "_GlobalFindAtomW@4"        @440
     563     GlobalFix                  = "_DbgGlobalFix@4"              @441
     564     GlobalFlags                = "_DbgGlobalFlags@4"            @442
     565     GlobalFree                 = "_DbgGlobalFree@4"             @443
     566     GlobalGetAtomNameA         = "_DbgGlobalGetAtomNameA@12"    @444
     567     GlobalGetAtomNameW         = "_DbgGlobalGetAtomNameW@12"    @445
     568     GlobalHandle               = "_DbgGlobalHandle@4"           @446
     569     GlobalLock                 = "_DbgGlobalLock@4"             @447
     570     GlobalMemoryStatus         = "_DbgGlobalMemoryStatus@4"     @448
     571     GlobalReAlloc              = "_DbgGlobalReAlloc@12"         @449
     572     GlobalSize                 = "_DbgGlobalSize@4"             @450
     573     GlobalUnWire               = "_DbgGlobalUnWire@4"           @451      ;obsolete
     574     GlobalUnfix                = "_DbgGlobalUnfix@4"            @452      ;obsolete
     575     GlobalUnlock               = "_DbgGlobalUnlock@4"           @453
     576     GlobalWire                 = "_DbgGlobalWire@4"             @454      ;obsolete
    573577;    Heap32First                = _DbgHeap32First@??             @455      ;W95
    574578;    Heap32ListFirst            = _DbgHeap32ListFirst@??         @456      ;W95
    575579;    Heap32ListNext             = _DbgHeap32ListNext@??          @457      ;W95
    576580;    Heap32Next                 = _DbgHeap32Next@??              @458      ;W95
    577      HeapAlloc                  = _DbgHeapAlloc@12               @459
    578      HeapCompact                = _DbgHeapCompact@8              @460
    579      HeapCreate                 = _DbgHeapCreate@12              @461
     581     HeapAlloc                  = "_DbgHeapAlloc@12"             @459
     582     HeapCompact                = "_DbgHeapCompact@8"            @460
     583     HeapCreate                 = "_DbgHeapCreate@12"            @461
    580584;    HeapCreateTagsW            = _DbgHeapCreateTagsW@??                   ;NT
    581      HeapDestroy                = _DbgHeapDestroy@4              @462
     585     HeapDestroy                = "_DbgHeapDestroy@4"            @462
    582586;    HeapExtend                 = _DbgHeapExtend@??                        ;NT
    583      HeapFree                   = _DbgHeapFree@12                @463
    584      HeapLock                   = _DbgHeapLock@4                 @464
    585      HeapReAlloc                = _DbgHeapReAlloc@16             @465
     587     HeapFree                   = "_DbgHeapFree@12"              @463
     588     HeapLock                   = "_DbgHeapLock@4"               @464
     589     HeapReAlloc                = "_DbgHeapReAlloc@16"           @465
    586590;    HeapQueryTagsW             = _DbgHeapQueryTagsW@??                    ;NT
    587591;    HeapSetFlags               = _DbgHeapSetFlags@??            @466
    588      "HeapSize"                 = _DbgHeapSize@12                @467      ; reserved linker word
    589      HeapUnlock                 = _DbgHeapUnlock@4               @468
     592     "HeapSize"                 = "_DbgHeapSize@12"              @467      ; reserved linker word
     593     HeapUnlock                 = "_DbgHeapUnlock@4"             @468
    590594;    HeapUsage                  = _DbgHeapUsage@??                         ;NT
    591      HeapValidate               = _DbgHeapValidate@12            @469
    592      HeapWalk                   = _DbgHeapWalk@8                 @470
    593 
    594     InitAtomTable              = _DbgInitAtomTable@4             @471
    595     InitializeCriticalSection  = _DbgInitializeCriticalSection@4 @472
    596     InitializeCriticalSectionAndSpinCount = _InitializeCriticalSectionAndSpinCount@8 @1473
    597     InterlockedCompareExchange = _InterlockedCompareExchange@12 @787        ;NT
    598     InterlockedDecrement       = _InterlockedDecrement@4     @473
    599     InterlockedExchange        = _InterlockedExchange@8      @474
    600     InterlockedExchangeAdd     = _InterlockedExchangeAdd@8      @788        ;NT
    601     InterlockedIncrement       = _InterlockedIncrement@4     @475
     595     HeapValidate               = "_DbgHeapValidate@12"          @469
     596     HeapWalk                   = "_DbgHeapWalk@8"               @470
     597
     598    InitAtomTable              = "_DbgInitAtomTable@4"           @471
     599    InitializeCriticalSection  = "_DbgInitializeCriticalSection@4" @472
     600    InitializeCriticalSectionAndSpinCount = "_InitializeCriticalSectionAndSpinCount@8" @1473
     601    InterlockedCompareExchange = "_InterlockedCompareExchange@12" @787        ;NT
     602    InterlockedDecrement       = "_InterlockedDecrement@4"   @473
     603    InterlockedExchange        = "_InterlockedExchange@8"    @474
     604    InterlockedExchangeAdd     = "_InterlockedExchangeAdd@8"    @788        ;NT
     605    InterlockedIncrement       = "_InterlockedIncrement@4"   @475
    602606;   InvalidateNLSCache         = _DbgInvalidateNLSCache@??      @476       ;W95
    603607;   InvalidateConsoleDIBits    = _DbgInvalidateConsoleDIBits@??            ;NT
    604     IsBadCodePtr               = _DbgIsBadCodePtr@4             @477
    605     IsBadHugeReadPtr           = _DbgIsBadHugeReadPtr@8         @478
    606     IsBadHugeWritePtr          = _DbgIsBadHugeWritePtr@8        @479
    607     IsBadReadPtr               = _DbgIsBadReadPtr@8             @480
    608     IsBadStringPtrA            = _DbgIsBadStringPtrA@8          @481
    609     IsBadStringPtrW            = _DbgIsBadStringPtrW@8          @482
    610     IsBadWritePtr              = _DbgIsBadWritePtr@8            @483
    611     IsDBCSLeadByte             = _DbgIsDBCSLeadByte@4           @484
    612     IsDBCSLeadByteEx           = _DbgIsDBCSLeadByteEx@8         @485
     608    IsBadCodePtr               = "_DbgIsBadCodePtr@4"           @477
     609    IsBadHugeReadPtr           = "_DbgIsBadHugeReadPtr@8"       @478
     610    IsBadHugeWritePtr          = "_DbgIsBadHugeWritePtr@8"      @479
     611    IsBadReadPtr               = "_DbgIsBadReadPtr@8"           @480
     612    IsBadStringPtrA            = "_DbgIsBadStringPtrA@8"        @481
     613    IsBadStringPtrW            = "_DbgIsBadStringPtrW@8"        @482
     614    IsBadWritePtr              = "_DbgIsBadWritePtr@8"          @483
     615    IsDBCSLeadByte             = "_DbgIsDBCSLeadByte@4"         @484
     616    IsDBCSLeadByteEx           = "_DbgIsDBCSLeadByteEx@8"       @485
    613617;   IsLSCallback               = _DbgIsLSCallback@??            @486       ;W95
    614618;   IsSLCallback               = _DbgIsSLCallback@??            @487       ;W95
    615     IsDebuggerPresent          = _DbgIsDebuggerPresent@0        @889       ;NT/98
    616     IsValidCodePage            = _DbgIsValidCodePage@4          @488
    617     IsValidLocale              = _DbgIsValidLocale@8            @489
    618     K32Thk1632Epilog           = _DbgK32Thk1632Epilog@4         @490       ;W95
    619     K32Thk1632Prolog           = _DbgK32Thk1632Prolog@4         @491       ;W95
    620     LCMapStringA               = _DbgLCMapStringA@24            @492
    621     LCMapStringW               = _DbgLCMapStringW@24            @493
    622     LeaveCriticalSection       = _DbgLeaveCriticalSection@4     @494
    623     LoadLibraryA               = _DbgLoadLibraryA@4             @495
    624     LoadLibraryExA             = _DbgLoadLibraryExA@12          @496
    625     LoadLibraryExW             = _DbgLoadLibraryExW@12          @497
    626     LoadLibraryW               = _DbgLoadLibraryW@4             @498
    627     LoadModule                 = _DbgLoadModule@8               @499
    628     LoadResource               = _DbgLoadResource@8             @500
    629     LocalAlloc                 = _DbgLocalAlloc@8               @501
    630     LocalCompact               = _DbgLocalCompact@4             @502  ;obsolete
    631     LocalFileTimeToFileTime    = _DbgLocalFileTimeToFileTime@8  @503
    632     LocalFlags                 = _DbgLocalFlags@4               @504
    633     LocalFree                  = _DbgLocalFree@4                @505
    634     LocalHandle                = _DbgLocalHandle@4              @506
    635     LocalLock                  = _DbgLocalLock@4                @507
    636     LocalReAlloc               = _DbgLocalReAlloc@12            @508
    637     LocalShrink                = _DbgLocalShrink@8              @509  ;obsolete
    638     LocalSize                  = _DbgLocalSize@4                @510
    639     LocalUnlock                = _DbgLocalUnlock@4              @511
    640     LockFile                   = _DbgLockFile@20                @512
    641     LockFileEx                 = _DbgLockFileEx@24              @513
    642     LockResource               = _DbgLockResource@4             @514
    643 
    644     MakeCriticalSectionGlobal  = _DbgMakeCriticalSectionGlobal@4 @515
     619    IsDebuggerPresent          = "_DbgIsDebuggerPresent@0"      @889       ;NT/98
     620    IsValidCodePage            = "_DbgIsValidCodePage@4"        @488
     621    IsValidLocale              = "_DbgIsValidLocale@8"          @489
     622    K32Thk1632Epilog           = "_DbgK32Thk1632Epilog@4"       @490       ;W95
     623    K32Thk1632Prolog           = "_DbgK32Thk1632Prolog@4"       @491       ;W95
     624    LCMapStringA               = "_DbgLCMapStringA@24"          @492
     625    LCMapStringW               = "_DbgLCMapStringW@24"          @493
     626    LeaveCriticalSection       = "_DbgLeaveCriticalSection@4"   @494
     627    LoadLibraryA               = "_DbgLoadLibraryA@4"           @495
     628    LoadLibraryExA             = "_DbgLoadLibraryExA@12"        @496
     629    LoadLibraryExW             = "_DbgLoadLibraryExW@12"        @497
     630    LoadLibraryW               = "_DbgLoadLibraryW@4"           @498
     631    LoadModule                 = "_DbgLoadModule@8"             @499
     632    LoadResource               = "_DbgLoadResource@8"           @500
     633    LocalAlloc                 = "_DbgLocalAlloc@8"             @501
     634    LocalCompact               = "_DbgLocalCompact@4"           @502  ;obsolete
     635    LocalFileTimeToFileTime    = "_DbgLocalFileTimeToFileTime@8"  @503
     636    LocalFlags                 = "_DbgLocalFlags@4"             @504
     637    LocalFree                  = "_DbgLocalFree@4"              @505
     638    LocalHandle                = "_DbgLocalHandle@4"            @506
     639    LocalLock                  = "_DbgLocalLock@4"              @507
     640    LocalReAlloc               = "_DbgLocalReAlloc@12"          @508
     641    LocalShrink                = "_DbgLocalShrink@8"            @509  ;obsolete
     642    LocalSize                  = "_DbgLocalSize@4"              @510
     643    LocalUnlock                = "_DbgLocalUnlock@4"            @511
     644    LockFile                   = "_DbgLockFile@20"              @512
     645    LockFileEx                 = "_DbgLockFileEx@24"            @513
     646    LockResource               = "_DbgLockResource@4"           @514
     647
     648    MakeCriticalSectionGlobal  = "_DbgMakeCriticalSectionGlobal@4" @515
    645649;   MapHInstLS                 = _DbgMapHInstLS@??              @516       ;W95
    646650;   MapHInstLS_PN              = _DbgMapHInstLS_PN@??           @517       ;W95
     
    649653;   MapHModuleLS               = _DbgMapHModuleLS@??            @520       ;W95
    650654;   MapHModuleSL               = _DbgMapHModuleSL@??            @521       ;W95
    651     MapLS                      = _DbgMapLS@4                    @522       ;W95
    652     MapSL                      = _DbgMapSL@4                    @523       ;W95
    653     MapSLFix                   = _DbgMapSLFix@4                 @524       ;W95
    654     MapViewOfFile              = _DbgMapViewOfFile@20           @525
    655     MapViewOfFileEx            = _DbgMapViewOfFileEx@24         @526
     655    MapLS                      = "_DbgMapLS@4"                  @522       ;W95
     656    MapSL                      = "_DbgMapSL@4"                  @523       ;W95
     657    MapSLFix                   = "_DbgMapSLFix@4"               @524       ;W95
     658    MapViewOfFile              = "_DbgMapViewOfFile@20"         @525
     659    MapViewOfFileEx            = "_DbgMapViewOfFileEx@24"       @526
    656660;;;;    Module32First              = _DbgModule32First@8            @527       ;W95
    657661;;;;    Module32Next               = _DbgModule32Next@8             @528       ;W95
    658     MoveFileA                  = _DbgMoveFileA@8                @529
    659     MoveFileExA                = _DbgMoveFileExA@12             @530
    660     MoveFileExW                = _DbgMoveFileExW@12             @531
    661     MoveFileW                  = _DbgMoveFileW@8                @532
    662     MulDiv                     = _DbgMulDiv@12                  @533
    663     MultiByteToWideChar        = _DbgMultiByteToWideChar@24     @534
     662    MoveFileA                  = "_DbgMoveFileA@8"              @529
     663    MoveFileExA                = "_DbgMoveFileExA@12"           @530
     664    MoveFileExW                = "_DbgMoveFileExW@12"           @531
     665    MoveFileW                  = "_DbgMoveFileW@8"              @532
     666    MulDiv                     = "_DbgMulDiv@12"                @533
     667    MultiByteToWideChar        = "_DbgMultiByteToWideChar@24"   @534
    664668;   NotifyNLSUserCache         = _DbgNotifyNLSUserCache@??      @535       ;W95
    665669;   OpenConsoleW               = _DbgOpenConsoleW@??                       ;NT
    666     OpenEventA                 = _DbgOpenEventA@12              @536
    667     OpenEventW                 = _DbgOpenEventW@12              @537
    668     OpenFile                   = _DbgOpenFile@12                @538
    669     OpenFileMappingA           = _DbgOpenFileMappingA@12        @539
    670     OpenFileMappingW           = _DbgOpenFileMappingW@12        @540
    671     OpenMutexA                 = _DbgOpenMutexA@12              @541
    672     OpenMutexW                 = _DbgOpenMutexW@12              @542
    673     OpenProcess                = _DbgOpenProcess@12             @543
    674     OpenProfileUserMapping     = _DbgOpenProfileUserMapping@0  @544
    675     OpenSemaphoreA             = _DbgOpenSemaphoreA@12          @545
    676     OpenSemaphoreW             = _DbgOpenSemaphoreW@12          @546
     670    OpenEventA                 = "_DbgOpenEventA@12"            @536
     671    OpenEventW                 = "_DbgOpenEventW@12"            @537
     672    OpenFile                   = "_DbgOpenFile@12"              @538
     673    OpenFileMappingA           = "_DbgOpenFileMappingA@12"      @539
     674    OpenFileMappingW           = "_DbgOpenFileMappingW@12"      @540
     675    OpenMutexA                 = "_DbgOpenMutexA@12"            @541
     676    OpenMutexW                 = "_DbgOpenMutexW@12"            @542
     677    OpenProcess                = "_DbgOpenProcess@12"           @543
     678    OpenProfileUserMapping     = "_DbgOpenProfileUserMapping@0" @544
     679    OpenSemaphoreA             = "_DbgOpenSemaphoreA@12"        @545
     680    OpenSemaphoreW             = "_DbgOpenSemaphoreW@12"        @546
    677681;   OpenVxDHandle              = _DbgOpenVxDHandle@??           @547       ;W95
    678682;   OpenWaitableTimerA         = _DbgOpenWaitableTimerA@??                 ;NT
    679683;   OpenWaitableTimerW         = _DbgOpenWaitableTimerW@??                 ;NT
    680     OutputDebugStringA         = _DbgOutputDebugStringA@4       @548
    681     OutputDebugStringW         = _DbgOutputDebugStringW@4       @549
    682     PeekConsoleInputA          = _DbgPeekConsoleInputA@16       @550
    683     PeekConsoleInputW          = _DbgPeekConsoleInputW@16       @551
    684     PeekNamedPipe              = _DbgPeekNamedPipe@24           @552
    685     PostQueuedCompletionStatus  = _DbgPostQueuedCompletionStatus@16 @553
    686     PrepareTape                = _DbgPrepareTape@12             @554
     684    OutputDebugStringA         = "_DbgOutputDebugStringA@4"     @548
     685    OutputDebugStringW         = "_DbgOutputDebugStringW@4"     @549
     686    PeekConsoleInputA          = "_DbgPeekConsoleInputA@16"     @550
     687    PeekConsoleInputW          = "_DbgPeekConsoleInputW@16"     @551
     688    PeekNamedPipe              = "_DbgPeekNamedPipe@24"         @552
     689    PostQueuedCompletionStatus  = "_DbgPostQueuedCompletionStatus@16" @553
     690    PrepareTape                = "_DbgPrepareTape@12"           @554
    687691;;;    Process32First             = _DbgProcess32First@8           @555       ;W95
    688692;;;    Process32Next              = _DbgProcess32Next@8            @556       ;W95
    689     PulseEvent                 = _DbgPulseEvent@4               @557
    690     PurgeComm                  = _DbgPurgeComm@8                @558
    691     QT_Thunk                   = _DbgQT_Thunk@4                    @559       ;W95
    692     QueryDosDeviceA            = _DbgQueryDosDeviceA@12         @560
    693     QueryDosDeviceW            = _DbgQueryDosDeviceW@12         @561
     693    PulseEvent                 = "_DbgPulseEvent@4"             @557
     694    PurgeComm                  = "_DbgPurgeComm@8"              @558
     695    QT_Thunk                   = "_DbgQT_Thunk@4"                  @559       ;W95
     696    QueryDosDeviceA            = "_DbgQueryDosDeviceA@12"       @560
     697    QueryDosDeviceW            = "_DbgQueryDosDeviceW@12"       @561
    694698;   QueryNumberOfEventLogRecords  = _DbgQueryNumberOfEventLogRecords@?? @562 ;W95
    695699;   QueryOldestEventLogRecord  = _DbgQueryOldestEventLogRecord@?? @563       ;W95
    696     QueryPerformanceCounter    = _DbgQueryPerformanceCounter@4  @564
    697     QueryPerformanceFrequency  = _DbgQueryPerformanceFrequency@4 @565
     700    QueryPerformanceCounter    = "_DbgQueryPerformanceCounter@4" @564
     701    QueryPerformanceFrequency  = "_DbgQueryPerformanceFrequency@4" @565
    698702;   QueryWin31IniFilesMappedToRegistry = _DbgQueryWin31IniFilesMappedToRegistry@?? ;NT
    699703;   QueueUserAPC               = _DbgQueueUserAPC@??            @566
    700     RaiseException             = _DbgRaiseException@16          @567
    701     ReadConsoleA               = _DbgReadConsoleA@20            @568
    702     ReadConsoleInputA          = _DbgReadConsoleInputA@16       @569
     704    RaiseException             = "_DbgRaiseException@16"        @567
     705    ReadConsoleA               = "_DbgReadConsoleA@20"          @568
     706    ReadConsoleInputA          = "_DbgReadConsoleInputA@16"     @569
    703707;   ReadConsoleInputExA        = _DbgReadConsoleInputExA@??                ;NT
    704708;   ReadConsoleInputExW        = _DbgReadConsoleInputExW@??                ;NT
    705     ReadConsoleInputW          = _DbgReadConsoleInputW@16       @570
    706     ReadConsoleOutputA         = _DbgReadConsoleOutputA@20      @571
    707     ReadConsoleOutputAttribute  = _DbgReadConsoleOutputAttribute@20 @572
    708     ReadConsoleOutputCharacterA  = _DbgReadConsoleOutputCharacterA@20 @573
    709     ReadConsoleOutputCharacterW  = _DbgReadConsoleOutputCharacterW@20 @574
    710     ReadConsoleOutputW         = _DbgReadConsoleOutputW@20      @575
    711     ReadConsoleW               = _DbgReadConsoleW@20            @576
     709    ReadConsoleInputW          = "_DbgReadConsoleInputW@16"     @570
     710    ReadConsoleOutputA         = "_DbgReadConsoleOutputA@20"    @571
     711    ReadConsoleOutputAttribute  = "_DbgReadConsoleOutputAttribute@20" @572
     712    ReadConsoleOutputCharacterA  = "_DbgReadConsoleOutputCharacterA@20" @573
     713    ReadConsoleOutputCharacterW  = "_DbgReadConsoleOutputCharacterW@20" @574
     714    ReadConsoleOutputW         = "_DbgReadConsoleOutputW@20"    @575
     715    ReadConsoleW               = "_DbgReadConsoleW@20"          @576
    712716;   ReadDirectoryChangesW      = _DbgReadDirectoryChangesW@??              ;NT
    713     ReadFile                   = _DbgReadFile@20                @577
    714     ReadFileEx                 = _DbgReadFileEx@20              @578
     717    ReadFile                   = "_DbgReadFile@20"              @577
     718    ReadFileEx                 = "_DbgReadFileEx@20"            @578
    715719;   ReadFileScatter            = _DbgReadFileScatter@??                    ;NT
    716     ReadProcessMemory          = _DbgReadProcessMemory@20       @579
    717     RegisterServiceProcess     = _DbgRegisterServiceProcess@8  @580       ;W95
    718    ReinitializeCriticalSection  = _DbgReinitializeCriticalSection@4 @581 ;W95
     720    ReadProcessMemory          = "_DbgReadProcessMemory@20"     @579
     721    RegisterServiceProcess     = "_DbgRegisterServiceProcess@8" @580       ;W95
     722   ReinitializeCriticalSection  = "_DbgReinitializeCriticalSection@4" @581 ;W95
    719723;   RegisterConsoleVDM         = _DbgRegisterConsoleVDM@??                 ;NT
    720724;   RegisterWaitForInputIdle   = _DbgRegisterWaitForInputIdle@??           ;NT
    721725;   RegisterWowBaseHandlers    = _DbgRegisterWowBaseHandlers@??            ;NT
    722726;   RegisterWowExec            = _DbgRegisterWowExec@??                    ;NT
    723     ReleaseMutex               = _DbgReleaseMutex@4             @582
    724     ReleaseSemaphore           = _DbgReleaseSemaphore@12        @583
    725     RemoveDirectoryA           = _DbgRemoveDirectoryA@4         @584
    726     RemoveDirectoryW           = _DbgRemoveDirectoryW@4         @585
    727     ResetEvent                 = _DbgResetEvent@4               @586
    728     ResumeThread               = _DbgResumeThread@4             @587
    729     RtlFillMemory              = _RtlFillMemory@12              @588
    730     RtlMoveMemory              = _RtlMoveMemory@12              @589
    731     RtlUnwind                  = _RtlUnwind@16                  @590
    732     RtlZeroMemory              = _RtlZeroMemory@8               @591
    733     SMapLS                     = _DbgSMapLS@4                   @592       ;W95
    734     SMapLS_IP_EBP_12           = _DbgSMapLS_IP_EBP_12@4         @593       ;W95
    735     SMapLS_IP_EBP_16           = _DbgSMapLS_IP_EBP_16@4         @594       ;W95
    736     SMapLS_IP_EBP_20           = _DbgSMapLS_IP_EBP_20@4         @595       ;W95
    737     SMapLS_IP_EBP_24           = _DbgSMapLS_IP_EBP_24@4         @596       ;W95
    738     SMapLS_IP_EBP_28           = _DbgSMapLS_IP_EBP_28@4         @597       ;W95
    739     SMapLS_IP_EBP_32           = _DbgSMapLS_IP_EBP_32@4         @598       ;W95
    740     SMapLS_IP_EBP_36           = _DbgSMapLS_IP_EBP_36@4         @599       ;W95
    741     SMapLS_IP_EBP_40           = _DbgSMapLS_IP_EBP_40@4         @600       ;W95
    742     SMapLS_IP_EBP_8            = _DbgSMapLS_IP_EBP_8@4          @601       ;W95
    743     SUnMapLS                   = _DbgSUnMapLS@4                 @602       ;W95
    744     SUnMapLS_IP_EBP_12         = _DbgSUnMapLS_IP_EBP_12@4       @603       ;W95
    745     SUnMapLS_IP_EBP_16         = _DbgSUnMapLS_IP_EBP_16@4       @604       ;W95
    746     SUnMapLS_IP_EBP_20         = _DbgSUnMapLS_IP_EBP_20@4       @605       ;W95
    747     SUnMapLS_IP_EBP_24         = _DbgSUnMapLS_IP_EBP_24@4       @606       ;W95
    748     SUnMapLS_IP_EBP_28         = _DbgSUnMapLS_IP_EBP_28@4       @607       ;W95
    749     SUnMapLS_IP_EBP_32         = _DbgSUnMapLS_IP_EBP_32@4       @608       ;W95
    750     SUnMapLS_IP_EBP_36         = _DbgSUnMapLS_IP_EBP_36@4       @609       ;W95
    751     SUnMapLS_IP_EBP_40         = _DbgSUnMapLS_IP_EBP_40@4       @610       ;W95
    752     SUnMapLS_IP_EBP_8          = _DbgSUnMapLS_IP_EBP_8@4        @611       ;W95
    753     ScrollConsoleScreenBufferA  = _DbgScrollConsoleScreenBufferA@20 @612
    754     ScrollConsoleScreenBufferW  = _DbgScrollConsoleScreenBufferW@20 @613
    755     SearchPathA                = _DbgSearchPathA@24             @614
    756     SearchPathW                = _DbgSearchPathW@24             @615
    757     SetCommBreak               = _DbgSetCommBreak@4             @616
    758     SetCommConfig              = _DbgSetCommConfig@12           @617
    759     SetCommMask                = _DbgSetCommMask@8              @618
    760     SetCommState               = _DbgSetCommState@8             @619
    761     SetCommTimeouts            = _DbgSetCommTimeouts@8          @620
    762     SetComputerNameA           = _DbgSetComputerNameA@4         @621
    763     SetComputerNameW           = _DbgSetComputerNameW@4         @622
    764     SetConsoleActiveScreenBuffer  = _DbgSetConsoleActiveScreenBuffer@4 @623
    765     SetConsoleCP               = _DbgSetConsoleCP@4             @624
     727    ReleaseMutex               = "_DbgReleaseMutex@4"           @582
     728    ReleaseSemaphore           = "_DbgReleaseSemaphore@12"      @583
     729    RemoveDirectoryA           = "_DbgRemoveDirectoryA@4"       @584
     730    RemoveDirectoryW           = "_DbgRemoveDirectoryW@4"       @585
     731    ResetEvent                 = "_DbgResetEvent@4"             @586
     732    ResumeThread               = "_DbgResumeThread@4"           @587
     733    RtlFillMemory              = "_RtlFillMemory@12"            @588
     734    RtlMoveMemory              = "_RtlMoveMemory@12"            @589
     735    RtlUnwind                  = "_RtlUnwind@16"                @590
     736    RtlZeroMemory              = "_RtlZeroMemory@8"             @591
     737    SMapLS                     = "_DbgSMapLS@4"                 @592       ;W95
     738    SMapLS_IP_EBP_12           = "_DbgSMapLS_IP_EBP_12@4"       @593       ;W95
     739    SMapLS_IP_EBP_16           = "_DbgSMapLS_IP_EBP_16@4"       @594       ;W95
     740    SMapLS_IP_EBP_20           = "_DbgSMapLS_IP_EBP_20@4"       @595       ;W95
     741    SMapLS_IP_EBP_24           = "_DbgSMapLS_IP_EBP_24@4"       @596       ;W95
     742    SMapLS_IP_EBP_28           = "_DbgSMapLS_IP_EBP_28@4"       @597       ;W95
     743    SMapLS_IP_EBP_32           = "_DbgSMapLS_IP_EBP_32@4"       @598       ;W95
     744    SMapLS_IP_EBP_36           = "_DbgSMapLS_IP_EBP_36@4"       @599       ;W95
     745    SMapLS_IP_EBP_40           = "_DbgSMapLS_IP_EBP_40@4"       @600       ;W95
     746    SMapLS_IP_EBP_8            = "_DbgSMapLS_IP_EBP_8@4"        @601       ;W95
     747    SUnMapLS                   = "_DbgSUnMapLS@4"               @602       ;W95
     748    SUnMapLS_IP_EBP_12         = "_DbgSUnMapLS_IP_EBP_12@4"     @603       ;W95
     749    SUnMapLS_IP_EBP_16         = "_DbgSUnMapLS_IP_EBP_16@4"     @604       ;W95
     750    SUnMapLS_IP_EBP_20         = "_DbgSUnMapLS_IP_EBP_20@4"     @605       ;W95
     751    SUnMapLS_IP_EBP_24         = "_DbgSUnMapLS_IP_EBP_24@4"     @606       ;W95
     752    SUnMapLS_IP_EBP_28         = "_DbgSUnMapLS_IP_EBP_28@4"     @607       ;W95
     753    SUnMapLS_IP_EBP_32         = "_DbgSUnMapLS_IP_EBP_32@4"     @608       ;W95
     754    SUnMapLS_IP_EBP_36         = "_DbgSUnMapLS_IP_EBP_36@4"     @609       ;W95
     755    SUnMapLS_IP_EBP_40         = "_DbgSUnMapLS_IP_EBP_40@4"     @610       ;W95
     756    SUnMapLS_IP_EBP_8          = "_DbgSUnMapLS_IP_EBP_8@4"      @611       ;W95
     757    ScrollConsoleScreenBufferA  = "_DbgScrollConsoleScreenBufferA@20" @612
     758    ScrollConsoleScreenBufferW  = "_DbgScrollConsoleScreenBufferW@20" @613
     759    SearchPathA                = "_DbgSearchPathA@24"           @614
     760    SearchPathW                = "_DbgSearchPathW@24"           @615
     761    SetCommBreak               = "_DbgSetCommBreak@4"           @616
     762    SetCommConfig              = "_DbgSetCommConfig@12"         @617
     763    SetCommMask                = "_DbgSetCommMask@8"            @618
     764    SetCommState               = "_DbgSetCommState@8"           @619
     765    SetCommTimeouts            = "_DbgSetCommTimeouts@8"        @620
     766    SetComputerNameA           = "_DbgSetComputerNameA@4"       @621
     767    SetComputerNameW           = "_DbgSetComputerNameW@4"       @622
     768    SetConsoleActiveScreenBuffer  = "_DbgSetConsoleActiveScreenBuffer@4" @623
     769    SetConsoleCP               = "_DbgSetConsoleCP@4"           @624
    766770;   SetConsoleCommandHistoryMode = _DbgSetConsoleCommandHistoryMode@??     ;NT
    767     SetConsoleCtrlHandler      = _DbgSetConsoleCtrlHandler@8    @625
     771    SetConsoleCtrlHandler      = "_DbgSetConsoleCtrlHandler@8"  @625
    768772;   SetConsoleCursor           = _DbgSetConsoleCursor@??                   ;NT
    769     SetConsoleCursorInfo       = _DbgSetConsoleCursorInfo@8      @626
    770     SetConsoleCursorPosition   = _DbgSetConsoleCursorPosition@8  @627
     773    SetConsoleCursorInfo       = "_DbgSetConsoleCursorInfo@8"    @626
     774    SetConsoleCursorPosition   = "_DbgSetConsoleCursorPosition@8"  @627
    771775;   SetConsoleDisplayMode        = _DbgSetConsoleDisplayMode@??            ;NT
    772776;   SetConsoleFont               = _DbgSetConsoleFont@??                   ;NT
     
    778782;   SetConsoleMaximumWindowSize  = _DbgSetConsoleMaximumWindowSize@??      ;NT
    779783;   SetConsoleMenuClose          = _DbgSetConsoleMenuClose@??              ;NT
    780     SetConsoleMode             = _DbgSetConsoleMode@8           @628
     784    SetConsoleMode             = "_DbgSetConsoleMode@8"         @628
    781785;   SetConsoleNumberOfCommandsA  = _DbgSetConsoleNumberOfCommandsA@??      ;NT
    782786;   SetConsoleNumberOfCommandsW  = _DbgSetConsoleNumberOfCommandsW@??      ;NT
    783     SetConsoleOutputCP         = _DbgSetConsoleOutputCP@4       @629
     787    SetConsoleOutputCP         = "_DbgSetConsoleOutputCP@4"     @629
    784788;   SetConsolePalette           = _DbgSetConsolePalette@??                 ;NT
    785     SetConsoleScreenBufferSize  = _DbgSetConsoleScreenBufferSize@8 @630
    786     SetConsoleTextAttribute    = _DbgSetConsoleTextAttribute@8  @631
    787     SetConsoleTitleA           = _DbgSetConsoleTitleA@4         @632
    788     SetConsoleTitleW           = _DbgSetConsoleTitleW@4         @633
    789     SetConsoleWindowInfo       = _DbgSetConsoleWindowInfo@12     @634
     789    SetConsoleScreenBufferSize  = "_DbgSetConsoleScreenBufferSize@8" @630
     790    SetConsoleTextAttribute    = "_DbgSetConsoleTextAttribute@8"  @631
     791    SetConsoleTitleA           = "_DbgSetConsoleTitleA@4"       @632
     792    SetConsoleTitleW           = "_DbgSetConsoleTitleW@4"       @633
     793    SetConsoleWindowInfo       = "_DbgSetConsoleWindowInfo@12"   @634
    790794;   SetCriticalSectionSpinCount = _DbgSetCriticalSectionSpinCount@??       ;NT
    791     SetCurrentDirectoryA       = _DbgSetCurrentDirectoryA@4     @635
    792     SetCurrentDirectoryW       = _DbgSetCurrentDirectoryW@4     @636
     795    SetCurrentDirectoryA       = "_DbgSetCurrentDirectoryA@4"   @635
     796    SetCurrentDirectoryW       = "_DbgSetCurrentDirectoryW@4"   @636
    793797;   SetDaylightFlag            = _DbgSetDaylightFlag@??         @637       ;W95
    794     SetDefaultCommConfigA      = _DbgSetDefaultCommConfigA@12  @638
    795     SetDefaultCommConfigW      = _DbgSetDefaultCommConfigW@12  @639
    796     SetEndOfFile               = _DbgSetEndOfFile@4             @640
    797     SetEnvironmentVariableA    = _DbgSetEnvironmentVariableA@8  @641
    798     SetEnvironmentVariableW    = _DbgSetEnvironmentVariableW@8  @642
    799     SetErrorMode               = _DbgSetErrorMode@4             @643
    800     SetEvent                   = _DbgSetEvent@4                 @644
    801     SetFileApisToANSI          = _DbgSetFileApisToANSI@0        @645
    802     SetFileApisToOEM           = _DbgSetFileApisToOEM@0         @646
    803     SetFileAttributesA         = _DbgSetFileAttributesA@8       @647
    804     SetFileAttributesW         = _DbgSetFileAttributesW@8       @648
    805     SetFilePointer             = _DbgSetFilePointer@16          @649
    806     SetFileTime                = _DbgSetFileTime@16             @650
     798    SetDefaultCommConfigA      = "_DbgSetDefaultCommConfigA@12" @638
     799    SetDefaultCommConfigW      = "_DbgSetDefaultCommConfigW@12" @639
     800    SetEndOfFile               = "_DbgSetEndOfFile@4"           @640
     801    SetEnvironmentVariableA    = "_DbgSetEnvironmentVariableA@8"  @641
     802    SetEnvironmentVariableW    = "_DbgSetEnvironmentVariableW@8"  @642
     803    SetErrorMode               = "_DbgSetErrorMode@4"           @643
     804    SetEvent                   = "_DbgSetEvent@4"               @644
     805    SetFileApisToANSI          = "_DbgSetFileApisToANSI@0"      @645
     806    SetFileApisToOEM           = "_DbgSetFileApisToOEM@0"       @646
     807    SetFileAttributesA         = "_DbgSetFileAttributesA@8"     @647
     808    SetFileAttributesW         = "_DbgSetFileAttributesW@8"     @648
     809    SetFilePointer             = "_DbgSetFilePointer@16"        @649
     810    SetFileTime                = "_DbgSetFileTime@16"           @650
    807811;   SetHandleContext           = _DbgSetHandleContext@??        @651       ;W95
    808     SetHandleCount             = _DbgSetHandleCount@4           @652
    809     SetHandleInformation       = _DbgSetHandleInformation@12    @653
     812    SetHandleCount             = "_DbgSetHandleCount@4"         @652
     813    SetHandleInformation       = "_DbgSetHandleInformation@12"  @653
    810814;   SetLastConsoleEventActive  = _DbgSetLastConsoleEventActive@??          ;NT
    811     SetLastError               = _SetLastError@4             @654
    812     SetLocalTime               = _DbgSetLocalTime@4             @655
    813     SetLocaleInfoA             = _DbgSetLocaleInfoA@12          @656
    814     SetLocaleInfoW             = _DbgSetLocaleInfoW@12          @657
    815     SetMailslotInfo            = _DbgSetMailslotInfo@8          @658
    816     SetNamedPipeHandleState    = _DbgSetNamedPipeHandleState@16 @659
    817     SetPriorityClass           = _DbgSetPriorityClass@8         @660
    818     SetProcessAffinityMask     = _DbgSetProcessAffinityMask@8  @862
    819     SetProcessDword            = _DbgSetProcessDword@12         @884
    820     SetProcessPriorityBoost    = _DbgSetProcessPriorityBoost@8  @863
    821     SetProcessShutdownParameters  = _DbgSetProcessShutdownParameters@8 @661
    822     SetProcessWorkingSetSize   = _DbgSetProcessWorkingSetSize@12 @662
    823     SetStdHandle               = _DbgSetStdHandle@8              @663
    824     SetSystemPowerState        = _DbgSetSystemPowerState@8       @664
    825     SetSystemTime              = _DbgSetSystemTime@4             @665
    826     SetSystemTimeAdjustment    = _DbgSetSystemTimeAdjustment@8  @666
    827     SetTapeParameters          = _DbgSetTapeParameters@12        @667
    828     SetTapePosition            = _DbgSetTapePosition@24          @668
    829     SetThreadAffinityMask      = _DbgSetThreadAffinityMask@8     @669
    830     SetThreadContext           = _DbgSetThreadContext@8          @670
     815    SetLastError               = "_SetLastError@4"           @654
     816    SetLocalTime               = "_DbgSetLocalTime@4"           @655
     817    SetLocaleInfoA             = "_DbgSetLocaleInfoA@12"        @656
     818    SetLocaleInfoW             = "_DbgSetLocaleInfoW@12"        @657
     819    SetMailslotInfo            = "_DbgSetMailslotInfo@8"        @658
     820    SetNamedPipeHandleState    = "_DbgSetNamedPipeHandleState@16" @659
     821    SetPriorityClass           = "_DbgSetPriorityClass@8"       @660
     822    SetProcessAffinityMask     = "_DbgSetProcessAffinityMask@8" @862
     823    SetProcessDword            = "_DbgSetProcessDword@12"       @884
     824    SetProcessPriorityBoost    = "_DbgSetProcessPriorityBoost@8"  @863
     825    SetProcessShutdownParameters  = "_DbgSetProcessShutdownParameters@8" @661
     826    SetProcessWorkingSetSize   = "_DbgSetProcessWorkingSetSize@12" @662
     827    SetStdHandle               = "_DbgSetStdHandle@8"            @663
     828    SetSystemPowerState        = "_DbgSetSystemPowerState@8"     @664
     829    SetSystemTime              = "_DbgSetSystemTime@4"           @665
     830    SetSystemTimeAdjustment    = "_DbgSetSystemTimeAdjustment@8" @666
     831    SetTapeParameters          = "_DbgSetTapeParameters@12"      @667
     832    SetTapePosition            = "_DbgSetTapePosition@24"        @668
     833    SetThreadAffinityMask      = "_DbgSetThreadAffinityMask@8"   @669
     834    SetThreadContext           = "_DbgSetThreadContext@8"        @670
    831835;   SetThreadIdealProcessor    = _DbgSetThreadIdealProcessor@??            ;NT
    832     SetThreadLocale            = _DbgSetThreadLocale@4         @671
    833     SetThreadPriority          = _DbgSetThreadPriority@8       @672
    834     SetThreadPriorityBoost     = _DbgSetThreadPriorityBoost@8  @789        ;NT
    835     SetTimeZoneInformation     = _DbgSetTimeZoneInformation@4  @673
    836     SetUnhandledExceptionFilter  = _DbgSetUnhandledExceptionFilter@4 @674
     836    SetThreadLocale            = "_DbgSetThreadLocale@4"       @671
     837    SetThreadPriority          = "_DbgSetThreadPriority@8"     @672
     838    SetThreadPriorityBoost     = "_DbgSetThreadPriorityBoost@8"  @789        ;NT
     839    SetTimeZoneInformation     = "_DbgSetTimeZoneInformation@4"  @673
     840    SetUnhandledExceptionFilter  = "_DbgSetUnhandledExceptionFilter@4" @674
    837841;   SetVDMCurrentDirectories   = _DbgSetVDMCurrentDirectories@??           ;NT
    838     SetVolumeLabelA            = _DbgSetVolumeLabelA@8          @675
    839     SetVolumeLabelW            = _DbgSetVolumeLabelW@8          @676
     842    SetVolumeLabelA            = "_DbgSetVolumeLabelA@8"        @675
     843    SetVolumeLabelW            = "_DbgSetVolumeLabelW@8"        @676
    840844;   SetWaitableTimer           = _DbgSetWaitableTimer@??                   ;NT
    841     SetupComm                  = _DbgSetupComm@12               @677
     845    SetupComm                  = "_DbgSetupComm@12"             @677
    842846;   ShowConsoleCursor          = _DbgShowConsoleCursor@??                  ;NT
    843847;   SignalObjectAndWait        = _DbgSignalObjectAndWait@??                ;NT
    844     SizeofResource             = _DbgSizeofResource@8           @678
    845     Sleep                      = _DbgSleep@4                    @679
    846     SleepEx                    = _DbgSleepEx@8                  @680
    847     SuspendThread              = _DbgSuspendThread@4            @681
     848    SizeofResource             = "_DbgSizeofResource@8"         @678
     849    Sleep                      = "_DbgSleep@4"                  @679
     850    SleepEx                    = "_DbgSleepEx@8"                @680
     851    SuspendThread              = "_DbgSuspendThread@4"          @681
    848852;   SwitchToFiber              = _DbgSwitchToFiber@??                      ;NT
    849853;   SwitchToThread             = _DbgSwitchToThread@??                     ;NT
    850     SystemTimeToFileTime       = _DbgSystemTimeToFileTime@8     @682
    851     SystemTimeToTzSpecificLocalTime  = _DbgSystemTimeToTzSpecificLocalTime@12 @683
    852     TerminateProcess           = _DbgTerminateProcess@8         @684
    853     TerminateThread            = _DbgTerminateThread@8          @685
     854    SystemTimeToFileTime       = "_DbgSystemTimeToFileTime@8"   @682
     855    SystemTimeToTzSpecificLocalTime  = "_DbgSystemTimeToTzSpecificLocalTime@12" @683
     856    TerminateProcess           = "_DbgTerminateProcess@8"       @684
     857    TerminateThread            = "_DbgTerminateThread@8"        @685
    854858;;;;    Thread32First              = _DbgThread32First@8            @686       ;W95
    855859;;;;    Thread32Next               = _DbgThread32Next@8             @687       ;W95
    856     ThunkConnect32             = _DbgThunkConnect32@24          @688       ;W95
    857     TlsAlloc                   = _DbgTlsAlloc@0                 @689
     860    ThunkConnect32             = "_DbgThunkConnect32@24"        @688       ;W95
     861    TlsAlloc                   = "_DbgTlsAlloc@0"               @689
    858862;   TlsAllocInternal           = _DbgTlsAllocInternal@??        @690       ;W95
    859     TlsFree                    = _DbgTlsFree@4                  @691
     863    TlsFree                    = "_DbgTlsFree@4"                @691
    860864;   TlsFreeInternal            = _DbgTlsFreeInternal@??         @692       ;W95
    861     TlsGetValue                = _DbgTlsGetValue@4              @693
    862     TlsSetValue                = _DbgTlsSetValue@8              @694
     865    TlsGetValue                = "_DbgTlsGetValue@4"            @693
     866    TlsSetValue                = "_DbgTlsSetValue@8"            @694
    863867;   Toolhelp32ReadProcessMemory  = _DbgToolhelp32ReadProcessMemory@?? @695 ;W95
    864     TransactNamedPipe          = _DbgTransactNamedPipe@28       @696
    865     TransmitCommChar           = _DbgTransmitCommChar@8         @697
     868    TransactNamedPipe          = "_DbgTransactNamedPipe@28"     @696
     869    TransmitCommChar           = "_DbgTransmitCommChar@8"       @697
    866870;   TrimVirtualBuffer          = _DbgTrimVirtualBuffer@??                  ;NT
    867     TryEnterCriticalSection    = _DbgTryEnterCriticalSection@4  @898       ;NT
     871    TryEnterCriticalSection    = "_DbgTryEnterCriticalSection@4"  @898       ;NT
    868872;   UTRegister                 = _DbgUTRegister@??              @698       ;W95
    869873;   UTUnRegister               = _DbgUTUnRegister@??            @699       ;W95
    870     UnMapLS                    = _DbgUnMapLS@4                  @700       ;W95
    871     UnMapSLFixArray            = _DbgUnMapSLFixArray@12         @701       ;W95
    872     UnhandledExceptionFilter   = _DbgUnhandledExceptionFilter@4 @702
    873     UninitializeCriticalSection  = _DbgUninitializeCriticalSection@4 @703  ;W95
    874     UnlockFile                 = _DbgUnlockFile@20              @704
    875     UnlockFileEx               = _DbgUnlockFileEx@20            @705
    876     UnmapViewOfFile            = _DbgUnmapViewOfFile@4          @706
    877     UpdateResourceA            = _DbgUpdateResourceA@24         @707
    878     UpdateResourceW            = _DbgUpdateResourceW@24         @708
     874    UnMapLS                    = "_DbgUnMapLS@4"                @700       ;W95
     875    UnMapSLFixArray            = "_DbgUnMapSLFixArray@12"       @701       ;W95
     876    UnhandledExceptionFilter   = "_DbgUnhandledExceptionFilter@4" @702
     877    UninitializeCriticalSection  = "_DbgUninitializeCriticalSection@4" @703  ;W95
     878    UnlockFile                 = "_DbgUnlockFile@20"            @704
     879    UnlockFileEx               = "_DbgUnlockFileEx@20"          @705
     880    UnmapViewOfFile            = "_DbgUnmapViewOfFile@4"        @706
     881    UpdateResourceA            = "_DbgUpdateResourceA@24"       @707
     882    UpdateResourceW            = "_DbgUpdateResourceW@24"       @708
    879883;   VDMConsoleOperation        = _DbgVDMConsoleOperation@??                ;NT
    880884;   VDMOperationStarted        = _DbgVDMOperationStarted@??                ;NT
    881     VerLanguageNameA           = _DbgVerLanguageNameA@12        @709
    882     VerLanguageNameW           = _DbgVerLanguageNameW@12        @710
     885    VerLanguageNameA           = "_DbgVerLanguageNameA@12"      @709
     886    VerLanguageNameW           = "_DbgVerLanguageNameW@12"      @710
    883887;   VerifyConsoleToHandle      = _DbgVerifyConsoleToHandle@??              ;NT
    884     VirtualAlloc               = _DbgVirtualAlloc@16            @711
     888    VirtualAlloc               = "_DbgVirtualAlloc@16"          @711
    885889;   VirtualAllocEx             = _DbgVirtualAllocEx@??                     ;NT
    886890;   VirtualBufferExceptionHandler = _DbgVirtualBufferExceptionHandler      ;NT
    887     VirtualFree                = _DbgVirtualFree@12             @712
     891    VirtualFree                = "_DbgVirtualFree@12"           @712
    888892;   VirtualFreeEx              = _DbgVirtuelFreeEx@??                      ;NT
    889     VirtualLock                = _DbgVirtualLock@8              @713
    890     VirtualProtect             = _DbgVirtualProtect@16          @714
    891     VirtualProtectEx           = _DbgVirtualProtectEx@20        @715
     893    VirtualLock                = "_DbgVirtualLock@8"            @713
     894    VirtualProtect             = "_DbgVirtualProtect@16"        @714
     895    VirtualProtectEx           = "_DbgVirtualProtectEx@20"      @715
    892896;    VirtualQuery               = _DbgVirtualQuery@12            @716
    893     VirtualQuery               = _VirtualQuery@12            @716
    894     VirtualQueryEx             = _DbgVirtualQueryEx@16          @717
    895     VirtualUnlock              = _DbgVirtualUnlock@8            @718
    896     WaitCommEvent              = _DbgWaitCommEvent@12           @719
    897     WaitForDebugEvent          = _DbgWaitForDebugEvent@8        @720
    898     WaitForMultipleObjects     = _DbgWaitForMultipleObjects@16  @721
    899     WaitForMultipleObjectsEx   = _DbgWaitForMultipleObjectsEx@20 @722
    900     WaitForSingleObject        = _DbgWaitForSingleObject@8      @723
    901     WaitForSingleObjectEx      = _DbgWaitForSingleObjectEx@12  @724
    902     WaitNamedPipeA             = _DbgWaitNamedPipeA@8           @725
    903     WaitNamedPipeW             = _DbgWaitNamedPipeW@8           @726
    904     WideCharToMultiByte        = _DbgWideCharToMultiByte@32     @727
    905     WinExec                    = _DbgWinExec@8                  @728
    906     WriteConsoleA              = _DbgWriteConsoleA@20           @729
    907     WriteConsoleInputA         = _DbgWriteConsoleInputA@16       @730
     897    VirtualQuery               = "_VirtualQuery@12"          @716
     898    VirtualQueryEx             = "_DbgVirtualQueryEx@16"        @717
     899    VirtualUnlock              = "_DbgVirtualUnlock@8"          @718
     900    WaitCommEvent              = "_DbgWaitCommEvent@12"         @719
     901    WaitForDebugEvent          = "_DbgWaitForDebugEvent@8"      @720
     902    WaitForMultipleObjects     = "_DbgWaitForMultipleObjects@16"  @721
     903    WaitForMultipleObjectsEx   = "_DbgWaitForMultipleObjectsEx@20" @722
     904    WaitForSingleObject        = "_DbgWaitForSingleObject@8"    @723
     905    WaitForSingleObjectEx      = "_DbgWaitForSingleObjectEx@12" @724
     906    WaitNamedPipeA             = "_DbgWaitNamedPipeA@8"         @725
     907    WaitNamedPipeW             = "_DbgWaitNamedPipeW@8"         @726
     908    WideCharToMultiByte        = "_DbgWideCharToMultiByte@32"   @727
     909    WinExec                    = "_DbgWinExec@8"                @728
     910    WriteConsoleA              = "_DbgWriteConsoleA@20"         @729
     911    WriteConsoleInputA         = "_DbgWriteConsoleInputA@16"     @730
    908912;   WriteConsoleInputVDMA      = _DbgWriteConsoleInputVDMA@??              ;NT
    909913;   WriteConsoleInputVDMW      = _DbgWriteConsoleInputVDMW@??              ;NT
    910     WriteConsoleInputW         = _DbgWriteConsoleInputW@16      @731
    911     WriteConsoleOutputA        = _DbgWriteConsoleOutputA@20     @732
    912     WriteConsoleOutputAttribute  = _DbgWriteConsoleOutputAttribute@20 @733
    913     WriteConsoleOutputCharacterA  = _DbgWriteConsoleOutputCharacterA@20 @734
    914     WriteConsoleOutputCharacterW  = _DbgWriteConsoleOutputCharacterW@20 @735
    915     WriteConsoleOutputW        = _DbgWriteConsoleOutputW@20     @736
    916     WriteConsoleW              = _DbgWriteConsoleW@20           @737
    917     WriteFile                  = _DbgWriteFile@20               @738
    918     WriteFileEx                = _DbgWriteFileEx@20             @739
     914    WriteConsoleInputW         = "_DbgWriteConsoleInputW@16"    @731
     915    WriteConsoleOutputA        = "_DbgWriteConsoleOutputA@20"   @732
     916    WriteConsoleOutputAttribute  = "_DbgWriteConsoleOutputAttribute@20" @733
     917    WriteConsoleOutputCharacterA  = "_DbgWriteConsoleOutputCharacterA@20" @734
     918    WriteConsoleOutputCharacterW  = "_DbgWriteConsoleOutputCharacterW@20" @735
     919    WriteConsoleOutputW        = "_DbgWriteConsoleOutputW@20"   @736
     920    WriteConsoleW              = "_DbgWriteConsoleW@20"         @737
     921    WriteFile                  = "_DbgWriteFile@20"             @738
     922    WriteFileEx                = "_DbgWriteFileEx@20"           @739
    919923;   WriteFileGather            = _DbgWriteFileGather@??                    ;NT
    920     WritePrivateProfileSectionA  = _DbgWritePrivateProfileSectionA@12 @740
    921     WritePrivateProfileSectionW  = _DbgWritePrivateProfileSectionW@12 @741
    922     WritePrivateProfileStringA  = _DbgWritePrivateProfileStringA@16 @742
    923     WritePrivateProfileStringW  = _DbgWritePrivateProfileStringW@16 @743
    924     WritePrivateProfileStructA  = _DbgWritePrivateProfileStructA@20 @744
    925     WritePrivateProfileStructW  = _DbgWritePrivateProfileStructW@20 @745
    926     WriteProcessMemory         = _DbgWriteProcessMemory@20      @746
    927     WriteProfileSectionA       = _DbgWriteProfileSectionA@8     @747
    928     WriteProfileSectionW       = _DbgWriteProfileSectionW@8     @748
    929     WriteProfileStringA        = _DbgWriteProfileStringA@12     @749
    930     WriteProfileStringW        = _DbgWriteProfileStringW@12     @750
    931     WriteTapemark              = _DbgWriteTapemark@16           @751
     924    WritePrivateProfileSectionA  = "_DbgWritePrivateProfileSectionA@12" @740
     925    WritePrivateProfileSectionW  = "_DbgWritePrivateProfileSectionW@12" @741
     926    WritePrivateProfileStringA  = "_DbgWritePrivateProfileStringA@16" @742
     927    WritePrivateProfileStringW  = "_DbgWritePrivateProfileStringW@16" @743
     928    WritePrivateProfileStructA  = "_DbgWritePrivateProfileStructA@20" @744
     929    WritePrivateProfileStructW  = "_DbgWritePrivateProfileStructW@20" @745
     930    WriteProcessMemory         = "_DbgWriteProcessMemory@20"    @746
     931    WriteProfileSectionA       = "_DbgWriteProfileSectionA@8"   @747
     932    WriteProfileSectionW       = "_DbgWriteProfileSectionW@8"   @748
     933    WriteProfileStringA        = "_DbgWriteProfileStringA@12"   @749
     934    WriteProfileStringW        = "_DbgWriteProfileStringW@12"   @750
     935    WriteTapemark              = "_DbgWriteTapemark@16"         @751
    932936;   _DebugOut                  = _Dbg_DebugOut@??               @752      ;W95
    933937;   _DebugPrintf               = _Dbg_DebugPrintf@??            @753      ;W95
    934     _hread                     = _Dbg_lread@12                  @754
    935     _hwrite                    = _Dbg_lwrite@12                 @755
    936     _lclose                    = _Dbg_lclose@4                  @756
    937     _lcreat                    = _Dbg_lcreat@8                  @757
    938     _llseek                    = _Dbg_llseek@12                 @758
    939     _lopen                     = _Dbg_lopen@8                   @759
    940     _lread                     = _Dbg_lread@12                  @760
    941     _lwrite                    = _Dbg_lwrite@12                 @761
     938    _hread                     = "_Dbg_lread@12"                @754
     939    _hwrite                    = "_Dbg_lwrite@12"               @755
     940    _lclose                    = "_Dbg_lclose@4"                @756
     941    _lcreat                    = "_Dbg_lcreat@8"                @757
     942    _llseek                    = "_Dbg_llseek@12"               @758
     943    _lopen                     = "_Dbg_lopen@8"                 @759
     944    _lread                     = "_Dbg_lread@12"                @760
     945    _lwrite                    = "_Dbg_lwrite@12"               @761
    942946;   dprintf                    = _Dbgdprintf@??                 @762      ;W95
    943     lstrcat                    = _DbglstrcatA@8                 @763
    944     lstrcatA                   = _DbglstrcatA@8                 @764
    945     lstrcatW                   = _DbglstrcatW@8                 @765
    946     lstrcmp                    = _DbglstrcmpA@8                 @766
    947     lstrcmpA                   = _DbglstrcmpA@8                 @767
    948     lstrcmpW                   = _DbglstrcmpW@8                 @768
    949     lstrcmpi                   = _DbglstrcmpiA@8                @769
    950     lstrcmpiA                  = _DbglstrcmpiA@8                @770
    951     lstrcmpiW                  = _DbglstrcmpiW@8                @771
    952     lstrcpy                    = _DbglstrcpyA@8                 @772
    953     lstrcpyA                   = _DbglstrcpyA@8                 @773
    954     lstrcpyW                   = _DbglstrcpyW@8                 @774
    955     lstrcpyn                   = _DbglstrcpynA@12               @775
    956     lstrcpynA                  = _DbglstrcpynA@12               @776
    957     lstrcpynW                  = _DbglstrcpynW@12               @777
    958     lstrlen                    = _DbglstrlenA@4                 @778
    959     lstrlenA                   = _DbglstrlenA@4                 @779
    960     lstrlenW                   = _DbglstrlenW@4                 @780
    961     lstrcpynAtoW               = _DbglstrcpynAtoW@12            @781
    962     lstrcpynWtoA               = _DbglstrcpynWtoA@12            @782
    963     lstrcpyAtoW                = _DbglstrcpyAtoW@8              @783
    964     lstrcpyWtoA                = _DbglstrcpyWtoA@8              @784
    965     lstrncmpA                  = _DbglstrncmpA@12               @785
    966     lstrncmpW                  = _DbglstrncmpW@12               @786
    967 
    968     GetDiskFreeSpaceExA        = _DbgGetDiskFreeSpaceExA@16     @871
    969     GetDiskFreeSpaceExW        = _DbgGetDiskFreeSpaceExW@16     @873
    970 
    971     IsProcessorFeaturePresent  = _DbgIsProcessorFeaturePresent@4 @880
    972 
    973     GetFileAttributesExA       = _DbgGetFileAttributesExA@12    @874
    974     GetFileAttributesExW       = _DbgGetFileAttributesExW@12    @875
    975 
    976     lstrncmpiA                 = _DbglstrncmpiA@12              @887
    977     lstrncmpiW                 = _DbglstrncmpiW@12              @888
    978 
    979     lstrlenAtoW                = _DbglstrlenAtoW@8              @890
    980     lstrlenWtoA                = _DbglstrlenWtoA@8              @891
    981     lstrtrunc                  = _Dbglstrtrunc@8                @892
    982 
    983     GetLongPathNameA           = _DbgGetLongPathNameA@12        @900
    984     GetLongPathNameW           = _DbgGetLongPathNameW@12        @901
     947    lstrcat                    = "_DbglstrcatA@8"               @763
     948    lstrcatA                   = "_DbglstrcatA@8"               @764
     949    lstrcatW                   = "_DbglstrcatW@8"               @765
     950    lstrcmp                    = "_DbglstrcmpA@8"               @766
     951    lstrcmpA                   = "_DbglstrcmpA@8"               @767
     952    lstrcmpW                   = "_DbglstrcmpW@8"               @768
     953    lstrcmpi                   = "_DbglstrcmpiA@8"              @769
     954    lstrcmpiA                  = "_DbglstrcmpiA@8"              @770
     955    lstrcmpiW                  = "_DbglstrcmpiW@8"              @771
     956    lstrcpy                    = "_DbglstrcpyA@8"               @772
     957    lstrcpyA                   = "_DbglstrcpyA@8"               @773
     958    lstrcpyW                   = "_DbglstrcpyW@8"               @774
     959    lstrcpyn                   = "_DbglstrcpynA@12"             @775
     960    lstrcpynA                  = "_DbglstrcpynA@12"             @776
     961    lstrcpynW                  = "_DbglstrcpynW@12"             @777
     962    lstrlen                    = "_DbglstrlenA@4"               @778
     963    lstrlenA                   = "_DbglstrlenA@4"               @779
     964    lstrlenW                   = "_DbglstrlenW@4"               @780
     965    lstrcpynAtoW               = "_DbglstrcpynAtoW@12"          @781
     966    lstrcpynWtoA               = "_DbglstrcpynWtoA@12"          @782
     967    lstrcpyAtoW                = "_DbglstrcpyAtoW@8"            @783
     968    lstrcpyWtoA                = "_DbglstrcpyWtoA@8"            @784
     969    lstrncmpA                  = "_DbglstrncmpA@12"             @785
     970    lstrncmpW                  = "_DbglstrncmpW@12"             @786
     971
     972    GetDiskFreeSpaceExA        = "_DbgGetDiskFreeSpaceExA@16"   @871
     973    GetDiskFreeSpaceExW        = "_DbgGetDiskFreeSpaceExW@16"   @873
     974
     975    IsProcessorFeaturePresent  = "_DbgIsProcessorFeaturePresent@4" @880
     976
     977    GetFileAttributesExA       = "_DbgGetFileAttributesExA@12"  @874
     978    GetFileAttributesExW       = "_DbgGetFileAttributesExW@12"  @875
     979
     980    lstrncmpiA                 = "_DbglstrncmpiA@12"            @887
     981    lstrncmpiW                 = "_DbglstrncmpiW@12"            @888
     982
     983    lstrlenAtoW                = "_DbglstrlenAtoW@8"            @890
     984    lstrlenWtoA                = "_DbglstrlenWtoA@8"            @891
     985    lstrtrunc                  = "_Dbglstrtrunc@8"              @892
     986
     987    GetLongPathNameA           = "_DbgGetLongPathNameA@12"      @900
     988    GetLongPathNameW           = "_DbgGetLongPathNameW@12"      @901
    985989
    986990; Windows 2000, Terminal Server 4.0 SP4 functions
    987     GetSystemWindowsDirectoryA = _DbgGetWindowsDirectoryA@8     @902
    988     GetSystemWindowsDirectoryW = _DbgGetWindowsDirectoryW@8     @903
     991    GetSystemWindowsDirectoryA = "_DbgGetWindowsDirectoryA@8"   @902
     992    GetSystemWindowsDirectoryW = "_DbgGetWindowsDirectoryW@8"   @903
    989993
    990994; Windows 2000 (and up) volume functions
    991     FindFirstVolumeA           = _DbgFindFirstVolumeA@8            @904
    992     FindFirstVolumeW           = _DbgFindFirstVolumeW@8            @905
    993     FindNextVolumeA            = _DbgFindNextVolumeA@12            @906
    994     FindNextVolumeW            = _DbgFindNextVolumeW@12            @907
    995     FindVolumeClose            = _DbgFindVolumeClose@4             @908
    996 
    997     FindFirstVolumeMountPointA = _DbgFindFirstVolumeMountPointA@12 @909
    998     FindFirstVolumeMountPointW = _DbgFindFirstVolumeMountPointW@12 @910
    999     FindNextVolumeMountPointA  = _DbgFindNextVolumeMountPointA@12  @911
    1000     FindNextVolumeMountPointW  = _DbgFindNextVolumeMountPointW@12  @912
    1001     FindVolumeMountPointClose  = _DbgFindVolumeMountPointClose@4  @913
    1002 
    1003     GetVolumeNameForVolumeMountPointA = _DbgGetVolumeNameForVolumeMountPointA@12 @914
    1004     GetVolumeNameForVolumeMountPointW = _DbgGetVolumeNameForVolumeMountPointW@12 @915
    1005 
    1006     GetVolumePathNameA         = _DbgGetVolumePathNameA@12     @916
    1007     GetVolumePathNameW         = _DbgGetVolumePathNameW@12     @917
    1008    
    1009     GetFileSizeEx              = _GetFileSizeEx@8              @920
     995    FindFirstVolumeA           = "_DbgFindFirstVolumeA@8"          @904
     996    FindFirstVolumeW           = "_DbgFindFirstVolumeW@8"          @905
     997    FindNextVolumeA            = "_DbgFindNextVolumeA@12"          @906
     998    FindNextVolumeW            = "_DbgFindNextVolumeW@12"          @907
     999    FindVolumeClose            = "_DbgFindVolumeClose@4"           @908
     1000
     1001    FindFirstVolumeMountPointA = "_DbgFindFirstVolumeMountPointA@12" @909
     1002    FindFirstVolumeMountPointW = "_DbgFindFirstVolumeMountPointW@12" @910
     1003    FindNextVolumeMountPointA  = "_DbgFindNextVolumeMountPointA@12"  @911
     1004    FindNextVolumeMountPointW  = "_DbgFindNextVolumeMountPointW@12"  @912
     1005    FindVolumeMountPointClose  = "_DbgFindVolumeMountPointClose@4" @913
     1006
     1007    GetVolumeNameForVolumeMountPointA = "_DbgGetVolumeNameForVolumeMountPointA@12" @914
     1008    GetVolumeNameForVolumeMountPointW = "_DbgGetVolumeNameForVolumeMountPointW@12" @915
     1009
     1010    GetVolumePathNameA         = "_DbgGetVolumePathNameA@12"   @916
     1011    GetVolumePathNameW         = "_DbgGetVolumePathNameW@12"   @917
     1012
     1013    GetFileSizeEx              = "_GetFileSizeEx@8"            @920
    10101014;
    10111015; ENDOFEXPORTS
     
    10231027; ----------------------------------------------------------------------------
    10241028;registry apis imported by advapi32
    1025     RegCloseKey                 = _DbgRegCloseKey@4                @1100 NONAME
    1026     RegConnectRegistryA         = _DbgRegConnectRegistryA@12       @1101 NONAME
    1027     RegConnectRegistryW         = _DbgRegConnectRegistryW@12       @1102 NONAME
    1028     RegCreateKeyA               = _DbgRegCreateKeyA@12             @1103 NONAME
    1029     RegCreateKeyExA             = _DbgRegCreateKeyExA@36           @1104 NONAME
    1030     RegCreateKeyExW             = _DbgRegCreateKeyExW@36           @1105 NONAME
    1031     RegCreateKeyW               = _DbgRegCreateKeyW@12             @1106 NONAME
    1032     RegDeleteKeyA               = _DbgRegDeleteKeyA@8              @1107 NONAME
    1033     RegDeleteKeyW               = _DbgRegDeleteKeyW@8              @1108 NONAME
    1034     RegDeleteValueA             = _DbgRegDeleteValueA@8            @1109 NONAME
    1035     RegDeleteValueW             = _DbgRegDeleteValueW@8            @1110 NONAME
    1036     RegEnumKeyA                 = _DbgRegEnumKeyA@16               @1111 NONAME
    1037     RegEnumKeyExA               = _DbgRegEnumKeyExA@32             @1112 NONAME
    1038     RegEnumKeyExW               = _DbgRegEnumKeyExW@32             @1113 NONAME
    1039     RegEnumKeyW                 = _DbgRegEnumKeyW@16               @1114 NONAME
    1040     RegEnumValueA               = _DbgRegEnumValueA@32             @1115 NONAME
    1041     RegEnumValueW               = _DbgRegEnumValueW@32             @1116 NONAME
    1042     RegFlushKey                 = _DbgRegFlushKey@4                @1117 NONAME
    1043     RegGetKeySecurity           = _DbgRegGetKeySecurity@16         @1118 NONAME
    1044     RegLoadKeyA                 = _DbgRegLoadKeyA@12               @1119 NONAME
    1045     RegLoadKeyW                 = _DbgRegLoadKeyW@12               @1120 NONAME
    1046     RegNotifyChangeKeyValue     = _DbgRegNotifyChangeKeyValue@20  @1121 NONAME
    1047     RegOpenKeyA                 = _DbgRegOpenKeyA@12               @1122 NONAME
    1048     RegOpenKeyExA               = _DbgRegOpenKeyExA@20             @1123 NONAME
    1049     RegOpenKeyExW               = _DbgRegOpenKeyExW@20             @1124 NONAME
    1050     RegOpenKeyW                 = _DbgRegOpenKeyW@12               @1125 NONAME
    1051     RegQueryInfoKeyA            = _DbgRegQueryInfoKeyA@48          @1126 NONAME
    1052     RegQueryInfoKeyW            = _DbgRegQueryInfoKeyW@48          @1127 NONAME
    1053     RegQueryMultipleValuesA     = _DbgRegQueryMultipleValuesA@20  @1128 NONAME
    1054     RegQueryMultipleValuesW     = _DbgRegQueryMultipleValuesW@20  @1129 NONAME
    1055     RegQueryValueA              = _DbgRegQueryValueA@16            @1130 NONAME
    1056     RegQueryValueExA            = _DbgRegQueryValueExA@24          @1131 NONAME
    1057     RegQueryValueExW            = _DbgRegQueryValueExW@24          @1132 NONAME
    1058     RegQueryValueW              = _DbgRegQueryValueW@16            @1133 NONAME
    1059     RegReplaceKeyA              = _DbgRegReplaceKeyA@16            @1134 NONAME
    1060     RegReplaceKeyW              = _DbgRegReplaceKeyW@16            @1135 NONAME
    1061     RegRestoreKeyA              = _DbgRegRestoreKeyA@12            @1136 NONAME
    1062     RegRestoreKeyW              = _DbgRegRestoreKeyW@12            @1137 NONAME
    1063     RegSaveKeyA                 = _DbgRegSaveKeyA@12               @1138 NONAME
    1064     RegSaveKeyW                 = _DbgRegSaveKeyW@12               @1139 NONAME
    1065     RegSetKeySecurity           = _DbgRegSetKeySecurity@12         @1140 NONAME
    1066     RegSetValueA                = _DbgRegSetValueA@20              @1141 NONAME
    1067     RegSetValueExA              = _DbgRegSetValueExA@24            @1142 NONAME
    1068     RegSetValueExW              = _DbgRegSetValueExW@24            @1143 NONAME
    1069     RegSetValueW                = _DbgRegSetValueW@20              @1144 NONAME
    1070     RegUnLoadKeyA               = _DbgRegUnLoadKeyA@8              @1145 NONAME
    1071     RegUnLoadKeyW               = _DbgRegUnLoadKeyW@8              @1146 NONAME
     1029    RegCloseKey                 = "_DbgRegCloseKey@4"              @1100 NONAME
     1030    RegConnectRegistryA         = "_DbgRegConnectRegistryA@12"     @1101 NONAME
     1031    RegConnectRegistryW         = "_DbgRegConnectRegistryW@12"     @1102 NONAME
     1032    RegCreateKeyA               = "_DbgRegCreateKeyA@12"           @1103 NONAME
     1033    RegCreateKeyExA             = "_DbgRegCreateKeyExA@36"         @1104 NONAME
     1034    RegCreateKeyExW             = "_DbgRegCreateKeyExW@36"         @1105 NONAME
     1035    RegCreateKeyW               = "_DbgRegCreateKeyW@12"           @1106 NONAME
     1036    RegDeleteKeyA               = "_DbgRegDeleteKeyA@8"            @1107 NONAME
     1037    RegDeleteKeyW               = "_DbgRegDeleteKeyW@8"            @1108 NONAME
     1038    RegDeleteValueA             = "_DbgRegDeleteValueA@8"          @1109 NONAME
     1039    RegDeleteValueW             = "_DbgRegDeleteValueW@8"          @1110 NONAME
     1040    RegEnumKeyA                 = "_DbgRegEnumKeyA@16"             @1111 NONAME
     1041    RegEnumKeyExA               = "_DbgRegEnumKeyExA@32"           @1112 NONAME
     1042    RegEnumKeyExW               = "_DbgRegEnumKeyExW@32"           @1113 NONAME
     1043    RegEnumKeyW                 = "_DbgRegEnumKeyW@16"             @1114 NONAME
     1044    RegEnumValueA               = "_DbgRegEnumValueA@32"           @1115 NONAME
     1045    RegEnumValueW               = "_DbgRegEnumValueW@32"           @1116 NONAME
     1046    RegFlushKey                 = "_DbgRegFlushKey@4"              @1117 NONAME
     1047    RegGetKeySecurity           = "_DbgRegGetKeySecurity@16"       @1118 NONAME
     1048    RegLoadKeyA                 = "_DbgRegLoadKeyA@12"             @1119 NONAME
     1049    RegLoadKeyW                 = "_DbgRegLoadKeyW@12"             @1120 NONAME
     1050    RegNotifyChangeKeyValue     = "_DbgRegNotifyChangeKeyValue@20" @1121 NONAME
     1051    RegOpenKeyA                 = "_DbgRegOpenKeyA@12"             @1122 NONAME
     1052    RegOpenKeyExA               = "_DbgRegOpenKeyExA@20"           @1123 NONAME
     1053    RegOpenKeyExW               = "_DbgRegOpenKeyExW@20"           @1124 NONAME
     1054    RegOpenKeyW                 = "_DbgRegOpenKeyW@12"             @1125 NONAME
     1055    RegQueryInfoKeyA            = "_DbgRegQueryInfoKeyA@48"        @1126 NONAME
     1056    RegQueryInfoKeyW            = "_DbgRegQueryInfoKeyW@48"        @1127 NONAME
     1057    RegQueryMultipleValuesA     = "_DbgRegQueryMultipleValuesA@20" @1128 NONAME
     1058    RegQueryMultipleValuesW     = "_DbgRegQueryMultipleValuesW@20" @1129 NONAME
     1059    RegQueryValueA              = "_DbgRegQueryValueA@16"          @1130 NONAME
     1060    RegQueryValueExA            = "_DbgRegQueryValueExA@24"        @1131 NONAME
     1061    RegQueryValueExW            = "_DbgRegQueryValueExW@24"        @1132 NONAME
     1062    RegQueryValueW              = "_DbgRegQueryValueW@16"          @1133 NONAME
     1063    RegReplaceKeyA              = "_DbgRegReplaceKeyA@16"          @1134 NONAME
     1064    RegReplaceKeyW              = "_DbgRegReplaceKeyW@16"          @1135 NONAME
     1065    RegRestoreKeyA              = "_DbgRegRestoreKeyA@12"          @1136 NONAME
     1066    RegRestoreKeyW              = "_DbgRegRestoreKeyW@12"          @1137 NONAME
     1067    RegSaveKeyA                 = "_DbgRegSaveKeyA@12"             @1138 NONAME
     1068    RegSaveKeyW                 = "_DbgRegSaveKeyW@12"             @1139 NONAME
     1069    RegSetKeySecurity           = "_DbgRegSetKeySecurity@12"       @1140 NONAME
     1070    RegSetValueA                = "_DbgRegSetValueA@20"            @1141 NONAME
     1071    RegSetValueExA              = "_DbgRegSetValueExA@24"          @1142 NONAME
     1072    RegSetValueExW              = "_DbgRegSetValueExW@24"          @1143 NONAME
     1073    RegSetValueW                = "_DbgRegSetValueW@20"            @1144 NONAME
     1074    RegUnLoadKeyA               = "_DbgRegUnLoadKeyA@8"            @1145 NONAME
     1075    RegUnLoadKeyW               = "_DbgRegUnLoadKeyW@8"            @1146 NONAME
    10721076
    10731077
     
    10861090
    10871091;Used by tibfix page in exe (change ordinal in pe2lx.cpp too!!)
    1088     _RegisterPe2LxExe@12                                          @1203
    1089     _RegisterPe2LxDll@12                                          @1209
    1090 
    1091     _CreateWin32PeLdrExe@36                                       @1236
    1092 
    1093     _RegisterLxExe@8                                              @1237
    1094     _RegisterLxDll@24                                             @1238
    1095     _UnregisterLxDll@4                                            @1239
    1096     _RegisterDummyExe@4                                           @1249
    1097     _IsDummyExeLoaded@0                                           @1250 NONAME
    1098 
    1099 ;VMutex
    1100 ;;   enter__6VMutexFUlPUl                                           @1204 NONAME
    1101 ;;   leave__6VMutexFPUl                                             @1205 NONAME
    1102    __ct__6VMutexFv                                                @1206 NONAME
    1103    __dt__6VMutexFv                                                @1207 NONAME
     1092    "_RegisterPe2LxExe@12"                                        @1203
     1093    "_RegisterPe2LxDll@12"                                        @1209
     1094
     1095    "_CreateWin32PeLdrExe@36"                                     @1236
     1096
     1097    "_RegisterLxExe@8"                                            @1237
     1098    "_RegisterLxDll@24"                                           @1238
     1099    "_UnregisterLxDll@4"                                          @1239
     1100    "_RegisterDummyExe@4"                                         @1249
     1101    "_IsDummyExeLoaded@0"                                         @1250 NONAME
    11041102
    11051103;version functions
     
    11131111   SetReturnFS         = SetReturnFS                              @1235 NONAME
    11141112
    1115    RestoreOS2TIB        = _RestoreOS2TIB@0                        @1228 NONAME
    1116    SetWin32TIB          = _SetWin32TIB@4                          @1229 NONAME
     1113   RestoreOS2TIB        = "_RestoreOS2TIB@0"                      @1228 NONAME
     1114   SetWin32TIB          = "_SetWin32TIB@4"                        @1229 NONAME
    11171115   RestoreOS2FS         = RestoreOS2FS                            @1230 NONAME
    11181116
    11191117   ;SvL: HandleManager functions
    11201118
    1121 ;   HMHandleTranslateToWin__FUlPUl                                  @1234
    1122 
    1123    HMHandleAllocate__FPUlUl                                       @1231 NONAME
    1124    HMHandleFree__FUl                                              @1232 NONAME
    1125    HMHandleTranslateToOS2__FUlPUl                                 @1233 NONAME
    1126    HMMsgWaitForMultipleObjects__FUlPUlN31                         @1260 NONAME
    1127    HMOpenThreadToken__FUlN21PUl                                   @1261 NONAME
    1128    HMOpenProcessToken__FUlN21PUl                                  @1262 NONAME
    1129    HMHandleGetUserData__FUl                                       @1263 NONAME
    1130    HMHandleSetUserData__FUlT1                                     @1303 NONAME
    1131 
    1132    _GetThreadTEB@0                                                @1234 NONAME
    1133    _GetTEBFromThreadId@4                                          @1255 NONAME
    1134    _GetTEBFromThreadHandle@4                                      @1256 NONAME
     1119;   HMHandleTranslateToWin                                          @1234
     1120
     1121   _HMHandleAllocate                                              @1231 NONAME
     1122   _HMHandleFree                                                  @1232 NONAME
     1123   _HMHandleTranslateToOS2                                        @1233 NONAME
     1124   _HMMsgWaitForMultipleObjects                                   @1260 NONAME
     1125   _HMOpenThreadToken                                             @1261 NONAME
     1126   _HMOpenProcessToken                                            @1262 NONAME
     1127   _HMHandleGetUserData                                           @1263 NONAME
     1128   _HMHandleSetUserData                                           @1303 NONAME
     1129
     1130   "_GetThreadTEB@0"                                              @1234 NONAME
     1131   "_GetTEBFromThreadId@4"                                        @1255 NONAME
     1132   "_GetTEBFromThreadHandle@4"                                    @1256 NONAME
    11351133
    11361134; HEAP Management (heap.cpp, heapstring.cpp)
    1137     HEAP_xalloc                = _DbgHEAP_xalloc@12                  @1240 NONAME
    1138     HEAP_xrealloc              = _DbgHEAP_xrealloc@16                @1241 NONAME
    1139     HEAP_malloc                = _DbgHEAP_malloc@4                   @1242 NONAME
    1140     HEAP_realloc               = _DbgHEAP_realloc@8                  @1243 NONAME
    1141     HEAP_size                  = _DbgHEAP_size@4                     @1292 NONAME
    1142     HEAP_free                  = _DbgHEAP_free@4                     @1244 NONAME
    1143     HEAP_strdupWtoA            = _DbgHEAP_strdupWtoA@12              @1245 NONAME
    1144     HEAP_strdupAtoW            = _DbgHEAP_strdupAtoW@12              @1246 NONAME
    1145     HEAP_strdupA               = _DbgHEAP_strdupA@12                 @1247 NONAME
    1146     HEAP_strdupW               = _DbgHEAP_strdupW@12                 @1248 NONAME
    1147 
    1148     _VIRTUAL_MapFileA@12                                          @1251 NONAME
    1149     _VIRTUAL_MapFileW@12                                          @1252 NONAME
     1135    HEAP_xalloc                = "_DbgHEAP_xalloc@12"                @1240 NONAME
     1136    HEAP_xrealloc              = "_DbgHEAP_xrealloc@16"              @1241 NONAME
     1137    HEAP_malloc                = "_DbgHEAP_malloc@4"                 @1242 NONAME
     1138    HEAP_realloc               = "_DbgHEAP_realloc@8"                @1243 NONAME
     1139    HEAP_size                  = "_DbgHEAP_size@4"                   @1292 NONAME
     1140    HEAP_free                  = "_DbgHEAP_free@4"                   @1244 NONAME
     1141    HEAP_strdupWtoA            = "_DbgHEAP_strdupWtoA@12"            @1245 NONAME
     1142    HEAP_strdupAtoW            = "_DbgHEAP_strdupAtoW@12"            @1246 NONAME
     1143    HEAP_strdupA               = "_DbgHEAP_strdupA@12"               @1247 NONAME
     1144    HEAP_strdupW               = "_DbgHEAP_strdupW@12"               @1248 NONAME
     1145
     1146    "_VIRTUAL_MapFileA@12"                                        @1251 NONAME
     1147    "_VIRTUAL_MapFileW@12"                                        @1252 NONAME
    11501148
    11511149    OS2SetExceptionHandler                                        @1253 NONAME
     
    11561154; -------------------
    11571155
    1158     _PROFILE_GetOdinIniString@20                                  @1264 NONAME
    1159     _PROFILE_SetOdinIniString@12                                  @1265 NONAME
    1160     _PROFILE_GetOdinIniInt@12                                     @1266 NONAME
    1161     _PROFILE_SetOdinIniInt@12                                     @1267 NONAME
    1162     _PROFILE_GetOdinIniBool@12                                    @1268 NONAME
    1163     _PROFILE_SetOdinIniBool@12                                    @1269 NONAME
    1164     _PROFILE_SaveOdinIni@0                                        @1270 NONAME
     1156    "_PROFILE_GetOdinIniString@20"                                @1264 NONAME
     1157    "_PROFILE_SetOdinIniString@12"                                @1265 NONAME
     1158    "_PROFILE_GetOdinIniInt@12"                                   @1266 NONAME
     1159    "_PROFILE_SetOdinIniInt@12"                                   @1267 NONAME
     1160    "_PROFILE_GetOdinIniBool@12"                                  @1268 NONAME
     1161    "_PROFILE_SetOdinIniBool@12"                                  @1269 NONAME
     1162    "_PROFILE_SaveOdinIni@0"                                      @1270 NONAME
    11651163
    11661164;shared memory allocation
     
    11741172
    11751173;code memory allocation
    1176     codeHeap                                                      @1272 NONAME
     1174    _codeHeap                                                     @1272 NONAME
    11771175
    11781176;fast file API's
    1179     FindFirstFileMultiA        = _FindFirstFileMultiA@12          @1290 NONAME
    1180     FindNextFileMultiA         = _FindNextFileMultiA@12           @1291 NONAME
    1181 
    1182     _GetProcModuleFileNameA@12                                    @1295 NONAME
     1177    FindFirstFileMultiA        = "_FindFirstFileMultiA@12"        @1290 NONAME
     1178    FindNextFileMultiA         = "_FindNextFileMultiA@12"         @1291 NONAME
     1179
     1180    "_GetProcModuleFileNameA@12"                                  @1295 NONAME
    11831181
    11841182;Build number
    1185     _Odin32GetBuildNumber@0                                       @1293 NONAME
    1186 
    1187     _WaitForInputIdle@8                                           @1301 NONAME
     1183    "_Odin32GetBuildNumber@0"                                     @1293 NONAME
     1184
     1185    "_WaitForInputIdle@8"                                         @1301 NONAME
    11881186
    11891187    InitializeKernel32                                            @1302 NONAME
    11901188
    1191     IsExeStarted__Fv                                              @2001 NONAME
     1189    IsExeStarted               = _IsExeStarted                    @2001 NONAME
    11921190    CheckCurFS                                                    @2002 NONAME
    11931191    _SupportsCPUID                                                @2003 NONAME
    11941192    _GetCPUFeatures                                               @2004 NONAME
    1195     CPUFeatures                                                   @2005 NONAME
     1193    _CPUFeatures                                                  @2005 NONAME
    11961194
    11971195    _wctype_table                                                 @2006 NONAME
     
    12051203;    get_char_typeW                                                @2008 NONAME
    12061204
    1207     _GetProcessTIBSel@0                                           @2012 NONAME
    1208 
    1209     _SetRegistryRootKey@8                                         @2013 NONAME
    1210     _SetCustomBuildName@8                                         @2014 NONAME
    1211     _RegisterCustomDriver@36                                      @2015 NONAME
     1205    "_GetProcessTIBSel@0"                                         @2012 NONAME
     1206
     1207    "_SetRegistryRootKey@8"                                       @2013 NONAME
     1208    "_SetCustomBuildName@8"                                       @2014 NONAME
     1209    "_RegisterCustomDriver@36"                                    @2015 NONAME
    12121210
    12131211    strcmpiW                                                      @2020 NONAME
     
    12231221    OSLibDosDevIOCtl                                              @2026 NONAME
    12241222
    1225     OSLibImSetMsgQueueProperty                                    @2029 NONAME
    1226 
    1227     fIsDBCSEnv                                                    @2103 NONAME
    1228     _hookInit@4                                                   @2104 NONAME
     1223    _OSLibImSetMsgQueueProperty           @2029 NONAME
     1224
     1225    _fIsDBCSEnv                           @2103 NONAME
     1226    "_hookInit@4"                         @2104 NONAME
    12291227
    12301228    vsnprintfW                            @2030 NONAME
     
    12341232    __argcA                               @2033 NONAME
    12351233    __argvA                               @2034 NONAME
    1236     _CommandLineToArgvW@8                 @2035 NONAME
     1234    "_CommandLineToArgvW@8"               @2035 NONAME
    12371235
    12381236; custom dll hook installer
    1239     _ODIN_SetDllLoadCallback@4                                    @2100 NONAME
     1237    "_ODIN_SetDllLoadCallback@4"                                  @2100 NONAME
    12401238; override export
    1241     _ODIN_SetProcAddress@12                                       @2101 NONAME
     1239    "_ODIN_SetProcAddress@12"                                     @2101 NONAME
    12421240
    12431241; override TIB switching
    1244     _ODIN_SetTIBSwitch@4                                          @2102 NONAME
    1245 
    1246     GetDisplayCodepage                                            @3000 NONAME
    1247     GetWindowsCodepage                                            @3001 NONAME
     1242    "_ODIN_SetTIBSwitch@4"                                        @2102 NONAME
     1243
     1244    _GetDisplayCodepage                                           @3000 NONAME
     1245    _GetWindowsCodepage                                           @3001 NONAME
    12481246
    12491247; ODIN debugging functions
    1250     _dbg_GetThreadCallDepth@0                                     @3100 NONAME
    1251     _dbg_IncThreadCallDepth@0                                     @3101 NONAME
    1252     _dbg_DecThreadCallDepth@0                                     @3102 NONAME
     1248    "_dbg_GetThreadCallDepth@0"                                   @3100 NONAME
     1249    "_dbg_IncThreadCallDepth@0"                                   @3101 NONAME
     1250    "_dbg_DecThreadCallDepth@0"                                   @3102 NONAME
    12531251    PerfView_RegisterCall                                         @3103 NONAME
    12541252    PerfView_DumpProfile                                          @3104 NONAME
    12551253    PerfView_Write                                                @3105 NONAME
    1256     _dbg_GetLastCallerName@0                                      @3106 NONAME
    1257     _dbg_ThreadPushCall@4                                         @3107 NONAME
    1258     _dbg_ThreadPopCall@0                                          @3108 NONAME
    1259 
    1260     _ODIN_QueryLoaders@24                                         @3109 NONAME
    1261     _ODIN_IsWin32App@4                                            @3110 NONAME
    1262 
    1263     _OSLibWinCreateObject@32                                      @3111 NONAME
    1264 
    1265     _MMAP_RegisterMemoryRange@16                                  @3112 NONAME
    1266     _MMAP_UnregisterMemoryRange@4                                 @3113 NONAME
    1267 
    1268     _ODIN_SetExceptionHandler@4                                   @3114 NONAME
    1269     _ODIN_UnsetExceptionHandler@4                                 @3115 NONAME
    1270 
    1271     _PSAPI_EnumProcessModules@16                                  @3116 NONAME
    1272     _PSAPI_GetModuleInformation@16                                @3117 NONAME
    1273 
    1274     _ODIN_SetProcessDword@12                                      @3118 NONAME
     1254    "_dbg_GetLastCallerName@0"                                    @3106 NONAME
     1255    "_dbg_ThreadPushCall@4"                                       @3107 NONAME
     1256    "_dbg_ThreadPopCall@0"                                        @3108 NONAME
     1257
     1258    "_ODIN_QueryLoaders@24"                                       @3109 NONAME
     1259    "_ODIN_IsWin32App@4"                                          @3110 NONAME
     1260
     1261    "_OSLibWinCreateObject@32"                                    @3111 NONAME
     1262
     1263    "_MMAP_RegisterMemoryRange@16"                                @3112 NONAME
     1264    "_MMAP_UnregisterMemoryRange@4"                               @3113 NONAME
     1265
     1266    "_ODIN_SetExceptionHandler@4"                                 @3114 NONAME
     1267    "_ODIN_UnsetExceptionHandler@4"                               @3115 NONAME
     1268
     1269    "_PSAPI_EnumProcessModules@16"                @3116 NONAME
     1270    "_PSAPI_GetModuleInformation@16"                              @3117 NONAME
     1271
     1272    "_ODIN_SetProcessDword@12"                                    @3118 NONAME
    12751273
    12761274; required for Mozilla plugin
    12771275
    1278     _ODIN_ThreadEnterOdinContext@8 = _ODIN_ThreadEnterOdinContext@8 @3119
    1279     _ODIN_ThreadLeaveOdinContext@8 = _ODIN_ThreadLeaveOdinContext@8 @3120
    1280     _ODIN_ThreadLeaveOdinContextNested@8 = _ODIN_ThreadLeaveOdinContextNested@8 @3121
    1281     _ODIN_ThreadEnterOdinContextNested@12 = _ODIN_ThreadEnterOdinContextNested@12 @3122
     1276    "_ODIN_ThreadEnterOdinContext@8" = "_ODIN_ThreadEnterOdinContext@8" @3119
     1277    "_ODIN_ThreadLeaveOdinContext@8" = "_ODIN_ThreadLeaveOdinContext@8" @3120
     1278    "_ODIN_ThreadLeaveOdinContextNested@8" = "_ODIN_ThreadLeaveOdinContextNested@8" @3121
     1279    "_ODIN_ThreadEnterOdinContextNested@12" = "_ODIN_ThreadEnterOdinContextNested@12" @3122
    12821280
    12831281; Char functions (forwarders from user32)
    1284     _DbgCharLowerA@4                                                 @3127 NONAME
    1285     _DbgCharLowerBuffA@8                                             @3128 NONAME
    1286     _DbgCharLowerBuffW@8                                             @3129 NONAME
    1287     _DbgCharLowerW@4                                                 @3130 NONAME
    1288     _DbgCharNextA@4                                                  @3131 NONAME
    1289     _DbgCharNextExA@12                                               @3132 NONAME
    1290     _DbgCharNextExW@12                                               @3133 NONAME
    1291     _DbgCharNextW@4                                                  @3134 NONAME
    1292     _DbgCharPrevA@8                                                  @3135 NONAME
    1293     _DbgCharPrevExA@16                                               @3136 NONAME
    1294     _DbgCharPrevExW@16                                               @3137 NONAME
    1295     _DbgCharPrevW@8                                                  @3138 NONAME
    1296     _DbgCharToOemA@8                                                 @3139 NONAME
    1297     _DbgCharToOemBuffA@12                                            @3140 NONAME
    1298     _DbgCharToOemBuffW@12                                            @3141 NONAME
    1299     _DbgCharToOemW@8                                                 @3142 NONAME
    1300     _DbgCharUpperA@4                                                 @3143 NONAME
    1301     _DbgCharUpperBuffA@8                                             @3144 NONAME
    1302     _DbgCharUpperBuffW@8                                             @3145 NONAME
    1303     _DbgCharUpperW@4                                                 @3146 NONAME
    1304     _DbgOemToCharA@8                                                 @3149 NONAME
    1305     _DbgOemToCharBuffA@12                                            @3150 NONAME
    1306     _DbgOemToCharBuffW@12                                            @3151 NONAME
    1307     _DbgOemToCharW@8                                                 @3152 NONAME
    1308     _DbgIsCharAlphaA@4                                               @3153 NONAME
    1309     _DbgIsCharAlphaNumericA@4                                        @3154 NONAME
    1310     _DbgIsCharAlphaNumericW@4                                        @3155 NONAME
    1311     _DbgIsCharAlphaW@4                                               @3156 NONAME
    1312     _DbgIsCharLowerA@4                                               @3157 NONAME
    1313     _DbgIsCharLowerW@4                                               @3158 NONAME
    1314     _DbgIsCharUpperA@4                                               @3159 NONAME
    1315     _DbgIsCharUpperW@4                                               @3160 NONAME
    1316     SetFilePointerEx            = _SetFilePointerEx@20               @3161
    1317     SetWaitableTimer = _SetWaitableTimer@24                          @3162   
     1282    "_DbgCharLowerA@4"                                               @3127 NONAME
     1283    "_DbgCharLowerBuffA@8"                                           @3128 NONAME
     1284    "_DbgCharLowerBuffW@8"                                           @3129 NONAME
     1285    "_DbgCharLowerW@4"                                               @3130 NONAME
     1286    "_DbgCharNextA@4"                                                @3131 NONAME
     1287    "_DbgCharNextExA@12"                                             @3132 NONAME
     1288    "_DbgCharNextExW@12"                                             @3133 NONAME
     1289    "_DbgCharNextW@4"                                                @3134 NONAME
     1290    "_DbgCharPrevA@8"                                                @3135 NONAME
     1291    "_DbgCharPrevExA@16"                                             @3136 NONAME
     1292    "_DbgCharPrevExW@16"                                             @3137 NONAME
     1293    "_DbgCharPrevW@8"                                                @3138 NONAME
     1294    "_DbgCharToOemA@8"                                               @3139 NONAME
     1295    "_DbgCharToOemBuffA@12"                                          @3140 NONAME
     1296    "_DbgCharToOemBuffW@12"                                          @3141 NONAME
     1297    "_DbgCharToOemW@8"                                               @3142 NONAME
     1298    "_DbgCharUpperA@4"                                               @3143 NONAME
     1299    "_DbgCharUpperBuffA@8"                                           @3144 NONAME
     1300    "_DbgCharUpperBuffW@8"                                           @3145 NONAME
     1301    "_DbgCharUpperW@4"                                               @3146 NONAME
     1302    "_DbgOemToCharA@8"                                               @3149 NONAME
     1303    "_DbgOemToCharBuffA@12"                                          @3150 NONAME
     1304    "_DbgOemToCharBuffW@12"                                          @3151 NONAME
     1305    "_DbgOemToCharW@8"                                               @3152 NONAME
     1306    "_DbgIsCharAlphaA@4"                                             @3153 NONAME
     1307    "_DbgIsCharAlphaNumericA@4"                                      @3154 NONAME
     1308    "_DbgIsCharAlphaNumericW@4"                                      @3155 NONAME
     1309    "_DbgIsCharAlphaW@4"                                             @3156 NONAME
     1310    "_DbgIsCharLowerA@4"                                             @3157 NONAME
     1311    "_DbgIsCharLowerW@4"                                             @3158 NONAME
     1312    "_DbgIsCharUpperA@4"                                             @3159 NONAME
     1313    "_DbgIsCharUpperW@4"                                             @3160 NONAME
     1314    SetFilePointerEx            = "_SetFilePointerEx@20"             @3161
     1315    SetWaitableTimer = "_SetWaitableTimer@24"                        @3162
    13181316
    13191317; NTDLL forwarder
     
    13241322
    13251323; RAS functions
    1326     RasRegisterObjectTracking   = _RasRegisterObjectTracking@24      @3500
    1327     RasDeregisterObjectTracking = _RasDeregisterObjectTracking@4     @3501
    1328     RasAddObject                = _RasAddObject@16                   @3502
    1329     RasRemoveObject             = _RasRemoveObject@8                 @3503
    1330     RasSetObjectUserData        = _RasSetObjectUserData@20           @3504
    1331     RasQueryObjectUserData      = _RasQueryObjectUserData@20         @3505
    1332     RasInitialize               = _RasInitialize@4                   @3506
    1333     RasUninitialize             = _RasUninitialize@0                 @3507
     1324    RasRegisterObjectTracking   = "_RasRegisterObjectTracking@24"    @3500
     1325    RasDeregisterObjectTracking = "_RasDeregisterObjectTracking@4"   @3501
     1326    RasAddObject                = "_RasAddObject@16"                 @3502
     1327    RasRemoveObject             = "_RasRemoveObject@8"               @3503
     1328    RasSetObjectUserData        = "_RasSetObjectUserData@20"         @3504
     1329    RasQueryObjectUserData      = "_RasQueryObjectUserData@20"       @3505
     1330    RasInitialize               = "_RasInitialize@4"                 @3506
     1331    RasUninitialize             = "_RasUninitialize@0"               @3507
    13341332    _RasLog                     = _RasLog                            @3508
    1335     RasLogMsg                   = _RasLogMsg@12                      @3509
    1336     RasLogObjects               = _RasLogObjects@8                   @3510
    1337     RasEnterSerialize           = _RasEnterSerialize@0               @3511
    1338     RasExitSerialize            = _RasExitSerialize@0                @3512
     1333    RasLogMsg                   = "_RasLogMsg@12"                    @3509
     1334    RasLogObjects               = "_RasLogObjects@8"                 @3510
     1335    RasEnterSerialize           = "_RasEnterSerialize@0"             @3511
     1336    RasExitSerialize            = "_RasExitSerialize@0"              @3512
    13391337    _RasLogNoEOL                = _RasLogNoEOL                       @3513
    1340     RasOpenLogChannel           = _RasOpenLogChannel@12              @3514
    1341     RasWriteLogChannel          = _RasWriteLogChannel@12             @3515
    1342     RasCloseLogChannel          = _RasCloseLogChannel@4              @3516
     1338    RasOpenLogChannel           = "_RasOpenLogChannel@12"            @3514
     1339    RasWriteLogChannel          = "_RasWriteLogChannel@12"           @3515
     1340    RasCloseLogChannel          = "_RasCloseLogChannel@4"            @3516
    13431341    _RasLog2                    = _RasLog2                           @3517
    1344     RasLogMsg2                  = _RasLogMsg2@16                     @3518
     1342    RasLogMsg2                  = "_RasLogMsg2@16"                   @3518
    13451343    _RasLogNoEOL2               = _RasLogNoEOL2                      @3519
    1346     RasSaveContext              = _RasSaveContext@4                  @3520
    1347     RasRestoreContext           = _RasRestoreContext@4               @3521
    1348     RasEntry                    = _RasEntry@12                       @3522
    1349     RasSetProcAddr              = _RasSetProcAddr@12                 @3523
    1350     RasTrackMemFree             = _RasTrackMemFree@8                 @3524
    1351     RasTrackMemAlloc            = _RasTrackMemAlloc@8                @3525
    1352     RasTrackMemRealloc          = _RasTrackMemRealloc@12             @3526
    1353     RasCountObjects             = _RasCountObjects@12                @3527
    1354     RasGetTrackHandle           = _RasGetTrackHandle@4               @3528
    1355 
    1356     DecodePointer              = _DecodePointer@4                 @3529 NONAME
    1357     EncodePointer              = _EncodePointer@4                 @3530 NONAME
    1358     RtlUniform                 = _RtlUniform@4                    @3531 NONAME
    1359    
     1344    RasSaveContext              = "_RasSaveContext@4"                @3520
     1345    RasRestoreContext           = "_RasRestoreContext@4"             @3521
     1346    RasEntry                    = "_RasEntry@12"                     @3522
     1347    RasSetProcAddr              = "_RasSetProcAddr@12"               @3523
     1348    RasTrackMemFree             = "_RasTrackMemFree@8"               @3524
     1349    RasTrackMemAlloc            = "_RasTrackMemAlloc@8"              @3525
     1350    RasTrackMemRealloc          = "_RasTrackMemRealloc@12"           @3526
     1351    RasCountObjects             = "_RasCountObjects@12"              @3527
     1352    RasGetTrackHandle           = "_RasGetTrackHandle@4"             @3528
     1353
     1354    DecodePointer              = "_DecodePointer@4"               @3529 NONAME
     1355    EncodePointer              = "_EncodePointer@4"               @3530 NONAME
     1356    RtlUniform                 = "_RtlUniform@4"                  @3531 NONAME
     1357
    13601358    ___seh_handler                                                @3600 NONAME
    1361     _EnableSEH@0                                                  @3601 NONAME
     1359    "_EnableSEH@0"                                                @3601 NONAME
  • trunk/src/kernel32/lang.cpp

    r21848 r21916  
    1919#include <odinwrap.h>
    2020#include <heapstring.h>
    21 #include <win\winreg.h>
     21#include <win/winreg.h>
    2222#include <winos2def.h>
    2323#include "unicode.h"
  • trunk/src/kernel32/mmap.cpp

    r21667 r21916  
    2828#include <stdlib.h>
    2929#include <string.h>
    30 #include <win\virtual.h>
     30#include <win/virtual.h>
    3131#include <odincrt.h>
    3232#include <handlemanager.h>
     
    3434#include "oslibdos.h"
    3535#include "oslibmem.h"
    36 #include <winimagepeldr.h>
     36#include "winimagepeldr.h"
    3737#include <custombuild.h>
    3838#include "asmutil.h"
     
    4141#include "dbglocal.h"
    4242
    43 
    44 
    45 //Global DLL Data
    46 #pragma data_seg(_GLOBALDATA)
    47 Win32MemMap  *Win32MemMap::memmaps = NULL;
    48 CRITICAL_SECTION_OS2       globalmapcritsect = {0};
    49 #pragma data_seg()
    50 
    51 
    52 static char *pszMMapSemName = MEMMAP_CRITSECTION_NAME;
     43static LPCSTR pszMMapSemName = MEMMAP_CRITSECTION_NAME;
    5344
    5445//******************************************************************************
  • trunk/src/kernel32/mmap.h

    r10376 r21916  
    284284//******************************************************************************
    285285
    286 #pragma data_seg(_GLOBALDATA)
     286//
     287// Global DLL Data (keep it in sync with globaldata.asm!)
     288//
    287289extern CRITICAL_SECTION_OS2 globalmapcritsect;
    288 #pragma data_seg()
    289290
    290291void InitializeMemMaps();
  • trunk/src/kernel32/mmapdup.cpp

    r10073 r21916  
    2828#include <stdlib.h>
    2929#include <string.h>
    30 #include <win\virtual.h>
     30#include <win/virtual.h>
    3131#include <odincrt.h>
    3232#include <handlemanager.h>
     
    3434#include "oslibdos.h"
    3535#include "oslibmem.h"
    36 #include <winimagepeldr.h>
    37 #include <custombuild.h> 
     36#include "winimagepeldr.h"
     37#include <custombuild.h>
    3838
    3939#define DBG_LOCALLOG    DBG_mmapdup
     
    4848//
    4949//******************************************************************************
    50 Win32MemMapDup::Win32MemMapDup(Win32MemMap *parent, HANDLE hFile, ULONG size, 
     50Win32MemMapDup::Win32MemMapDup(Win32MemMap *parent, HANDLE hFile, ULONG size,
    5151                               ULONG fdwProtect, LPSTR lpszName) :
    5252          Win32MemMap(hFile, size, fdwProtect, lpszName)
     
    123123    if((fdwAccess & FILE_MAP_READ) && !(mProtFlags & (PAGE_READWRITE|PAGE_READONLY)))
    124124        goto parmfail;
    125    
     125
    126126    if (fdwAccess != FILE_MAP_ALL_ACCESS)
    127127        if((fdwAccess & FILE_MAP_COPY) && !(mProtFlags & PAGE_WRITECOPY))
     
    222222BOOL Win32MemMapDup::commitPage(ULONG ulFaultAddr, ULONG offset, BOOL fWriteAccess, int nrpages)
    223223{
    224     if(mProtFlags & PAGE_WRITECOPY) 
     224    if(mProtFlags & PAGE_WRITECOPY)
    225225    {//this is a COW map, call commitGuardPage
    226226        return commitGuardPage(ulFaultAddr, offset, fWriteAccess);
     
    245245//
    246246//******************************************************************************
    247 BOOL Win32MemMapDup::commitGuardPage(ULONG ulFaultAddr, ULONG ulOffset, 
     247BOOL Win32MemMapDup::commitGuardPage(ULONG ulFaultAddr, ULONG ulOffset,
    248248                                     BOOL fWriteAccess)
    249249{
  • trunk/src/kernel32/mmapnotify.cpp

    r10376 r21916  
    66 * Calls notification handler when an exception occurs in the memory range of
    77 * the map.
    8  * 
     8 *
    99 * Copyright 2003 Sander van Leeuwen (sandervl@innotek.de)
    1010 *
     
    1616#include <stdlib.h>
    1717#include <string.h>
    18 #include <win\virtual.h>
     18#include <win/virtual.h>
    1919#include <odincrt.h>
    2020#include <handlemanager.h>
     
    2222#include "oslibdos.h"
    2323#include "oslibmem.h"
    24 #include <winimagepeldr.h>
    25 #include <custombuild.h> 
     24#include "winimagepeldr.h"
     25#include <custombuild.h>
    2626#include <memmap.h>
    2727
     
    128128// Win32MemMapNotify::findMapByView
    129129//
    130 // Find the map of the view that contains the specified starting address 
     130// Find the map of the view that contains the specified starting address
    131131// and has the specified access type
    132132//
  • trunk/src/kernel32/mmapview.cpp

    r21302 r21916  
    2828#include <stdlib.h>
    2929#include <string.h>
    30 #include <win\virtual.h>
     30#include <win/virtual.h>
    3131#include <odincrt.h>
    3232#include <handlemanager.h>
     
    3434#include "oslibdos.h"
    3535#include "oslibmem.h"
    36 #include <winimagepeldr.h>
    37 #include <custombuild.h> 
     36#include "winimagepeldr.h"
     37#include <custombuild.h>
    3838
    3939#define DBG_LOCALLOG    DBG_mmapview
     
    5151//
    5252//******************************************************************************
    53 Win32MemMapView::Win32MemMapView(Win32MemMap *map, ULONG offset, ULONG size, 
     53Win32MemMapView::Win32MemMapView(Win32MemMap *map, ULONG offset, ULONG size,
    5454                                 ULONG fdwAccess, Win32MemMap *owner)
    5555{
     
    8787    {
    8888        //shared memory map, so map it into our address space
    89         if(OSLibDosGetNamedSharedMem((LPVOID *)&viewaddr, map->getMemName()) != OSLIB_NOERROR) 
     89        if(OSLibDosGetNamedSharedMem((LPVOID *)&viewaddr, map->getMemName()) != OSLIB_NOERROR)
    9090        {
    9191            dprintf(("new OSLibDosGetNamedSharedMem FAILED"));
     
    104104    }
    105105    else {
    106         if(mfAccess & MEMMAP_ACCESS_COPYONWRITE) 
     106        if(mfAccess & MEMMAP_ACCESS_COPYONWRITE)
    107107        {
    108108            //A copy on write view is a private copy of the memory map
     
    118118        }
    119119        }
    120         else 
     120        else
    121121        if(OSLibDosAliasMem(viewaddr, size, &pMapView, accessAttr) != OSLIB_NOERROR) {
    122122            dprintf(("new OSLibDosAliasMem FAILED"));
     
    126126        }
    127127    }
    128     //Allocate bitmap for all pages of a COW view to track which pages are 
     128    //Allocate bitmap for all pages of a COW view to track which pages are
    129129    //shared and which are private (copy on write -> private page)
    130     if(fdwAccess == FILE_MAP_COPY) 
     130    if(fdwAccess == FILE_MAP_COPY)
    131131    {
    132132        DWORD nrPages = mSize >> PAGE_SHIFT;
     
    242242    viewpagestart = mOffset >> PAGE_SHIFT;
    243243    nrviewpages = mSize >> PAGE_SHIFT;
    244     if(mSize & 0xFFF) 
     244    if(mSize & 0xFFF)
    245245        nrviewpages++;
    246246
     
    248248        return; //outside this view
    249249    }
    250     if(startpage + nrpages > viewpagestart + nrviewpages) { 
     250    if(startpage + nrpages > viewpagestart + nrviewpages) {
    251251        nrpages -= ((startpage + nrpages) - (viewpagestart + nrviewpages));
    252252    }
     
    286286    }
    287287
    288     if( ( (mfAccess & MEMMAP_ACCESS_COPYONWRITE) && (flags != PAGEVIEW_GUARD)  ) || 
    289         ( (flags == PAGEVIEW_GUARD) && !(mfAccess & MEMMAP_ACCESS_COPYONWRITE) ) ) 
     288    if( ( (mfAccess & MEMMAP_ACCESS_COPYONWRITE) && (flags != PAGEVIEW_GUARD)  ) ||
     289        ( (flags == PAGEVIEW_GUARD) && !(mfAccess & MEMMAP_ACCESS_COPYONWRITE) ) )
    290290    {
    291291        //PAGEVIEW_GUARD only applies to COW views
    292292        //PAGEVIEW_VIEW/READONLY does not apply to COW views
    293         return TRUE; 
     293        return TRUE;
    294294    }
    295295    if(mOffset + mSize <= offset || mOffset >= offset + size) {
     
    320320    }
    321321
    322     if(flags == PAGEVIEW_GUARD || (mfAccess & MEMMAP_ACCESS_COPYONWRITE)) 
     322    if(flags == PAGEVIEW_GUARD || (mfAccess & MEMMAP_ACCESS_COPYONWRITE))
    323323    {
    324324        DWORD startpage = (offset - mOffset) >> PAGE_SHIFT;
     
    330330        //of the COW pages, then only the shared pages must be changed.
    331331        //So check each page if it is still shared.
    332         for(int i=startpage;i<startpage+nrPages;i++) 
     332        for(int i=startpage;i<startpage+nrPages;i++)
    333333    {
    334             if(!isCOWPage(i)) 
     334            if(!isCOWPage(i))
    335335            {//page is still shared, so set the guard flag
    336336                rc = OSLibDosSetMem((char *)pMapView+(offset - mOffset), PAGE_SIZE, accessAttr);
     
    354354//******************************************************************************
    355355//******************************************************************************
    356 int Win32MemMapView::findViews(Win32MemMap *map, int nrViews, 
     356int Win32MemMapView::findViews(Win32MemMap *map, int nrViews,
    357357                               Win32MemMapView *viewarray[])
    358358{
     
    362362  Win32MemMapView *view = mapviews, *nextview;
    363363
    364   if(view != NULL) 
     364  if(view != NULL)
    365365  {
    366       while(view && i < nrViews) 
     366      while(view && i < nrViews)
    367367      {
    368368          if(view->getParentMap() == map)
     
    384384  Win32MemMapView *view = mapviews, *nextview;
    385385
    386   if(view != NULL) 
     386  if(view != NULL)
    387387  {
    388       while(view) 
     388      while(view)
    389389      {
    390390          nextview = view->next;
     
    404404// Win32MemMap::findMapByView
    405405//
    406 // Find the map of the view that contains the specified starting address 
     406// Find the map of the view that contains the specified starting address
    407407// and has the specified access type
    408408//
  • trunk/src/kernel32/module.cpp

    r7342 r21916  
    1717#include "dbglocal.h"
    1818
    19 #define FILE_strcasecmp  strcmpi
     19#define FILE_strcasecmp  stricmp
    2020
    2121/* Check whether a file is an OS/2 or a very old Windows executable
  • trunk/src/kernel32/network.cpp

    r7603 r21916  
    1919#define DBG_LOCALLOG    DBG_network
    2020#include "dbglocal.h"
     21
     22extern "C" {
    2123
    2224//******************************************************************************
     
    6769//******************************************************************************
    6870//******************************************************************************
     71
     72} // extern "C"
  • trunk/src/kernel32/ole2nls.c

    r21355 r21916  
    1616#include <heapstring.h>
    1717#include <ctype.h>
     18#ifndef __GNUC__
    1819#include <wcstr.h>
     20#endif
    1921#endif
    2022
     
    19261928#ifdef __WIN32OS2__
    19271929    /* For WCHAR we better use the WCHAR toupper/lower.
    1928      * (VAC308 toupper/tolower doesn't do range checks according to standards 
     1930     * (VAC308 toupper/tolower doesn't do range checks according to standards
    19291931     *  which may cause illegal memory reads access when misused like it were here.
    19301932     */
  • trunk/src/kernel32/ordinals.cpp

    r6646 r21916  
    1313 *****************************************************************************/
    1414#include <os2win.h>
     15#include <string.h>
    1516#include <winnls.h>
    1617#include "unicode.h"
    1718#include "handlemanager.h"
    18 #include <string.h>
    1919
    2020#include "stubs.h"
     
    3232 *****************************************************************************/
    3333
    34 
    35 
    3634/*****************************************************************************
    3735 * Prototypes                                                                *
    3836 *****************************************************************************/
     37
     38extern "C" {
    3939
    4040/*****************************************************************************
     
    142142           arg3));
    143143}
     144
     145} // extern "C"
  • trunk/src/kernel32/os2heap.h

    r7728 r21916  
    4242    ~OS2Heap();
    4343
    44     HANDLE INLINE getHeapHandle()  { return(hPrimaryHeap); };
     44    HANDLE getHeapHandle()  { return(hPrimaryHeap); };
    4545
    4646    LPVOID Alloc(DWORD dwFlags, DWORD dwBytes);
  • trunk/src/kernel32/oslibdebug.cpp

    r10433 r21916  
    2323#include <string.h>
    2424#include <misc.h>
    25 #include <windllbase.h>
     25#include "windllbase.h"
    2626#include <winconst.h>
    2727#include "oslibdebug.h"
     
    4242typedef struct
    4343{
    44     LPSTR pszMsg;
     44    LPCSTR pszMsg;
    4545    UINT msg;
    4646} MSGDESC, *PMSGDESC;
     
    6565INT gcMessages = sizeof(debugMsgs) / sizeof(MSGDESC);
    6666
    67 char *GetDebugMsgText(int Msg)
     67const char *GetDebugMsgText(int Msg)
    6868{
    6969 static char msgtxt[64];
  • trunk/src/kernel32/oslibdos.cpp

    r21675 r21916  
    8888static  CDDRVLTR    cdDrvLtr = {0xffff, 0xffff};
    8989
     90extern "C" {
    9091
    9192/*******************************************************************************
     
    9899static ULONG crc32str(const char *psz);
    99100
    100 char* ODINHelperStripUNC(char* strUNC)
    101 {
    102     char *retStr = strUNC;
     101LPCSTR ODINHelperStripUNC(LPCSTR strUNC)
     102{
     103    LPCSTR retStr = strUNC;
    103104
    104105    if (!strUNC) return NULL;
     
    460461//******************************************************************************
    461462//******************************************************************************
    462 DWORD OSLibDosOpen(char *lpszFileName, DWORD flags)
     463DWORD OSLibDosOpen(LPCSTR lpszFileName, DWORD flags)
    463464{
    464465 APIRET rc;
     
    721722//******************************************************************************
    722723//******************************************************************************
    723 BOOL OSLibDosDelete(char *lpszFileName)
     724BOOL OSLibDosDelete(LPCSTR lpszFileName)
    724725{
    725726    APIRET rc;
     
    850851DWORD WIN32API GetEnvironmentVariableA(LPCSTR, LPSTR, DWORD );
    851852//******************************************************************************
    852 DWORD OSLibDosSearchPath(DWORD cmd, char *path, char *name, char *full_name,
    853                          DWORD length_fullname)
     853DWORD OSLibDosSearchPath(DWORD cmd, LPCSTR path, LPCSTR name,
     854                         LPSTR full_name, DWORD length_fullname)
    854855{
    855856  switch(cmd) {
     
    947948   APIRET  rc = ERROR_NOT_ENOUGH_MEMORY;
    948949
    949    CHAR* lpszFileLoc = ODINHelperStripUNC(lpszFile);
     950   LPCSTR lpszFileLoc = ODINHelperStripUNC(lpszFile);
    950951
    951952   //TODO: lpSecurityAttributes (inheritance)
     
    35893590}
    35903591
     3592} // extern "C"
     3593
  • trunk/src/kernel32/oslibdos.h

    r21564 r21916  
    1717#endif
    1818
    19 char* ODINHelperStripUNC(char* strUNC);
     19LPCSTR ODINHelperStripUNC(LPCSTR strUNC);
    2020
    2121#ifdef OS2_INCLUDED
     
    4646#define OSLIB_ACCESS_SHAREDENYWRITE     16
    4747
    48 DWORD OSLibDosOpen(char *lpszFileName, DWORD flags);
     48DWORD OSLibDosOpen(LPCSTR lpszFileName, DWORD flags);
    4949BOOL OSLibDosClose(DWORD hFile);
    50 BOOL OSLibDosDelete(char *lpszFileName);
     50BOOL OSLibDosDelete(LPCSTR lpszFileName);
    5151BOOL OSLibDosCopyFile(LPCSTR lpszOldFile, LPCSTR lpszNewFile, BOOL fFailIfExist);
    5252BOOL OSLibDosMoveFile(LPCSTR lpszOldFile, LPCSTR lpszNewFile);
     
    6565#define OSLIB_SEARCHENV         4
    6666
    67 DWORD OSLibDosSearchPath(DWORD cmd, char *path, char *name, char *full_name, DWORD length_fullname);
     67DWORD OSLibDosSearchPath(DWORD cmd, LPCSTR path, LPCSTR name,
     68                         LPSTR full_name, DWORD length_fullname);
    6869
    6970#ifndef FIL_QUERYFULLNAME
     
    366367#endif
    367368
     369#ifdef __cplusplus
     370INLINE LPSTR ODINHelperStripUNC(LPSTR strUNC)
     371{
     372    return (LPSTR)ODINHelperStripUNC((LPCSTR) strUNC);
     373}
     374#endif
     375
    368376#endif //__OSLIBDOS_H__
    369377
  • trunk/src/kernel32/osliblvm.cpp

    r21583 r21916  
    2121#include <win32type.h>
    2222#include <winconst.h>
    23 #include <win\winioctl.h>
     23#include <win/winioctl.h>
    2424#include "osliblvm.h"
    2525
     
    8989    rc = DosQueryProcAddr(hModLVM, 0, "Write_Sectors", (PFN *)&pfnWrite_Sectors);
    9090    if(rc) goto fail;
    91    
     91
    9292    return TRUE;
    9393
     
    267267    Volume_Control_Array *volctrl;
    268268    CARDINAL32            lasterror;
    269    
     269
    270270    if(!hModLVM) {
    271271        dprintf(("LVM dll not loaded -> fail"));
     
    310310//******************************************************************************
    311311//******************************************************************************
    312 BOOL OSLibLVMQueryVolumeName(HANDLE hVolumeControlData, ULONG *pVolIndex, 
     312BOOL OSLibLVMQueryVolumeName(HANDLE hVolumeControlData, ULONG *pVolIndex,
    313313                             LPSTR lpszVolumeName, DWORD cchBufferLength)
    314314{
     
    346346static Volume_Information_Record OSLibLVMFindVolumeByDriveLetter(ULONG driveLetter,
    347347                                                                 Volume_Control_Record *pVolRec,
    348                                                                  CARDINAL32 *lasterror) 
     348                                                                 CARDINAL32 *lasterror)
    349349{
    350350    Volume_Control_Array      *volctrl;
     
    356356        return volinfo;
    357357    }
    358     for(int i=0;i<volctrl->Count;i++) {
     358    int i;
     359    for(i=0;i<volctrl->Count;i++) {
    359360        volinfo = Get_Volume_Information(volctrl->Volume_Control_Data[i].Volume_Handle, lasterror);
    360361        if(*lasterror != LVM_ENGINE_NO_ERROR) {
     
    384385static Volume_Information_Record OSLibLVMFindVolumeByName(LPSTR pszVolName,
    385386                                                          Volume_Control_Record *pVolRec,
    386                                                           CARDINAL32 *lasterror) 
     387                                                          CARDINAL32 *lasterror)
    387388{
    388389    Volume_Control_Array      *volctrl;
     
    394395        return volinfo;
    395396    }
    396     for(int i=0;i<volctrl->Count;i++) {
     397    int i;
     398    for(i=0;i<volctrl->Count;i++) {
    397399        volinfo = Get_Volume_Information(volctrl->Volume_Control_Data[i].Volume_Handle, lasterror);
    398400        if(*lasterror != LVM_ENGINE_NO_ERROR) {
     
    499501        return FALSE;
    500502    }
    501     for(int i=0;i<diskinfo.Count;i++) {
     503    int i;
     504    for(i=0;i<diskinfo.Count;i++) {
    502505        if(diskinfo.Drive_Control_Data[i].Drive_Handle == partctrl.Partition_Array[0].Drive_Handle) {
    503506            //win32 base = 0, os2 base = 1
     
    564567//            - -1 if volume wasn't found
    565568//            - 0 if volume is present, but not mounted
    566 //   
     569//
    567570//******************************************************************************
    568571CHAR OSLibLVMQueryDriveFromVolumeName(LPCSTR lpszVolume)
     
    596599//******************************************************************************
    597600//******************************************************************************
    598 DWORD OSLibLVMQueryVolumeSerialAndName(LPSTR lpszVolume, LPDWORD lpVolumeSerialNumber, 
     601DWORD OSLibLVMQueryVolumeSerialAndName(LPSTR lpszVolume, LPDWORD lpVolumeSerialNumber,
    599602                                       LPSTR lpVolumeNameBuffer, DWORD nVolumeNameSize)
    600603{
     
    621624//******************************************************************************
    622625//******************************************************************************
    623 BOOL OSLibLVMGetVolumeNameForVolumeMountPoint(LPCSTR lpszVolumeMountPoint, 
    624                                               LPSTR lpszVolumeName, 
     626BOOL OSLibLVMGetVolumeNameForVolumeMountPoint(LPCSTR lpszVolumeMountPoint,
     627                                              LPSTR lpszVolumeName,
    625628                                              DWORD cchBufferLength)
    626629{
     
    665668    strncpy(lpszOS2VolumeName, &lpszWin32VolumeName[sizeof(VOLUME_NAME_PREFIX)-1+1], cchBufferLength-1);  //-zero term + starting '{'
    666669    length -= sizeof(VOLUME_NAME_PREFIX)-1+1;
    667     if(lpszOS2VolumeName[length-2] == '}') 
     670    if(lpszOS2VolumeName[length-2] == '}')
    668671    {
    669672        lpszOS2VolumeName[length-2] = 0;
     
    671674    }
    672675    else
    673     if(lpszOS2VolumeName[length-1] == '}') 
     676    if(lpszOS2VolumeName[length-1] == '}')
    674677    {
    675678        lpszOS2VolumeName[length-1] = 0;
  • trunk/src/kernel32/osliblvm.h

    r9693 r21916  
    1515#endif
    1616
    17 #include <win\winioctl.h>
     17#include <win/winioctl.h>
    1818
    1919#ifdef OS2_INCLUDED
     
    3030typedef unsigned long      LBA;
    3131
    32 /* Define a Partition Sector Number.  A Partition Sector Number is 
    33    relative to the start of a partition. The first sector in a partition 
     32/* Define a Partition Sector Number.  A Partition Sector Number is
     33   relative to the start of a partition. The first sector in a partition
    3434   is PSN 0. */
    3535typedef unsigned long      PSN;
     
    330330HANDLE OSLibLVMQueryVolumeControlData();
    331331void   OSLibLVMFreeVolumeControlData(HANDLE hVolumeControlData);
    332 BOOL   OSLibLVMQueryVolumeName(HANDLE hVolumeControlData, ULONG *pVolIndex, 
     332BOOL   OSLibLVMQueryVolumeName(HANDLE hVolumeControlData, ULONG *pVolIndex,
    333333                               LPSTR lpszVolumeName, DWORD cchBufferLength);
    334334
     
    338338ULONG  OSLibLVMGetDriveType(LPCSTR lpszVolume);
    339339CHAR   OSLibLVMQueryDriveFromVolumeName(LPCSTR lpszVolume);
    340 BOOL   OSLibLVMGetVolumeNameForVolumeMountPoint(LPCSTR lpszVolumeMountPoint, LPSTR lpszVolumeName, 
     340BOOL   OSLibLVMGetVolumeNameForVolumeMountPoint(LPCSTR lpszVolumeMountPoint, LPSTR lpszVolumeName,
    341341                                                DWORD cchBufferLength);
    342342
  • trunk/src/kernel32/oslibmem.cpp

    r21339 r21916  
    3131#include <win32api.h>
    3232#include <winconst.h>
    33 #include <win\winioctl.h>
     33#include <win/winioctl.h>
    3434#include <dbglog.h>
    3535#include <vmutex.h>
     
    9191        tmp = allocrecords;
    9292        while(tmp->next) {
    93             if(tmp->next->baseaddr > baseaddr) {     
     93            if(tmp->next->baseaddr > baseaddr) {
    9494                break;
    9595            }
     
    121121        tmp = allocrecords;
    122122        while(tmp->next) {
    123             if(tmp->next->baseaddr == baseaddr) {     
     123            if(tmp->next->baseaddr == baseaddr) {
    124124                break;
    125125            }
     
    181181    DWORD pAlias = (DWORD)*ppbAlias;
    182182
    183     while(pAlias < (DWORD)*ppbAlias + cb) 
     183    while(pAlias < (DWORD)*ppbAlias + cb)
    184184    {
    185185        rc = DosQueryMem((PVOID)pAlias, &size, &attr);
     
    189189            return rc;
    190190        }
    191         //Don't bother if the pages are not committed. DosSetMem will return 
    192         //ERROR_ACCESS_DENIED. 
     191        //Don't bother if the pages are not committed. DosSetMem will return
     192        //ERROR_ACCESS_DENIED.
    193193        if(attr & PAG_COMMIT) {
    194194            rc = DosSetMem((PVOID)pAlias, size, fl);
     
    325325        fMemFlags = 0;
    326326    }
    327    
     327
    328328    /*
    329329     * Let's try use the extended DosAllocMem API of Win32k.sys.
     
    358358    }
    359359    // already 64k aligned ?
    360     if((ULONG) pvMemAddr & 0xFFFF) 
     360    if((ULONG) pvMemAddr & 0xFFFF)
    361361    {
    362362        ULONG addr64kb;
     
    371371            return rc;
    372372        }
    373        
     373
    374374        PVOID baseAddr = (PVOID)addr64kb; // sunlover20040613: save returned address for a possible Free on failure
    375        
     375
    376376        dprintf(("Allocate aligned memory %x -> %x", addr64kb, (addr64kb + 0xFFFF) & ~0xFFFF));
    377377
     
    409409
    410410    *lpAttr = 0;
    411    
     411
    412412    if(FindAllocRec((ULONG)lpMemAddr, &ulBase, &ulSize, lpAttr) == TRUE) {
    413413        return (PVOID)ulBase;
    414414    }
    415    
     415
    416416    ulSize = PAGE_SIZE;
    417417    rc = DosQueryMem(lpMemAddr, &ulSize, &ulAttr);
     
    463463
    464464    //Find base within previous 64kb (alignment can add filler pages)
    465     for(int i=0;i<16;i++) {
     465    int i;
     466    for(i=0;i<16;i++) {
    466467        rc = DosQueryMem((PVOID)ulAddr, &ulSize, &ulAttr);
    467468        if(rc != NO_ERROR) {
     
    482483    }
    483484    FreeAllocRec((ULONG)lpMemAddr);
    484    
     485
    485486    RasRemoveObject (rthVirtual, (ULONG)lpMemAddr);
    486487
  • trunk/src/kernel32/oslibwps.cpp

    r9889 r21916  
    3737     *pszFilename1 = 0;
    3838}
     39
     40extern "C" {
     41
    3942//******************************************************************************
    4043// ODIN_DisableFolderShellLink
    4144//
    42 // Disable object creation in Odin folder. Desktop shortcuts will still be 
     45// Disable object creation in Odin folder. Desktop shortcuts will still be
    4346// created as WPS objects on the desktop.
    4447//
     
    8487       }
    8588   }
    86    else { 
     89   else {
    8790       dprintf(("OSLibWinCreateObject: pszLink == NULL!!"));
    8891       goto fail;
     
    115118
    116119   fWin32App = ODIN_IsWin32App(pszPath);
    117    if(!fWin32App) 
     120   if(!fWin32App)
    118121   {//don't use the PE loader; use the program path directly
    119122        sprintf(pszSetupString, "PROGTYPE=PM;OBJECTID=<%s%s>;EXENAME=%s;SET BEGINLIBPATH=%s;STARTUPDIR=%s;ICONFILE=%s;PARAMETERS=", (fDesktop) ? WPS_SHELLLINK_DESKTOP : "", pszName, pszPath, szSystemDir, szWorkDir, pszIcoPath);
     
    182185    strcpy(szLinkFile, lpszLink);
    183186    strupr(szLinkFile);
    184     if(strstr(szLinkFile, ".LNK")) 
     187    if(strstr(szLinkFile, ".LNK"))
    185188    {//could be a shelllink file, check for magic string at start of the file
    186189       FILE *lnkfile;
     
    190193
    191194       char  szMagic[sizeof(WPS_SHELLLINK_MAGIC)];
    192  
     195
    193196       memset(szMagic, 0, sizeof(szMagic));
    194197       fread(szMagic, sizeof(szMagic)-1, 1, lnkfile);
     
    203206//******************************************************************************
    204207// OSLibWinDeleteObject
    205 // 
     208//
    206209// Delete object with object id stored in the file
    207210//
    208211// Parameters:
    209 // 
     212//
    210213//     LPSTR lpszLink        - shelllink file
    211214//
     
    226229
    227230    char  szMagic[sizeof(WPS_SHELLLINK_MAGIC)];
    228  
     231
    229232    memset(szMagic, 0, sizeof(szMagic));
    230233    fread(szMagic, sizeof(szMagic)-1, 1, lnkfile);
    231234
    232     if(!strcmp(szMagic, WPS_SHELLLINK_MAGIC)) 
     235    if(!strcmp(szMagic, WPS_SHELLLINK_MAGIC))
    233236    {
    234237        fseek(lnkfile, 0, SEEK_END);
    235238        wpsobjectidsize = ftell(lnkfile) - sizeof(WPS_SHELLLINK_MAGIC) + 2;
    236239        fseek(lnkfile, sizeof(WPS_SHELLLINK_MAGIC)-1, SEEK_SET);
    237        
     240
    238241        memset(szObjectId, 0, sizeof(szObjectId));
    239242        szObjectId[0] = '<';
     
    251254//******************************************************************************
    252255//******************************************************************************
     256
     257} // extern "C"
  • trunk/src/kernel32/overlappedio.cpp

    r10185 r21916  
    179179//******************************************************************************
    180180//******************************************************************************
    181 DWORD CALLBACK OverlappedIOThread(LPVOID lpThreadParam)
     181DWORD CALLBACK OverlappedIOHandler::OverlappedIOThread(LPVOID lpThreadParam)
    182182{
    183183    LPOVERLAPPED_THREAD_PARAM threadparam = (LPOVERLAPPED_THREAD_PARAM)lpThreadParam;
     
    281281                else lpRequest->dwLastError = lpWriteHandler(lpRequest, &dwResult, NULL);
    282282
    283                 if(!lpRequest->fCancelled) 
     283                if(!lpRequest->fCancelled)
    284284                {
    285285                    lpOverlapped->Internal     = lpRequest->dwLastError;
     
    533533    for(int i=ASYNC_INDEX_READ;i<NR_ASYNC_OPERATIONS;i++)
    534534    {
    535         while(TRUE) 
     535        while(TRUE)
    536536        {
    537537            lpRequest = findAndRemoveRequest(i, hHandle);
  • trunk/src/kernel32/perfview.cpp

    r7413 r21916  
    2828#else
    2929
     30#include <process.h>
     31
    3032#include <ccollection.h>
    3133#include <winbase.h>
    3234
    3335// imported from the kernel loader (initterm)
    34 extern int loadNr;
    3536extern char  kernel32Path[];
    3637
     
    348349  char szFilename[260];
    349350
    350   sprintf(szFilename, "perf_%d.log", loadNr);
     351  sprintf(szFilename, "perf_%d.log", getpid());
    351352  _privateLogFile = fopen(szFilename, "w");
    352353 
    353354  if(_privateLogFile == NULL)
    354355  {
    355     sprintf(szFilename, "%sperf_%d.log", kernel32Path, loadNr);
     356    sprintf(szFilename, "%sperf_%d.log", kernel32Path, getpid());
    356357    _privateLogFile = fopen(szFilename, "w");
    357358  }
  • trunk/src/kernel32/process.cpp

    r10445 r21916  
    2727#include <misc.h>
    2828#include <wprocess.h>
    29 #include <win\task.h>
    30 #include <winimagebase.h>
     29#include <win/task.h>
     30#include "winimagebase.h"
    3131#include "oslibdos.h"
    3232
     
    4040static        DWORD ProcessAffinityMask = 1;
    4141static PDB *PROCESS_First = &ProcessPDB;
     42
     43extern "C" {
    4244
    4345/***********************************************************************
     
    151153 * GetProcessHeaps [KERNEL32.376]
    152154 */
    153 DWORD WINAPI GetProcessHeaps(DWORD nrofheaps,HANDLE *heaps) 
     155DWORD WINAPI GetProcessHeaps(DWORD nrofheaps,HANDLE *heaps)
    154156{
    155157    dprintf(("GetProcessHeaps: (%ld,%p), incomplete implementation.\n",nrofheaps,heaps));
     
    310312    if ( !process ) return 0;
    311313
    312     switch ( offset ) 
     314    switch ( offset )
    313315    {
    314316    case GPD_APP_COMPAT_FLAGS:
     
    379381
    380382/***********************************************************************
    381  *           ODIN_SetProcessDword   
     383 *           ODIN_SetProcessDword
    382384 *
    383385 * SvL: Special version that allows the caller to change some values
     
    391393    if ( !process ) return;
    392394
    393     switch ( offset ) 
     395    switch ( offset )
    394396    {
    395397    case GPD_STARTF_SHOWWINDOW:
     
    424426    if ( !process ) return;
    425427
    426     switch ( offset ) 
     428    switch ( offset )
    427429    {
    428430    case GPD_APP_COMPAT_FLAGS:
     
    444446
    445447    case GPD_USERDATA:
    446         process->process_dword = value; 
     448        process->process_dword = value;
    447449        break;
    448450
     
    488490  if(!NtdllRtlExtendedIntegerMultiply) {
    489491        HINSTANCE hInstance = LoadLibraryA("NTDLL.DLL");
    490         if(hInstance) 
     492        if(hInstance)
    491493                *(VOID **)&NtdllRtlExtendedIntegerMultiply=(void*)GetProcAddress(hInstance, (LPCSTR)"RtlExtendedIntegerMultiply");
    492494  }
     
    515517//******************************************************************************
    516518//******************************************************************************
     519
     520} // extern "C"
     521
  • trunk/src/kernel32/profile.cpp

    r21355 r21916  
    219219    PROFILESECTION **next_section;
    220220    PROFILEKEY *key, *prev_key, **next_key;
     221
     222    if (file == NULL)
     223        return NULL;
    221224
    222225    first_section = (PROFILESECTION *)HEAP_xalloc( SystemHeap, 0, sizeof(*section) );
     
    772775}
    773776
     777extern "C" {
     778
    774779int WIN32API PROFILE_SetOdinIniString(LPCSTR section_name, LPCSTR key_name,
    775780                                      LPCSTR value)
     
    10021007    if ( (p = getenv( "ODIN_INI" )) && (f = fopen( p, "r" )) )
    10031008    {
    1004       PROFILE_OdinProfile = PROFILE_Load( f );
    1005       fclose( f );
    1006       strncpy(PROFILE_OdinIniUsed,p,MAX_PATHNAME_LEN);
    1007       PROFILE_OdinIniUsed[MAX_PATHNAME_LEN-1] = 0;
     1009        PROFILE_OdinProfile = PROFILE_Load( f );
     1010        fclose( f );
     1011        strncpy(PROFILE_OdinIniUsed,p,MAX_PATHNAME_LEN);
     1012        PROFILE_OdinIniUsed[MAX_PATHNAME_LEN-1] = 0;
    10081013    }
    10091014    else
    10101015    {
    1011       #if 0 /* Aug 27 2000 4:26am: Why not use the global kernel32Path
    1012              *                (LoadLibrary may cause harm if used...) */
    1013       HINSTANCE hInstance = LoadLibraryA("KERNEL32.DLL");
    1014       GetModuleFileNameA(hInstance,PROFILE_OdinIniUsed,sizeof(PROFILE_OdinIniUsed));
    1015       FreeLibrary(hInstance);
    1016       strcpy(strrchr(PROFILE_OdinIniUsed,'\\')+1,ODINININAME);
    1017       #else
    1018       strcpy(PROFILE_OdinIniUsed, kernel32Path);
    1019       strcat(PROFILE_OdinIniUsed, ODINININAME);
    1020       #endif
    1021       f = fopen(PROFILE_OdinIniUsed, "r");
    1022       PROFILE_OdinProfile = PROFILE_Load(f);
    1023       fclose(f);
     1016        strcpy(PROFILE_OdinIniUsed, kernel32Path);
     1017        strcat(PROFILE_OdinIniUsed, ODINININAME);
     1018        if ((f = fopen(PROFILE_OdinIniUsed, "r")))
     1019        {
     1020            PROFILE_OdinProfile = PROFILE_Load(f);
     1021            fclose(f);
     1022        }
    10241023    }
    10251024
     
    14081407                    *p='\0';
    14091408                    ret = PROFILE_SetString( section, buf, p+1 );
    1410                    
     1409
    14111410                }
    14121411                HeapFree( GetProcessHeap(), 0, buf );
     
    16371636 *           CloseProfileUserMapping   (KERNEL.138)
    16381637 */
    1639 BOOL WINAPI CloseProfileUserMapping(void) 
     1638BOOL WINAPI CloseProfileUserMapping(void)
    16401639{
    16411640    dprintf(("CloseProfileUserMapping: STUB"));
     
    16491648}
    16501649
     1650} // extern "C"
     1651
  • trunk/src/kernel32/profile.h

    r10528 r21916  
    1414#define ODINININAME "ODIN.INI"
    1515
    16 void WINAPI WriteOutProfiles(void);
     16#ifdef __cplusplus
     17extern "C" {
     18#endif
     19
    1720int WINAPI PROFILE_Initialize (void);
    18 int WINAPI PROFILE_LoadOdinIni(void);
    1921
    2022#ifdef DEBUG
     
    4547#endif
    4648
    47 #include <win\options.h> //for odin profile apis
     49#ifdef __cplusplus
     50} // extern "C"
     51#endif
     52
     53#include <win/options.h> //for odin profile apis
    4854
    4955#endif
  • trunk/src/kernel32/queue.h

    r3059 r21916  
    1717{
    1818public:
    19     QueueItem::QueueItem(ULONG dwItemData)
     19    QueueItem(ULONG dwItemData)
    2020    {
    2121        this->dwItemData = dwItemData;
  • trunk/src/kernel32/registry.cpp

    r21302 r21916  
    7979}
    8080
     81extern "C" {
     82
    8183void WIN32API SetRegistryRootKey(HKEY hRootkey, HKEY hKey)
    8284{
    8385  switch((DWORD)hRootkey)
    8486  {
    85     case HKEY_CLASSES_ROOT:   
     87    case HKEY_CLASSES_ROOT:
    8688        hKeyClassesRoot = hKey;
    8789        break;
     
    112114LONG WIN32API RegCloseKey(HKEY hKey)
    113115{
    114     switch(hKey) 
     116    switch(hKey)
    115117    {//Closing a root key should just return success (matters for custom builds)
    116118    case HKEY_CLASSES_ROOT:
     
    166168                        astring,
    167169                        phkResult);
    168  
     170
    169171  if (NULL != astring)
    170172    FreeAsciiString(astring);
    171  
     173
    172174  return(rc);
    173175}
     
    247249                          phkResult,
    248250                          lpdwDisposition);
    249  
     251
    250252  if (NULL != astring1)
    251253    FreeAsciiString(astring1);
    252  
     254
    253255  if (NULL != astring2)
    254256    FreeAsciiString(astring2);
    255  
     257
    256258  return(rc);
    257259}
     
    278280  rc = O32_RegDeleteKey(ConvertKey(hKey),
    279281                        astring);
    280  
     282
    281283  if (NULL != astring)
    282284    FreeAsciiString(astring);
    283  
     285
    284286  return(rc);
    285287}
     
    317319 *****************************************************************************/
    318320
    319 LONG WIN32API RegDeleteValueA(HKEY hKey, LPSTR lpszValue)
     321LONG WIN32API RegDeleteValueA(HKEY hKey, LPCSTR lpszValue)
    320322{
    321323  return O32_RegDeleteValue(ConvertKey(hKey),
     
    336338 *****************************************************************************/
    337339
    338 LONG WIN32API RegDeleteValueW(HKEY hKey, LPWSTR lpszValue)
     340LONG WIN32API RegDeleteValueW(HKEY hKey, LPCWSTR lpszValue)
    339341{
    340342  char *astring = UnicodeToAsciiString(lpszValue);
     
    343345  rc = O32_RegDeleteValue(ConvertKey(hKey),
    344346                          astring);
    345  
     347
    346348  if (NULL != astring)
    347349    FreeAsciiString(astring);
    348  
     350
    349351  return(rc);
    350352}
     
    385387 *****************************************************************************/
    386388
    387 LONG WIN32API RegEnumKeyW(HKEY  hKey, DWORD  iSubKey, LPWSTR lpszName,                         
     389LONG WIN32API RegEnumKeyW(HKEY  hKey, DWORD  iSubKey, LPWSTR lpszName,
    388390                          DWORD cchName)
    389391{
     
    529531 * Author    : Patrick Haller [Tue, 1998/06/16 23:00]
    530532 *****************************************************************************/
    531  
     533
    532534LONG WIN32API RegEnumValueW(HKEY    hkey,
    533535                            DWORD   iValue,
     
    638640  if(rc)
    639641    *arg3 = 0;
    640  
     642
    641643  if (NULL != astring)
    642644    FreeAsciiString(astring);
    643  
     645
    644646  return(rc);
    645647}
     
    705707  if(rc)
    706708    *arg5 = 0;
    707  
     709
    708710  if (NULL != astring)
    709711    FreeAsciiString(astring);
    710  
     712
    711713  return(rc);
    712714}
     
    741743                               lpcchClass, lpdwReserved, lpcSubKeys,
    742744                               lpcchMaxSubKey, lpcchMaxClass, lpcValues,
    743                                lpcchMaxValueName, lpcbMaxValueData, 
     745                               lpcchMaxValueName, lpcbMaxValueData,
    744746                               lpcbSecurityDescriptor,lpftLastWriteTime);
    745747}
     
    776778                             lpcchClass, lpdwReserved, lpcSubKeys,
    777779                             lpcchMaxSubKey, lpcchMaxClass, lpcValues,
    778                              lpcchMaxValueName, lpcbMaxValueData, 
     780                             lpcchMaxValueName, lpcbMaxValueData,
    779781                             lpcbSecurityDescriptor,lpftLastWriteTime);
    780782    if(rc == ERROR_SUCCESS)
     
    786788            free(astring);
    787789        }
    788         else 
     790        else
    789791        if(lpszClass) *lpszClass = 0;
    790792    }
     
    852854  }
    853855
    854   if((rc == ERROR_SUCCESS || rc == ERROR_MORE_DATA) && 
    855      pcbValue) 
     856  if((rc == ERROR_SUCCESS || rc == ERROR_MORE_DATA) &&
     857     pcbValue)
    856858  {
    857859      *pcbValue = *pcbValue * sizeof(WCHAR); //size in bytes!!
    858860  }
    859  
     861
    860862  if (NULL != astring1)
    861863    FreeAsciiString(astring1);
    862  
     864
    863865  return(rc);
    864866}
     
    986988  }
    987989
    988   if((rc == ERROR_SUCCESS || rc == ERROR_MORE_DATA) && 
    989      lpcbData) 
     990  if((rc == ERROR_SUCCESS || rc == ERROR_MORE_DATA) &&
     991     lpcbData)
    990992  {
    991993      switch(*lpdwType) {
     
    10011003  if (NULL != astring)
    10021004    FreeAsciiString(astring);
    1003  
     1005
    10041006  if(akeydata)
    10051007    free(akeydata);
     
    10731075
    10741076  rc = RegSetValueA(hkey, astring1, dwType, astring2, cbData);
    1075  
     1077
    10761078  if (NULL != astring1)
    10771079    FreeAsciiString(astring1);
    1078  
     1080
    10791081  if (NULL != astring2)
    10801082    FreeAsciiString(astring2);
    1081  
     1083
    10821084  return(rc);
    10831085}
     
    11001102                             DWORD  dwReserved,
    11011103                             DWORD  fdwType,
    1102                              BYTE*  lpbData,
     1104                             const BYTE *lpbData,
    11031105                             DWORD  cbData)
    11041106{
     
    11651167                             DWORD  dwReserved,
    11661168                             DWORD  fdwType,
    1167                              BYTE*  lpbData,
     1169                             const BYTE *lpbData,
    11681170                             DWORD  cbData)
    11691171{
     
    11841186  }
    11851187  rc = RegSetValueExA(hkey, astring, dwReserved, fdwType, lpbData, cbData);
    1186  
     1188
    11871189  if(akeydata)
    11881190    FreeAsciiString(akeydata);
    1189  
     1191
    11901192  if (NULL != astring)
    11911193    FreeAsciiString(astring);
    1192  
     1194
    11931195  return(rc);
    11941196}
     
    17151717}
    17161718
     1719} // extern "C"
     1720
  • trunk/src/kernel32/resource.cpp

    r8111 r21916  
    1313#include <os2win.h>
    1414#include <unicode.h>
    15 #include <winimagebase.h>
    16 #include <winexebase.h>
    17 #include <windllbase.h>
     15#include "winimagebase.h"
     16#include "winexebase.h"
     17#include "windllbase.h"
    1818
    1919#define DBG_LOCALLOG    DBG_resource
  • trunk/src/kernel32/seh/sehutil.s

    r21662 r21916  
    178178    subl $4, %esp
    179179    movl %eax, 0(%esp)
    180     call odin_malloc /* _Optlink, rtl, EAX/EDX/ECX-in, caller cleans stack */
     180    call _malloc /* __cdecl (and _Optlink compatible -> EAX/EDX/ECX-in) */
    181181    addl $4, %esp
    182182    testl %eax, %eax
     
    223223    subl $4, %esp
    224224    movl %eax, 0(%esp)
    225     call odin_free /* _Optlink, rtl, EAX/EDX/ECX-in, caller cleans stack */
     225    call _free /* __cdecl (and _Optlink compatible -> EAX/EDX/ECX-in) */
    226226    addl $4, %esp
    227227
  • trunk/src/kernel32/stubs.cpp

    r21324 r21916  
    1515 *****************************************************************************/
    1616#include <os2win.h>
     17#include <string.h>
    1718#include <winnls.h>
    1819#include "unicode.h"
    1920#include "handlemanager.h"
    20 #include <string.h>
    2121
    2222#include "stubs.h"
     
    149149typedef DWORD CALID;
    150150
     151extern "C" {
    151152
    152153/*****************************************************************************
     
    15791580}
    15801581
    1581 
     1582} // extern "C"
     1583
  • trunk/src/kernel32/thread.cpp

    r21626 r21916  
    2626#include <cpuhlp.h>
    2727#include <wprocess.h>
    28 #include <windllbase.h>
    29 #include <winexebase.h>
     28#include "windllbase.h"
     29#include "winexebase.h"
    3030#include "exceptutil.h"
    3131#include "oslibmisc.h"
     
    6161//******************************************************************************
    6262//******************************************************************************
     63extern "C"
    6364HANDLE WIN32API CreateThread(LPSECURITY_ATTRIBUTES  lpsa,
    6465                             DWORD                  cbStack,
     
    115116  return pHandle->hmHandleData.hWin32Handle;
    116117}
     118
     119extern "C" {
     120
    117121/*****************************************************************************
    118122 * Name      : HMGetThreadPriority
     
    370374  return (lpResult);                                  /* deliver return code */
    371375}
     376
     377} // extern "C"
     378
    372379/*****************************************************************************
    373380 * Name      : HMSetThreadTerminated
     
    397404  return (lpResult);                                  /* deliver return code */
    398405}
     406
     407extern "C" {
     408
    399409//******************************************************************************
    400410//******************************************************************************
     
    459469#define MAX_CALLSTACK_SIZE 128
    460470#ifdef DEBUG
    461 static char *pszLastCaller = NULL;
     471static const char *pszLastCaller = NULL;
    462472#endif
    463473//******************************************************************************
    464 void WIN32API dbg_ThreadPushCall(char *pszCaller)
     474void WIN32API dbg_ThreadPushCall(const char *pszCaller)
    465475{
    466476#ifdef DEBUG
     
    654664  return FALSE;
    655665}
     666
     667} // extern "C"
     668
    656669//******************************************************************************
    657670//******************************************************************************
     
    670683//******************************************************************************
    671684//******************************************************************************
    672 DWORD OPEN32API Win32ThreadProc(LPVOID lpData)
     685DWORD OPEN32API Win32Thread::Win32ThreadProc(LPVOID lpData)
    673686{
    674687    EXCEPTION_FRAME  exceptFrame;
  • trunk/src/kernel32/thunk.cpp

    r8449 r21916  
    2323#define DBG_LOCALLOG    DBG_thunk
    2424#include "dbglocal.h"
     25
     26extern "C" {
    2527
    2628/************************************************************************
     
    405407void WINAPI SUnMapLS_IP_EBP_40(CONTEXT86 *context) { x_SUnMapLS_IP_EBP_x(context,40); }
    406408
     409} // extern "C"
     410
  • trunk/src/kernel32/time.cpp

    r21302 r21916  
    3636#include "dbglocal.h"
    3737
     38extern "C" {
    3839
    3940//******************************************************************************
    4041//File time (UTC) to MS-DOS date & time values (also UTC)
    4142//******************************************************************************
    42 BOOL WIN32API FileTimeToDosDateTime(const FILETIME *lpFileTime, LPWORD lpDosDate, 
     43BOOL WIN32API FileTimeToDosDateTime(const FILETIME *lpFileTime, LPWORD lpDosDate,
    4344                                    LPWORD lpDosTime)
    4445{
     
    6061        return FALSE;
    6162    }
    62     return O32_FileTimeToLocalFileTime(lpFileTime, lpLocalTime); 
     63    return O32_FileTimeToLocalFileTime(lpFileTime, lpLocalTime);
    6364}
    6465//******************************************************************************
    6566//Local time to File time (UTC)
    6667//******************************************************************************
    67 BOOL WIN32API LocalFileTimeToFileTime(const FILETIME *lpLocalFileTime, 
     68BOOL WIN32API LocalFileTimeToFileTime(const FILETIME *lpLocalFileTime,
    6869                                      LPFILETIME lpFileTime)
    6970{
     
    9899}
    99100//******************************************************************************
    100 //MS-DOS date & time values (UTC) to File time (also UTC) 
     101//MS-DOS date & time values (UTC) to File time (also UTC)
    101102//******************************************************************************
    102103BOOL WIN32API DosDateTimeToFileTime(WORD wDosDate, WORD wDosTime, LPFILETIME pFileTime)
    103104{
    104105    dprintf(("%x %x", wDosDate, wDosTime));
    105    
     106
    106107    if(pFileTime == NULL) {
    107108        SetLastError(ERROR_INVALID_PARAMETER);
     
    117118}
    118119//******************************************************************************
    119 //The GetLocalTime function retrieves the current local date and time. 
     120//The GetLocalTime function retrieves the current local date and time.
    120121//(in local time)
    121122//******************************************************************************
     
    130131}
    131132//******************************************************************************
    132 //The SetLocalTime function sets the current local time and date. 
     133//The SetLocalTime function sets the current local time and date.
    133134//(in local time)
    134135//******************************************************************************
     
    143144}
    144145//******************************************************************************
    145 //The GetSystemTime function retrieves the current system date and time. 
     146//The GetSystemTime function retrieves the current system date and time.
    146147//The system time is expressed in Coordinated Universal Time (UTC).
    147148//******************************************************************************
     
    157158}
    158159//******************************************************************************
    159 //The SetSystemTime function sets the current system time and date. 
     160//The SetSystemTime function sets the current system time and date.
    160161//The system time is expressed in Coordinated Universal Time (UCT).
    161162//******************************************************************************
     
    185186}
    186187//******************************************************************************
    187 static const LPSTR szTZBias           = "Bias";
    188 static const LPSTR szTZActiveTimeBias = "ActiveTimeBias";
    189 
    190 static const LPWSTR szTZStandardName  = (LPWSTR)L"StandardName";
    191 static const LPSTR szTZStandardBias   = "StandardBias";
    192 static const LPSTR szTZStandardStart  = "StandardStart";
    193 
    194 static const LPWSTR szTZDaylightName  = (LPWSTR)L"DaylightName";
    195 static const LPSTR szTZDaylightBias   = "DaylightBias";
    196 static const LPSTR szTZDaylightStart  = "DaylightStart";
    197 static const LPSTR KEY_WINDOWS_TZ     = "SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation";
     188static const LPCSTR szTZBias           = "Bias";
     189static const LPCSTR szTZActiveTimeBias = "ActiveTimeBias";
     190
     191static const LPCWSTR szTZStandardName  = (LPCWSTR)L"StandardName";
     192static const LPCSTR szTZStandardBias   = "StandardBias";
     193static const LPCSTR szTZStandardStart  = "StandardStart";
     194
     195static const LPCWSTR szTZDaylightName  = (LPCWSTR)L"DaylightName";
     196static const LPCSTR szTZDaylightBias   = "DaylightBias";
     197static const LPCSTR szTZDaylightStart  = "DaylightStart";
     198static const LPCSTR KEY_WINDOWS_TZ     = "SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation";
    198199//******************************************************************************
    199200DWORD WIN32API GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZone)
     
    370371//******************************************************************************
    371372
    372 
     373} // extern "C"
     374
  • trunk/src/kernel32/virtual.cpp

    r21675 r21916  
    2323#include <stdlib.h>
    2424#include <string.h>
    25 #include <win\virtual.h>
    26 #include <win\thread.h>
     25#include <win/virtual.h>
     26#include <win/thread.h>
    2727#include <heapstring.h>
    2828#include <handlemanager.h>
  • trunk/src/kernel32/windllbase.cpp

    r21308 r21916  
    2727#include <string.h>
    2828#include <stdlib.h>
     29#ifndef __GNUC__
    2930#include <iostream.h>
    3031#include <fstream.h>
     32#endif
    3133#include <misc.h>
    3234#include <win32api.h>
    3335#include <pefile.h>
    34 #include <windllbase.h>
    35 #include <winimagepe2lx.h>
    36 #include <windllpe2lx.h>
    37 #include <winimagelx.h>
    38 #include <windlllx.h>
     36#include "windllbase.h"
     37#include "winimagepe2lx.h"
     38#include "windllpe2lx.h"
     39#include "winimagelx.h"
     40#include "windlllx.h"
    3941#include <wprocess.h>
    4042#include "exceptions.h"
     
    726728 char renameddll[CCHMAXPATH];
    727729 char *namestart;
    728  char *sectionname;
     730 const char *sectionname;
    729731
    730732    if(fWinToOS2) {
     
    791793    dll = head;
    792794    while(dll) {
    793         if(strcmpi(szDllName, dll->szModule) == 0) {
     795        if(stricmp(szDllName, dll->szModule) == 0) {
    794796            dlllistmutex.leave();
    795797            return(dll);
  • trunk/src/kernel32/windllbase.h

    r10397 r21916  
    1313#define __WINDLLBASE_H__
    1414
    15 #include <winimagebase.h>
     15#include "winimagebase.h"
    1616#include <odinlx.h>
    1717#include <vmutex.h>
  • trunk/src/kernel32/windlllx.cpp

    r10397 r21916  
    2424#include <string.h>
    2525#include <stdlib.h>
     26#ifndef __GNUC__
    2627#include <iostream.h>
    2728#include <fstream.h>
     29#endif
    2830#include <misc.h>
    2931#include <win32type.h>
    30 #include <windllbase.h>
    31 #include <windlllx.h>
     32#include "windllbase.h"
     33#include "windlllx.h"
    3234#include "winexepe2lx.h"
    3335#include "winexepeldr.h"
  • trunk/src/kernel32/windlllx.h

    r10397 r21916  
    1313#define __WINDLLLX_H__
    1414
    15 #include <windllbase.h>
    16 #include <winimagelx.h>
     15#include "windllbase.h"
     16#include "winimagelx.h"
    1717
    1818#define HACK_NEVER_UNLOAD_LX_DLLS
  • trunk/src/kernel32/windllpe2lx.cpp

    r10397 r21916  
    2727#include <win32type.h>
    2828#include <misc.h>
    29 #include <windllpe2lx.h>
    30 #include <winexepe2lx.h>
     29#include "windllpe2lx.h"
     30#include "winexepe2lx.h"
    3131#include <wprocess.h>
    3232#include <odinpe.h>
     
    4343*******************************************************************************/
    4444extern BOOL fPeLoader;
     45
     46extern "C" {
    4547
    4648/**
     
    134136}
    135137
     138} // extern "C"
    136139
    137140/**
  • trunk/src/kernel32/windllpe2lx.h

    r10397 r21916  
    1313#define __WINDLLPE2LX_H__
    1414
    15 #include <windllbase.h>
    16 #include <winimagepe2lx.h>
     15#include "windllbase.h"
     16#include "winimagepe2lx.h"
    1717
    1818/**
     
    2525public:
    2626    /** @cat Constructor/Destructor */
    27     Win32Pe2LxDll(HINSTANCE hinstance, BOOL fWin32k) throw(ULONG);
     27    Win32Pe2LxDll(HINSTANCE hinstance, BOOL fWin32k);
    2828    virtual     ~Win32Pe2LxDll();
    2929    DWORD       init();
  • trunk/src/kernel32/windllpeldr.cpp

    r10397 r21916  
    2121#include <string.h>
    2222#include <stdlib.h>
     23#ifndef __GNUC__
    2324#include <iostream.h>
    2425#include <fstream.h>
     26#endif
    2527#include <misc.h>
    2628#include <win32type.h>
    2729#include <pefile.h>
    28 #include <windllpeldr.h>
     30#include "windllpeldr.h"
    2931#include <wprocess.h>
    3032
  • trunk/src/kernel32/windllpeldr.h

    r10397 r21916  
    1313#define __WINDLLPELDR_H__
    1414
    15 #include <windllbase.h>
    16 #include <winimagepeldr.h>
     15#include "windllbase.h"
     16#include "winimagepeldr.h"
    1717
    1818class Win32PeLdrDll : public Win32PeLdrImage, public Win32DllBase
  • trunk/src/kernel32/winexebase.cpp

    r9667 r21916  
    1919#include <string.h>
    2020#include <stdlib.h>
     21#ifndef __GNUC__
    2122#include <iostream.h>
    2223#include <fstream.h>
     24#endif
    2325#include <misc.h>
    2426#include <win32type.h>
    25 #include <winexebase.h>
    26 #include <windllbase.h>
     27#include "winexebase.h"
     28#include "windllbase.h"
    2729#include <wprocess.h>
    2830#include <pefile.h>
     
    4244//******************************************************************************
    4345//******************************************************************************
    44 BOOL IsExeStarted()
     46extern "C" BOOL IsExeStarted()
    4547{
    4648    return fExeStarted;
  • trunk/src/kernel32/winexebase.h

    r9667 r21916  
    1313#define __WINEXEBASE_H__
    1414
    15 #include <winimagebase.h>
     15#include "winimagebase.h"
    1616
    1717typedef ULONG (* WIN32API WIN32EXEENTRY)(LPVOID);
     
    3131
    3232virtual ULONG  getDefaultStackSize();
    33        
     33
    3434protected:
    3535        BOOL   fConsoleApp;
  • trunk/src/kernel32/winexedummy.cpp

    r21302 r21916  
    2121#include <misc.h>
    2222#include <win32type.h>
    23 #include <winexedummy.h>
     23#include "winexedummy.h"
    2424#include <winconst.h>
    2525#include <win32api.h>
  • trunk/src/kernel32/winexedummy.h

    r7797 r21916  
    1313#define __WINEXEDUMMY_H__
    1414
    15 #include <winexebase.h>
    16 #include <winimagelx.h>
     15#include "winexebase.h"
     16#include "winimagelx.h"
    1717#include <odinlx.h>
    1818
  • trunk/src/kernel32/winexelx.cpp

    r21434 r21916  
    1919#include <string.h>
    2020#include <stdlib.h>
     21#ifndef __GNUC__
    2122#include <iostream.h>
    2223#include <fstream.h>
     24#endif
    2325#include <misc.h>
    2426#include <win32type.h>
    25 #include <winexelx.h>
     27#include "winexelx.h"
    2628#include <winconst.h>
    2729#include <win32api.h>
  • trunk/src/kernel32/winexelx.h

    r3074 r21916  
    1313#define __WINEXELX_H__
    1414
    15 #include <winexebase.h>
    16 #include <winimagelx.h>
     15#include "winexebase.h"
     16#include "winimagelx.h"
    1717#include <odinlx.h>
    1818
  • trunk/src/kernel32/winexepe2lx.cpp

    r10397 r21916  
    4949BOOL Win32Pe2LxExe::fEarlyInit = FALSE;
    5050
     51extern "C" {
    5152
    5253/**
     
    235236//******************************************************************************
    236237//******************************************************************************
     238
     239} // extern "C"
  • trunk/src/kernel32/winexepe2lx.h

    r8436 r21916  
    1313#define __WINEXEPE2LX_H__
    1414
    15 #include <winexebase.h>
    16 #include <winimagepe2lx.h>
     15#include "winexebase.h"
     16#include "winimagepe2lx.h"
    1717
    1818
  • trunk/src/kernel32/winexepeldr.cpp

    r10397 r21916  
    1919#include <string.h>
    2020#include <stdlib.h>
     21#ifndef __GNUC__
    2122#include <iostream.h>
    2223#include <fstream.h>
     24#endif
    2325#include <misc.h>
    2426#include <win32type.h>
    2527#include <win32api.h>
    26 #include <winexepeldr.h>
     28#include "winexepeldr.h"
    2729#include <wprocess.h>
    2830#include <pefile.h>
     
    5355//Called by ring 3 pe loader to create win32 executable
    5456//PE.EXE command line options:
    55 //   /OPT:[x1=y,x2=z,..]         
     57//   /OPT:[x1=y,x2=z,..]
    5658//   x = CURDIR    -> set current directory to y
    5759//   (not other options available at this time)
    5860//******************************************************************************
     61extern "C"
    5962DWORD WIN32API CreateWin32PeLdrExe(char *szFileName, char *szCmdLine,
    60                                    char *peoptions, 
     63                                   char *peoptions,
    6164                                   ULONG reservedMem, ULONG ulPEOffset,
    6265                                   BOOL fConsoleApp, BOOL fVioConsole,
     
    118121  free(szFullCmdLine);
    119122
    120   //Init console before loading executable as dlls might want to print 
     123  //Init console before loading executable as dlls might want to print
    121124  //something on the console while being loaded
    122   if(WinExe->isConsoleApp()) 
     125  if(WinExe->isConsoleApp())
    123126  {
    124127      dprintf(("Console application!\n"));
     
    142145  }
    143146  OS2UnsetExceptionHandler(&exceptFrame);
    144  
     147
    145148#ifdef PROFILE
    146149  // Note: after this point, we might start collecting performance
     
    150153  ProfilerEnable(TRUE);
    151154#endif /* PROFILE */
    152  
    153  
     155
     156
    154157  WinExe->start();
    155158
  • trunk/src/kernel32/winexepeldr.h

    r9667 r21916  
    1313#define __WINEXEPELDR_H__
    1414
    15 #include <winexebase.h>
    16 #include <winimagepeldr.h>
     15#include "winexebase.h"
     16#include "winimagepeldr.h"
    1717
    1818//Class for executables run by the ring 3 PE loader
  • trunk/src/kernel32/winimagebase.cpp

    r21339 r21916  
    2828#include <misc.h>
    2929#include <win32type.h>
    30 #include <winimagebase.h>
    31 #include <windllbase.h>
    32 #include <winexebase.h>
    33 #include <windlllx.h>
     30#include "winimagebase.h"
     31#include "windllbase.h"
     32#include "winexebase.h"
     33#include "windlllx.h"
    3434#include <pefile.h>
    3535#include <unicode.h>
     
    3838#include "initterm.h"
    3939#include "directory.h"
    40 #include <win\virtual.h>
     40#include <win/virtual.h>
    4141#include <winconst.h>
    4242
  • trunk/src/kernel32/winimagebase.h

    r10397 r21916  
    2020#include <winconst.h>
    2121#else
    22 #include <win\winnls.h>
     22#include <win/winnls.h>
    2323#endif
    2424
  • trunk/src/kernel32/winimagelx.cpp

    r10397 r21916  
    3232#include <misc.h>
    3333#include <win32type.h>
    34 #include <winimagebase.h>
    35 #include <winimagelx.h>
    36 #include <windllbase.h>
    37 #include <winexebase.h>
    38 #include <winexelx.h>
    39 #include <windlllx.h>
     34#include "winimagebase.h"
     35#include "winimagelx.h"
     36#include "windllbase.h"
     37#include "winexebase.h"
     38#include "winexelx.h"
     39#include "windlllx.h"
    4040#include <pefile.h>
    4141#include <unicode.h>
    4242#include "oslibmisc.h"
    4343#include "initterm.h"
    44 #include <win\virtual.h>
     44#include <win/virtual.h>
    4545
    4646#define DBG_LOCALLOG    DBG_winimagelx
  • trunk/src/kernel32/winimagelx.h

    r10397 r21916  
    1313#define __WINIMAGELX_H__
    1414
    15 #include <winimagebase.h>
     15#include "winimagebase.h"
    1616
    1717class Win32LxImage : public virtual Win32ImageBase
  • trunk/src/kernel32/winimagepe2lx.cpp

    r10397 r21916  
    440440                           + strlen((char*)pLrec->pName) + 1    /* size of the filename */
    441441                           + 3) & ~3));                          /* the size is align on 4 bytes boundrary */
     442#ifdef __INNOTEK_LIBC__
     443                    pLrec->pNextRec = (void **)(qsLrec_t*)((char*)pLrec->pObjInfo
     444                                                   + sizeof(qsLObjrec_t) * pLrec->ctObj);
     445#else
    442446                    pLrec->pNextRec = (qsLrec_t*)((char*)pLrec->pObjInfo
    443447                                                   + sizeof(qsLObjrec_t) * pLrec->ctObj);
     448#endif
    444449                    }
    445450                if (pLrec->hmte == hmod)
     
    549554
    550555            /* loop thru the PE sections */
    551             for (int i = 0; i < pNtHdrs->FileHeader.NumberOfSections; i++)
     556            int i;
     557            for (i = 0; i < pNtHdrs->FileHeader.NumberOfSections; i++)
    552558            {
    553559                if (paSections[0].cbVirtual < paPESections[i].VirtualAddress)
  • trunk/src/kernel32/winimagepe2lx.h

    r10397 r21916  
    1313#define __WINIMAGEPE2LX_H__
    1414
    15 #include <winimagebase.h>
     15#include "winimagebase.h"
    1616
    1717
  • trunk/src/kernel32/winimagepeldr.cpp

    r21355 r21916  
    4040#include <stdlib.h>
    4141
    42 #include <assert.h>
     42#ifdef DEBUG
     43#include <process.h>
    4344//use a different logfile
    4445#define PRIVATE_LOGGING
     46static FILE *_privateLogFile = NULL;
     47#endif
     48
     49#include <assert.h>
    4550#include <misc.h>
    4651#include <win32api.h>
     
    5661#include "oslibmisc.h"
    5762#include "initterm.h"
    58 #include <win\virtual.h>
     63#include <win/virtual.h>
    5964#include "oslibdos.h"
    6065#include "oslibmem.h"
     
    7176char szErrorModule[260] = "";
    7277
    73 #ifdef DEBUG
    74 static FILE *_privateLogFile = NULL;
    75 #endif
    76 
    7778ULONG WIN32API MissingApiOrd(char *parentimage, char *dllname, int ordinal);
    7879ULONG WIN32API MissingApiName(char *parentimage, char *dllname, char *functionname);
     
    8687 char logname[CCHMAXPATH];
    8788
    88     sprintf(logname, "pe_%d.log", loadNr);
     89    sprintf(logname, "pe_%d.log", getpid());
    8990        _privateLogFile = fopen(logname, "w");
    9091    if(_privateLogFile == NULL) {
    91         sprintf(logname, "%spe_%d.log", kernel32Path, loadNr);
     92        sprintf(logname, "%spe_%d.log", kernel32Path, getpid());
    9293            _privateLogFile = fopen(logname, "w");
    9394    }
     
    603604        for (i = 0; i < IMAGE_NUMBEROF_DIRECTORY_ENTRIES; i++)
    604605        {
    605             char *pszName;
     606            const char *pszName;
    606607
    607608            if(oh.DataDirectory[i].VirtualAddress && oh.DataDirectory[i].Size) {
  • trunk/src/kernel32/winimagepeldr.h

    r10397 r21916  
    1313#define __WINIMAGEPELDR_H__
    1414
    15 #include <winimagebase.h>
     15#include "winimagebase.h"
    1616
    1717#define SINGLE_PAGE             0  //commit single page
  • trunk/src/kernel32/winimgres.cpp

    r10471 r21916  
    2626
    2727#include <misc.h>
    28 #include <winimagebase.h>
     28#include "winimagebase.h"
    2929#include <unicode.h>
    3030#include <heapstring.h>
     
    3737#define MAX_RES 17
    3838typedef struct {
    39   char *typename;
    40   int   namelen;
     39  const char *typenam;
     40  int namelen;
    4141} STD_RESTYPE;
    4242
     
    131131    typelen = strlen(lpszType);
    132132
    133         for(int i=0;i<MAX_RES;i++) {
     133        int i;
     134        for(i=0;i<MAX_RES;i++) {
    134135            if(ResType[i].namelen &&
    135136               ResType[i].namelen == typelen &&
    136                stricmp(lpszType, ResType[i].typename) == 0)
     137               stricmp(lpszType, ResType[i].typenam) == 0)
    137138                    break;
    138139        }
     
    186187    typelen = strlen(astring1);
    187188
    188         for(int i=0;i<MAX_RES;i++) {
     189        int i;
     190        for(i=0;i<MAX_RES;i++) {
    189191            if(ResType[i].namelen &&
    190192               ResType[i].namelen == typelen &&
    191                stricmp(astring1, ResType[i].typename) == 0)
     193               stricmp(astring1, ResType[i].typenam) == 0)
    192194                    break;
    193195        }
     
    603605            pstring = (PIMAGE_RESOURCE_DIR_STRING_U)((ULONG)pResRootDir + nameOffset);
    604606            int len = lstrlenWtoA( pstring->NameString, pstring->Length );
    605             char *typename = (char *)malloc( len + 1 );
    606             lstrcpynWtoA(typename, pstring->NameString, len + 1 );
    607             typename[len] = 0;
    608 
    609         fRet = lpEnumFunc(hmod, typename, lParam);
    610             free(typename);
     607            char *typenam = (char *)malloc( len + 1 );
     608            lstrcpynWtoA(typenam, pstring->NameString, len + 1 );
     609            typenam[len] = 0;
     610
     611        fRet = lpEnumFunc(hmod, typenam, lParam);
     612            free(typenam);
    611613        }
    612614        else {
  • trunk/src/kernel32/wintls.cpp

    r21489 r21916  
    1212#include <os2win.h>
    1313#include <string.h>
    14 #include <winimagebase.h>
     14#include "winimagebase.h"
    1515#include <thread.h>
    1616#include <wprocess.h>
  • trunk/src/kernel32/wprocess.cpp

    r21673 r21916  
    5252#include "shellapi.h"
    5353
    54 #include <win\ntddk.h>
    55 #include <win\psapi.h>
     54#include <win/ntddk.h>
     55#include <win/psapi.h>
    5656
    5757#include <custombuild.h>
     
    109109PFNLXDLLLOAD pfnLxDllLoadCallback = NULL;
    110110
     111extern "C" {
    111112
    112113//******************************************************************************
     
    299300    StartupInfo.cbReserved2     = NULL;
    300301    if (!StartupInfo.lpDesktop)
    301         StartupInfo.lpDesktop  = "Desktop";
     302        StartupInfo.lpDesktop  = (LPSTR)"Desktop";
    302303    if (!StartupInfo.lpTitle)
    303         StartupInfo.lpTitle    = "Title";
     304        StartupInfo.lpTitle    = (LPSTR)"Title";
    304305    ProcessENVDB.hStdin  = StartupInfo.hStdInput  = GetStdHandle(STD_INPUT_HANDLE);
    305306    ProcessENVDB.hStdout = StartupInfo.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
     
    29872988
    29882989    lpmodinfo->SizeOfImage = winmod->getImageSize();
    2989     lpmodinfo->EntryPoint  = winmod->getEntryPoint();
     2990    lpmodinfo->EntryPoint  = (LPVOID)winmod->getEntryPoint();
    29902991    lpmodinfo->lpBaseOfDll = (void*)hModule;
    29912992
     
    30583059}
    30593060
     3061} // extern "C"
     3062
Note: See TracChangeset for help on using the changeset viewer.