Changeset 3483 for trunk/src


Ignore:
Timestamp:
May 2, 2000, 10:53:15 PM (25 years ago)
Author:
sandervl
Message:

added exception stack dump code; GetLocaleInfoA fixes

Location:
trunk/src/kernel32
Files:
2 added
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/Fileio.cpp

    r3380 r3483  
    1 /* $Id: Fileio.cpp,v 1.29 2000-04-15 10:00:44 sandervl Exp $ */
     1/* $Id: Fileio.cpp,v 1.30 2000-05-02 20:53:11 sandervl Exp $ */
    22
    33/*
     
    66 * Copyright 1998 Sander van Leeuwen
    77 * Copyright 1998 Patrick Haller
    8  *
    98 *
    109 * Project Odin Software License can be found in LICENSE.TXT
     
    773772  return(length-1);
    774773}
    775 //******************************************************************************
    776 //******************************************************************************
    777 ODINFUNCTION3(HANDLE, FindFirstChangeNotificationA,
    778               LPCSTR, lpPathName,
    779               BOOL, bWatchSubtree,
    780               DWORD, dwNotifyFilter)
    781 {
    782   dprintf(("KERNEL32:  FindFirstChangeNotificationA, Not implemented\n"));
    783   return(0);
    784 }
    785 //******************************************************************************
    786 //******************************************************************************
    787 ODINFUNCTION1(BOOL, FindNextChangeNotification,
    788               HANDLE, hChange)
    789 {
    790   dprintf(("KERNEL32: FindNextChangeNotification (%08xh), Not implemented\n",
    791            hChange));
    792 
    793   return(0);
    794 }
    795 //******************************************************************************
    796 //******************************************************************************
    797774ODINPROCEDURE0(SetFileApisToANSI)
    798775{
     
    933910}
    934911
    935 
     912//******************************************************************************
     913//******************************************************************************
     914ODINFUNCTION3(HANDLE, FindFirstChangeNotificationA,
     915              LPCSTR, lpPathName,
     916              BOOL, bWatchSubtree,
     917              DWORD, dwNotifyFilter)
     918{
     919  dprintf(("KERNEL32:  FindFirstChangeNotificationA, Not implemented (faked)\n"));
     920  return -1;
     921}
     922//******************************************************************************
     923//******************************************************************************
     924ODINFUNCTION1(BOOL, FindNextChangeNotification,
     925              HANDLE, hChange)
     926{
     927  dprintf(("KERNEL32: FindNextChangeNotification (%08xh), Not implemented\n",
     928           hChange));
     929
     930  return FALSE;
     931}
     932//******************************************************************************
     933//******************************************************************************
     934ODINFUNCTION1(BOOL, FindCloseChangeNotification, HANDLE, hChange)
     935{
     936  dprintf(("KERNEL32:  OS2FindNextChangeNotification, Not implemented\n"));
     937
     938  return(TRUE);
     939}
     940/*****************************************************************************
     941 * Name      : HANDLE WIN32API FindFirstChangeNotificationW
     942 * Purpose   : The FindFirstChangeNotification function creates a change
     943 *             notification handle and sets up initial change notification
     944 *             filter conditions. A wait on a notification handle succeeds when
     945 *             a change matching the filter conditions occurs in the specified
     946 *             directory or subtree.
     947 * Parameters: LPCWSTR lpPathName           pointer to name of directory to watch
     948 *             BOOL bWatchSubtree           flag for monitoring directory or
     949 *                                          directory tree
     950 *             DWORD dwNotifyFilter         filter conditions to watch for
     951 * Variables :
     952 * Result    : If the function succeeds, the return value is a handle to a find
     953 *             change notification object.
     954 *             If the function fails, the return value is INVALID_HANDLE_VALUE
     955 * Remark    :
     956 * Status    : UNTESTED STUB
     957 *
     958 * Author    : Markus Montkowski [Tha, 1998/05/21 20:57]
     959 *****************************************************************************/
     960ODINFUNCTION3(HANDLE, FindFirstChangeNotificationW, LPCWSTR, lpPathName,
     961                                                    BOOL, bWatchSubtree,
     962                                                    DWORD, dwNotifyFilter)
     963{
     964  LPSTR  lpAsciiPath;
     965  HANDLE hChange;
     966
     967    lpAsciiPath = UnicodeToAsciiString( (LPWSTR) lpPathName);
     968    hChange = FindFirstChangeNotificationA(lpAsciiPath, bWatchSubtree,
     969                                           dwNotifyFilter );
     970    if (lpAsciiPath) FreeAsciiString(lpAsciiPath);
     971    return hChange;
     972}
     973//******************************************************************************
     974//******************************************************************************
  • trunk/src/kernel32/KERNEL32.CPP

    r3352 r3483  
    1 /* $Id: KERNEL32.CPP,v 1.43 2000-04-08 20:09:42 sandervl Exp $ */
     1/* $Id: KERNEL32.CPP,v 1.44 2000-05-02 20:53:11 sandervl Exp $ */
    22
    33/*
     
    160160//******************************************************************************
    161161//******************************************************************************
    162 VOID WIN32API SetLastError( DWORD arg1)
    163 {
    164     dprintf2(("KERNEL32:  SetLastError to %d\n", arg1));
    165     O32_SetLastError(arg1);
     162VOID WIN32API SetLastError( DWORD dwError)
     163{
     164    if(dwError != 0) {
     165        dprintf2(("KERNEL32:  SetLastError to %d\n", dwError));
     166    }
     167    O32_SetLastError(dwError);
    166168}
    167169//******************************************************************************
     
    685687}
    686688
    687 BOOL WIN32API FindCloseChangeNotification(HANDLE hChange)
    688 {
    689   dprintf(("KERNEL32:  OS2FindNextChangeNotification, Not implemented\n"));
    690 
    691   return(TRUE);
    692 }
    693 
    694689//******************************************************************************
    695690//******************************************************************************
  • trunk/src/kernel32/dbglocal.cpp

    r3461 r3483  
    1 /* $Id: dbglocal.cpp,v 1.6 2000-04-29 18:26:57 sandervl Exp $ */
     1/* $Id: dbglocal.cpp,v 1.7 2000-05-02 20:53:11 sandervl Exp $ */
    22
    33/*
     
    117117"hmthread",
    118118"hmprocess",
    119 "vsemaphore"
     119"vsemaphore",
     120"exceptstackdump"
    120121};
    121122//******************************************************************************
  • trunk/src/kernel32/dbglocal.h

    r3461 r3483  
    1 /* $Id: dbglocal.h,v 1.6 2000-04-29 18:26:58 sandervl Exp $ */
     1/* $Id: dbglocal.h,v 1.7 2000-05-02 20:53:12 sandervl Exp $ */
    22
    33/*
     
    117117#define DBG_hmprocess      95
    118118#define DBG_VSemaphore     96
    119 #define DBG_MAXFILES       97
     119#define DBG_exceptstackdump 97
     120#define DBG_MAXFILES       98
    120121
    121122extern USHORT DbgEnabled[DBG_MAXFILES];
  • trunk/src/kernel32/exceptions.cpp

    r3375 r3483  
    1 /* $Id: exceptions.cpp,v 1.39 2000-04-14 22:35:27 sandervl Exp $ */
     1/* $Id: exceptions.cpp,v 1.40 2000-05-02 20:53:12 sandervl Exp $ */
    22
    33/*
    4  * Win32 Device IOCTL API functions for OS/2
     4 * Win32 Exception functions for OS/2
    55 *
    66 * Ported Wine exception handling code
     
    6565#include <wprocess.h>
    6666#include "oslibexcept.h"
     67#include "exceptstackdump.h"
    6768
    6869#define DBG_LOCALLOG    DBG_exceptions
     
    535536
    536537
    537 //******************************************************************************
    538 APIRET APIENTRY DosQueryModFromEIP (PULONG pulModule,
    539                                     PULONG pulObject,
    540                                     ULONG  ulBufferLength,
    541                                     PSZ    pszBuffer,
    542                                     PULONG pulOffset,
    543                                     ULONG  ulEIP);
    544 //******************************************************************************
    545 
    546 
    547538/*****************************************************************************
    548539 * Name      : void static dprintfException
     
    840831           pERepRec->ExceptionAddress));
    841832
    842   if (rc == NO_ERROR)
    843     dprintf(("%s (#%u), obj #%u:%08x\n",
     833  if(rc == NO_ERROR && ulObject != -1)
     834    dprintf(("<%s> (#%u), obj #%u:%08x\n",
    844835             szModule,
    845836             ulModule,
     
    847838             ulOffset));
    848839  else
    849     dprintf(("\n"));
     840    dprintf(("<win32 app>\n"));
    850841
    851842
     
    920911  dprintf(("---[End Of Exception Information]-----\n"));
    921912}
    922 
    923913
    924914/*****************************************************************************
     
    10581048CrashAndBurn:
    10591049        CheckLogException();
    1060         dprintfException(pERepRec, pERegRec, pCtxRec, p);
     1050#ifdef DEBUG
     1051        dprintfException(pERepRec, pERegRec, pCtxRec, p);
     1052        if(pCtxRec->ContextFlags & CONTEXT_CONTROL) {
     1053                dbgPrintStack(pERepRec, pERegRec, pCtxRec, p);
     1054        }
     1055#endif
    10611056        if(fIsOS2Image == FALSE)  //Only for real win32 apps
    10621057        {
  • trunk/src/kernel32/exceptutil.asm

    r3275 r3483  
    1 ; $Id: exceptutil.asm,v 1.6 2000-03-29 17:17:18 sandervl Exp $
     1; $Id: exceptutil.asm,v 1.7 2000-05-02 20:53:12 sandervl Exp $
    22
    33;/*
     
    196196getGS   endp
    197197
     198        PUBLIC getESP
     199getESP  proc near
     200        mov     eax, esp
     201        ret
     202getESP  endp
     203
    198204        PUBLIC RestoreOS2FS
    199205RestoreOS2FS proc near
  • trunk/src/kernel32/exceptutil.h

    r3160 r3483  
    1 /* $Id: exceptutil.h,v 1.7 2000-03-18 19:49:44 sandervl Exp $ */
     1/* $Id: exceptutil.h,v 1.8 2000-05-02 20:53:13 sandervl Exp $ */
    22
    33/*
     
    3434ULONG  getEAX();
    3535ULONG  getEBX();
     36ULONG  getESP();
    3637USHORT getSS();
    3738USHORT getDS();
  • trunk/src/kernel32/lang.cpp

    r2803 r3483  
    1 /* $Id: lang.cpp,v 1.17 2000-02-16 14:27:07 sandervl Exp $ */
     1/* $Id: lang.cpp,v 1.18 2000-05-02 20:53:13 sandervl Exp $ */
    22/*
    33 * Win32 language API functions for OS/2
     
    8989  if (wbuf)
    9090  {
    91 //    if (*pLen > sizeof(WCHAR))
    92     if (*pLen > 2)
     91//    if (*pLen >= sizeof(WCHAR))
     92    if (*pLen >= 2)
    9393    {
    9494      wbuf[0]=(WCHAR)'0'+wcUniChar;
     
    569569      case LOCALE_SABBREVMONTHNAME13:
    570570      case LOCALE_SMONTHNAME13:
     571        if(wbuf) {
     572                *wbuf = 0;
     573        }
    571574        LocaleFromUniStr((LPWSTR)L"\0",wbuf,&ulInfoLen);
    572575        break;
  • trunk/src/kernel32/makefile

    r3390 r3483  
    1 # $Id: makefile,v 1.93 2000-04-15 16:32:35 sandervl Exp $
     1# $Id: makefile,v 1.94 2000-05-02 20:53:13 sandervl Exp $
    22
    33#
     
    124124$(OBJDIR)\queue.obj \
    125125$(OBJDIR)\hmthread.obj \
     126!ifdef DEBUG
     127$(OBJDIR)\exceptstackdump.obj \
     128!endif
    126129$(OBJDIR)\kernelrsrc.obj
    127130
  • trunk/src/kernel32/misc.cpp

    r3372 r3483  
    1 /* $Id: misc.cpp,v 1.21 2000-04-13 18:48:02 sandervl Exp $ */
     1/* $Id: misc.cpp,v 1.22 2000-05-02 20:53:13 sandervl Exp $ */
    22
    33/*
     
    304304//******************************************************************************
    305305//******************************************************************************
     306int SYSTEM EXPORT WriteLogNoEOL(char *tekst, ...)
     307{
     308  USHORT  sel = RestoreOS2FS();
     309  va_list argptr;
     310
     311  ODIN_HEAPCHECK();
     312
     313  if(!init)
     314  {
     315    init = TRUE;
     316
     317#ifdef DEFAULT_LOGGING_OFF
     318    if(getenv("WIN32LOG_ENABLED")) {
     319#else
     320    if(!getenv("NOWIN32LOG")) {
     321#endif
     322        char logname[CCHMAXPATH];
     323
     324        sprintf(logname, "odin32_%d.log", loadNr);
     325        flog = fopen(logname, "w");
     326        if(flog == NULL) {//probably running exe on readonly device
     327                sprintf(logname, "%sodin32_%d.log", kernel32Path, loadNr);
     328                flog = fopen(logname, "w");
     329        }
     330    }
     331    else
     332      fLogging = FALSE;
     333  }
     334
     335  if(fLogging && flog && (dwEnableLogging > 0))
     336  {
     337    THDB *thdb = GetThreadTHDB();
     338
     339    va_start(argptr, tekst);
     340    if(thdb) {
     341        thdb->logfile = (DWORD)flog;
     342    }
     343    vfprintf(flog, tekst, argptr);
     344    if(thdb) thdb->logfile = 0;
     345    va_end(argptr);
     346  }
     347  SetFS(sel);
     348  return 1;
     349}
     350//******************************************************************************
     351//******************************************************************************
    306352void SYSTEM DecreaseLogCount()
    307353{
  • trunk/src/kernel32/stubs.cpp

    r3281 r3483  
    1 /* $Id: stubs.cpp,v 1.21 2000-03-30 15:37:14 cbratschi Exp $ */
     1/* $Id: stubs.cpp,v 1.22 2000-05-02 20:53:13 sandervl Exp $ */
    22
    33/*
     
    13671367
    13681368/*****************************************************************************
    1369  * Name      : HANDLE WIN32API FindFirstChangeNotificationW
    1370  * Purpose   : The FindFirstChangeNotification function creates a change
    1371  *             notification handle and sets up initial change notification
    1372  *             filter conditions. A wait on a notification handle succeeds when
    1373  *             a change matching the filter conditions occurs in the specified
    1374  *             directory or subtree.
    1375  * Parameters: LPCWSTR lpPathName           pointer to name of directory to watch
    1376  *             BOOL bWatchSubtree           flag for monitoring directory or
    1377  *                                          directory tree
    1378  *             DWORD dwNotifyFilter         filter conditions to watch for
    1379  * Variables :
    1380  * Result    : If the function succeeds, the return value is a handle to a find
    1381  *             change notification object.
    1382  *             If the function fails, the return value is INVALID_HANDLE_VALUE
    1383  * Remark    :
    1384  * Status    : UNTESTED STUB
    1385  *
    1386  * Author    : Markus Montkowski [Tha, 1998/05/21 20:57]
    1387  *****************************************************************************/
    1388 
    1389 HANDLE WIN32API FindFirstChangeNotificationW( LPCWSTR lpPathName,
    1390                                                 BOOL bWatchSubtree,
    1391                                                 DWORD dwNotifyFilter)
    1392 {
    1393 
    1394   dprintf(("KERNEL32: FindFirstChangeNotificationW(%08x,%08x,%08x) not implemented - INVALID_HANDLE_VALUE\n",
    1395             lpPathName, bWatchSubtree, dwNotifyFilter
    1396           ));
    1397 
    1398   return (INVALID_HANDLE_VALUE);
    1399 }
    1400 
    1401 /*****************************************************************************
    14021369 * Name      : HANDLE WIN32API FindFirstFileExA
    14031370 * Purpose   : The FindFirstFileExA function searches a directory for a file
  • trunk/src/kernel32/virtual.cpp

    r3259 r3483  
    1 /* $Id: virtual.cpp,v 1.29 2000-03-28 17:11:50 sandervl Exp $ */
     1/* $Id: virtual.cpp,v 1.30 2000-05-02 20:53:13 sandervl Exp $ */
    22
    33/*
     
    437437    if(rc)
    438438    {
    439       dprintf(("KERNEL32:VirtualFree:OsLibSetMem rc = #%d\n",
    440                rc));
    441       SetLastError(ERROR_INVALID_ADDRESS);
    442       return(FALSE);
     439        if(rc == 32803) { //SvL: ERROR_ALIAS
     440                dprintf(("KERNEL32:VirtualFree:OsLibSetMem rc = #%d; app tries to decommit aliased memory; ignore", rc));
     441                return(TRUE);
     442        }
     443        dprintf(("KERNEL32:VirtualFree:OsLibSetMem rc = #%d\n", rc));
     444        SetLastError(ERROR_INVALID_ADDRESS);
     445        return(FALSE);
    443446    }
    444447  }
  • trunk/src/kernel32/windllbase.cpp

    r3160 r3483  
    1 /* $Id: windllbase.cpp,v 1.12 2000-03-18 19:49:44 sandervl Exp $ */
     1/* $Id: windllbase.cpp,v 1.13 2000-05-02 20:53:14 sandervl Exp $ */
    22
    33/*
     
    752752//******************************************************************************
    753753//******************************************************************************
     754Win32DllBase *Win32DllBase::findModuleByAddr(ULONG address)
     755{
     756   dlllistmutex.enter();
     757
     758   Win32DllBase *mod = Win32DllBase::head;
     759   while(mod != NULL) {
     760        dbgCheckObj(mod);
     761        if(mod->insideModule(address)) {
     762                dlllistmutex.leave();
     763                return(mod);
     764        }
     765        mod = mod->next;
     766   }
     767   dlllistmutex.leave();
     768   return(NULL);
     769}
     770//******************************************************************************
     771//******************************************************************************
    754772BOOL Win32DllBase::isDll()
    755773{
  • trunk/src/kernel32/windllbase.h

    r3059 r3483  
    1 /* $Id: windllbase.h,v 1.1 2000-03-09 19:03:21 sandervl Exp $ */
     1/* $Id: windllbase.h,v 1.2 2000-05-02 20:53:14 sandervl Exp $ */
    22
    33/*
     
    115115static  Win32DllBase *findModule(HINSTANCE hinstance);
    116116static  Win32DllBase *findModule(WIN32DLLENTRY DllEntryPoint);
     117static  Win32DllBase *findModuleByAddr(ULONG address);
    117118
    118119#ifdef DEBUG_ENABLELOG_LEVEL2
  • trunk/src/kernel32/winexebase.cpp

    r3406 r3483  
    1 /* $Id: winexebase.cpp,v 1.8 2000-04-16 18:05:04 sandervl Exp $ */
     1/* $Id: winexebase.cpp,v 1.9 2000-05-02 20:53:14 sandervl Exp $ */
    22
    33/*
     
    120120  //Set default FPU control word (no exceptions); same as in NT
    121121  _control87(0x27F, 0xFFF);
     122  ULONG Size = 16, Attr;
     123  rc = DosQueryMem((PVOID) (entryPoint), &Size, &Attr);
     124  dprintf(("Start exe; Attr = %x, rc = %d", Attr, rc));
    122125  rc = ((WIN32EXEENTRY)entryPoint)(NULL);
    123126  RestoreOS2TIB();
  • trunk/src/kernel32/winimagebase.cpp

    r3404 r3483  
    1 /* $Id: winimagebase.cpp,v 1.18 2000-04-16 10:42:12 sandervl Exp $ */
     1/* $Id: winimagebase.cpp,v 1.19 2000-05-02 20:53:14 sandervl Exp $ */
    22
    33/*
     
    131131  dprintf(("Win32ImageBase::getVersion: NOT IMPLEMENTED!"));
    132132  return 0x40000; //NT 4
     133}
     134//******************************************************************************
     135//******************************************************************************
     136BOOL Win32ImageBase::insideModule(ULONG address)
     137{
     138  //dummy
     139  return FALSE;
     140}
     141//******************************************************************************
     142//******************************************************************************
     143BOOL Win32ImageBase::insideModuleCode(ULONG address)
     144{
     145  //dummy
     146  return FALSE;
    133147}
    134148//******************************************************************************
  • trunk/src/kernel32/winimagebase.h

    r3404 r3483  
    1 /* $Id: winimagebase.h,v 1.6 2000-04-16 10:42:12 sandervl Exp $ */
     1/* $Id: winimagebase.h,v 1.7 2000-05-02 20:53:14 sandervl Exp $ */
    22
    33/*
     
    9999        void  tlsDetachThread();        //destroy TLS structures
    100100
     101virtual BOOL  insideModule(ULONG address);
     102virtual BOOL  insideModuleCode(ULONG address);
     103
    101104virtual ULONG getApi(char *name)  = 0;
    102105virtual ULONG getApi(int ordinal) = 0;
  • trunk/src/kernel32/winimagepeldr.cpp

    r3404 r3483  
    1 /* $Id: winimagepeldr.cpp,v 1.41 2000-04-16 10:42:12 sandervl Exp $ */
     1/* $Id: winimagepeldr.cpp,v 1.42 2000-05-02 20:53:15 sandervl Exp $ */
    22
    33/*
     
    14751475//******************************************************************************
    14761476//******************************************************************************
     1477BOOL Win32PeLdrImage::insideModule(ULONG address)
     1478{
     1479  if((address >= realBaseAddress) && (address < realBaseAddress + imageSize)) {
     1480        return TRUE;
     1481  }
     1482  return FALSE;
     1483}
     1484//******************************************************************************
     1485//******************************************************************************
     1486BOOL Win32PeLdrImage::insideModuleCode(ULONG address)
     1487{
     1488 Section *sect;
     1489
     1490  sect = findSectionByOS2Addr(address);
     1491  if(sect && (sect->pageflags & PAG_EXECUTE)) {
     1492        return TRUE;
     1493  }
     1494  return FALSE;
     1495}
     1496//******************************************************************************
     1497//******************************************************************************
    14771498ULONG Win32PeLdrImage::getApi(char *name)
    14781499{
  • trunk/src/kernel32/winimagepeldr.h

    r3074 r3483  
    1 /* $Id: winimagepeldr.h,v 1.1 2000-03-10 16:12:03 sandervl Exp $ */
     1/* $Id: winimagepeldr.h,v 1.2 2000-05-02 20:53:15 sandervl Exp $ */
    22
    33/*
     
    8383virtual BOOL  init(ULONG reservedMem);
    8484
     85    virtual BOOL  insideModule(ULONG address);
     86    virtual BOOL  insideModuleCode(ULONG address);
     87
    8588    virtual ULONG getApi(char *name);
    8689    virtual ULONG getApi(int ordinal);
  • trunk/src/kernel32/wprocess.cpp

    r3404 r3483  
    1 /* $Id: wprocess.cpp,v 1.79 2000-04-16 10:42:13 sandervl Exp $ */
     1/* $Id: wprocess.cpp,v 1.80 2000-05-02 20:53:15 sandervl Exp $ */
    22
    33/*
     
    12951295        ulAPIOrdinal = (ULONG)lpszProc;
    12961296        if (ulAPIOrdinal <= 0x0000FFFF) {
    1297             proc = (FARPROC)winmod->getApi((int)ulAPIOrdinal);
     1297                proc = (FARPROC)winmod->getApi((int)ulAPIOrdinal);
    12981298        }
    12991299        else    proc = (FARPROC)winmod->getApi((char *)lpszProc);
    1300     if(proc == 0) {
    1301         SetLastError(ERROR_PROC_NOT_FOUND);
    1302     }
    1303     return proc;
     1300        if(proc == 0) {
     1301#ifdef DEBUG
     1302                if(ulAPIOrdinal <= 0x0000FFFF) {
     1303                        dprintf(("GetProcAddress %x %x not found!", hModule, ulAPIOrdinal));
     1304                }
     1305                else    dprintf(("GetProcAddress %x %s not found!", hModule, lpszProc));
     1306#endif
     1307                SetLastError(ERROR_PROC_NOT_FOUND);
     1308        }
     1309        return proc;
    13041310  }
    13051311  proc = O32_GetProcAddress(hModule, lpszProc);
    13061312  if(HIWORD(lpszProc))
    1307     dprintf(("KERNEL32:  GetProcAddress %s from %X returned %X\n", lpszProc, hModule, proc));
     1313        dprintf(("KERNEL32:  GetProcAddress %s from %X returned %X\n", lpszProc, hModule, proc));
    13081314  else  dprintf(("KERNEL32:  GetProcAddress %x from %X returned %X\n", lpszProc, hModule, proc));
    13091315  return(proc);
Note: See TracChangeset for help on using the changeset viewer.