Changeset 188 for trunk/src


Ignore:
Timestamp:
Jun 25, 1999, 3:59:02 PM (26 years ago)
Author:
phaller
Message:

Add: new runtime functions in NTDLL

Location:
trunk/src/NTDLL
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/NTDLL/crt.cpp

    r156 r188  
    1 /* $Id: crt.cpp,v 1.2 1999-06-22 17:08:16 phaller Exp $ */
     1/* $Id: crt.cpp,v 1.3 1999-06-25 13:59:01 phaller Exp $ */
    22
    33/*
     
    1414#include <wchar.h>
    1515#include <wcstr.h>
     16#include <wctype.h>
    1617
    1718#include "ntdll.h"
     
    2425
    2526
     27/*****************************************************************************
     28 * Name      :
     29 * Purpose   :
     30 * Parameters:
     31 * Variables :
     32 * Result    :
     33 * Remark    : NTDLL.882
     34 * Status    :
     35 *
     36 * Author    : Patrick Haller [Thu, 1999/06/22 20:44]
     37 *****************************************************************************/
     38
     39LPWSTR CDECL OS2_wcsupr(LPWSTR str)
     40{
     41  DWORD dwIndex;
     42
     43  dprintf(("NTDLL: _wcsupr(%08xh)\n",
     44           str));
     45
     46  for (dwIndex = wcslen((const wchar_t*)str);
     47       dwIndex;
     48       dwIndex--)
     49  {
     50    towupper(str[dwIndex]);
     51  }
     52
     53  return (str);
     54}
     55
     56
    2657
    2758/*****************************************************************************
     
    317348  return (isupper(i));
    318349}
     350
     351
     352/*****************************************************************************
     353 * Name      :
     354 * Purpose   :
     355 * Parameters:
     356 * Variables :
     357 * Result    :
     358 * Remark    : NTDLL.911
     359 * Status    :
     360 *
     361 * Author    : Patrick Haller [Thu, 1999/06/22 20:44]
     362 *****************************************************************************/
     363
     364LPSTR CDECL OS2sprintf(LPSTR lpstrBuffer,
     365                       LPSTR lpstrFormat,
     366                       ...)
     367{
     368  va_list argptr;                          /* -> variable argument list */
     369
     370  dprintf(("NTDLL: sprintf(%08xh,%s)\n",
     371           lpstrBuffer,
     372           lpstrFormat));
     373
     374  va_start(argptr,
     375           lpstrFormat);                   /* get pointer to argument list */
     376  vsprintf(lpstrBuffer,
     377           lpstrFormat,
     378           argptr);
     379  va_end(argptr);                          /* done with variable arguments */
     380
     381  return (lpstrBuffer);
     382}
     383
    319384
    320385
  • trunk/src/NTDLL/makefile

    r155 r188  
    1 # $Id: makefile,v 1.4 1999-06-22 16:18:14 phaller Exp $
     1# $Id: makefile,v 1.5 1999-06-25 13:59:01 phaller Exp $
    22
    33#
     
    3030       initterm.obj\
    3131       crt.obj\
    32        time.obj
     32       time.obj\
     33       unknown.obj
    3334
    3435
     
    7374crt.obj:    .\crt.cpp    .\ntdll.h
    7475
     76unknown.obj: .\unknown.cpp .\ntdll.h
     77
    7578clean:
    7679        $(RM) *.obj *.lib *.dll *~ *.map *.pch
  • trunk/src/NTDLL/ntdll.def

    r156 r188  
    1 ; $Id: ntdll.def,v 1.7 1999-06-22 17:08:16 phaller Exp $
     1; $Id: ntdll.def,v 1.8 1999-06-25 13:59:01 phaller Exp $
    22
    33;Created by BLAST for IBM's compiler
     
    3232
    3333; real functions
     34    NtAllocateUuids               = _NtAllocateUuids@16               @59
     35    ZwAllocateUuids               = _NtAllocateUuids@16
     36
    3437    NtOpenFile                    = _NtOpenFile@24                    @127
    3538    ZwOpenFile                    = _NtOpenFile@24
     
    264267    RtlNtStatusToDosError         = _RtlNtStatusToDosError@4          @442
    265268    RtlGetNtProductType           = _RtlGetNtProductType@4            @390
     269    RtlEnlargedIntegerMultiply    = _RtlEnlargedIntegerMultiply@8     @341
     270    RtlExtendedIntegerMultiply    = _RtlExtendedIntegerMultiply@12    @358
    266271    RtlExtendedLargeIntegerDivide = _RtlExtendedLargeIntegerDivide@16 @359
    267 ;   RtlExtendedLargeIntegerMultiply
    268272    RtlFormatCurrentUserKeyPath   = _RtlFormatCurrentUserKeyPath@4    @371
    269273    RtlOpenCurrentUser            = _RtlOpenCurrentUser@8
     
    281285; NTDLL's C runtime
    282286; Note: CDECL does not decorate the function names with parameter bytes!
     287    _wcsupr                       = _OS2_wcsupr                       @882
    283288    abs                           = _OS2abs                           @883
    284289    atan                          = _OS2atan                          @884
     
    296301    isupper                       = _OS2isupper                       @896
    297302
     303    sprintf                       = _OS2sprintf                       @911
    298304    strcat                        = _OS2strcat                        @914
    299305    strchr                        = _OS2strchr                        @915
  • trunk/src/NTDLL/rtl.cpp

    r97 r188  
    1 /* $Id: rtl.cpp,v 1.2 1999-06-10 17:06:46 phaller Exp $ */
     1/* $Id: rtl.cpp,v 1.3 1999-06-25 13:59:02 phaller Exp $ */
    22
    33/*
     
    528528
    529529/******************************************************************************
     530 * RtlEnlargedIntegerMultiply [NTDLL.341]
     531 * Note: This even works, since gcc returns 64bit values in eax/edx just like
     532 * the caller expects. However... The relay code won't grok this I think.
     533 *
     534 * @@@PH: Parameters are unknown
     535 */
     536/* longlong in VAC++ ? */
     537
     538INT WINAPI RtlEnlargedIntegerMultiply(INT factor1,
     539                                      INT factor2)
     540{
     541  dprintf(("NTDLL: RtlEnlargedIntegerMultiply(%08xh,%08xh) not implemented.\n",
     542           factor1,
     543           factor2));
     544
     545  return factor1 * factor2;
     546}
     547
     548
     549/******************************************************************************
    530550 * RtlExtendedLargeIntegerDivide [NTDLL.359]
    531551 */
     
    551571
    552572/******************************************************************************
    553  * RtlExtendedLargeIntegerMultiply [NTDLL.359]
     573 * RtlExtendedLargeIntegerMultiply [NTDLL.358]
    554574 * Note: This even works, since gcc returns 64bit values in eax/edx just like
    555575 * the caller expects. However... The relay code won't grok this I think.
    556576 */
    557 #if 0
    558577/* longlong in VAC++ ? */
    559 long long WINAPI RtlExtendedIntegerMultiply(LARGE_INTEGER factor1,
    560                                             INT factor2)
    561 {
    562 #if SIZEOF_LONG_LONG==8
    563    return (*(long long*)&factor1) * factor2;
    564 #else
    565   dprintf(("NTDLL: RtlExtendedLargeIntegerMultiply(%08xh,%08xh) not implemented.\n",
     578
     579LARGE_INTEGER WINAPI RtlExtendedIntegerMultiply(LARGE_INTEGER factor1,
     580                                                INT           factor2)
     581{
     582  LARGE_INTEGER li;
     583
     584  dprintf(("NTDLL: RtlExtendedIntegerMultiply(%08xh,%08xh) not implemented.\n",
    566585           factor1,
    567586           factor2));
    568587
    569   return 0;
    570 #endif
    571 }
    572 #endif
     588  li.LowPart  = factor1.LowPart * factor2;
     589  li.HighPart = factor1.HighPart * factor2;
     590  // note: overflow from LowPart To HighPart NOT handled !
     591
     592  return li;
     593}
     594
     595
    573596/******************************************************************************
    574597 *  RtlFormatCurrentUserKeyPath             [NTDLL.371]
Note: See TracChangeset for help on using the changeset viewer.