Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
3.1 KiB

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;
  3. ; DLLENTRY.ASM
  4. ;
  5. ; simulates the NT DllEntryPoint call for a Win16 DLL
  6. ;
  7. ; Copyright (c) Microsoft Corporation 1989, 1990. All rights reserved.
  8. ;
  9. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  10. PMODE = 1
  11. ?PLM=1 ; pascal call convention
  12. ?WIN=0 ; NO! Windows prolog/epilog code
  13. .286
  14. .xlist
  15. include cmacros.inc
  16. .list
  17. externFP DllEntryPoint
  18. externFP LocalInit
  19. ifndef SEGNAME
  20. SEGNAME equ <_TEXT>
  21. endif
  22. createSeg %SEGNAME, CodeSeg, word, public, CODE
  23. ;-----------------------------------------------------------------------;
  24. ;
  25. ; Stuff needed to avoid the C runtime coming in, and init the windows
  26. ; reserved parameter block at the base of DGROUP
  27. ;
  28. ; NOTE if you need the 'C' startup dont use this file.
  29. ;
  30. ;-----------------------------------------------------------------------;
  31. if 1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  32. sBegin Data
  33. assumes ds,Data
  34. DD 0 ; So null pointers get 0
  35. DW 5 ; number of reserved ptrs
  36. globalW pLocalHeap,0 ; Local heap pointer
  37. globalW pAtomTable,0 ; Atom table pointer
  38. globalW pStackTop,0 ; top of stack
  39. globalW pStackMin,0 ; minimum value of SP
  40. globalW pStackBot,0 ; bottom of stack
  41. public __acrtused
  42. __acrtused = 1
  43. sEnd Data
  44. endif;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  45. sBegin CodeSeg
  46. assumes cs,CodeSeg
  47. assumes ds,Data
  48. assumes es,nothing
  49. ;--------------------------Private-Routine-----------------------------;
  50. ;
  51. ; LibEntry - called when DLL is loaded
  52. ;
  53. ; Entry:
  54. ; CX = size of heap
  55. ; DI = module handle
  56. ; DS = automatic data segment
  57. ; ES:SI = address of command line (not used)
  58. ; Returns:
  59. ; AX = TRUE if success
  60. ; History:
  61. ; 06-27-89 -by- Todd Laney [ToddLa]
  62. ; Created.
  63. ;-----------------------------------------------------------------------;
  64. assumes ds,nothing
  65. assumes es,nothing
  66. cProc LibEntry,<FAR,PUBLIC,NODATA>,<>
  67. cBegin
  68. jcxz @f
  69. cCall LocalInit,<0,0,cx>
  70. @@:
  71. ifdef DAYTONA
  72. cCall DllEntryPoint, <1, di, ds, cx, 0, 0, 0>
  73. endif
  74. cEnd
  75. ;--------------------------Private-Routine-----------------------------;
  76. ;
  77. ; WEP - called when DLL is unloaded
  78. ;
  79. ; History:
  80. ; 06-27-89 -by- Todd Laney [ToddLa]
  81. ; Created.
  82. ;-----------------------------------------------------------------------;
  83. assumes ds,nothing
  84. assumes es,nothing
  85. cProc WEP, <FAR, PUBLIC, PASCAL>, <ds>
  86. ParmW fSystemExit
  87. cBegin
  88. ;
  89. ; HEY dont cleanup if windows is going down.
  90. ;
  91. mov ax,fSystemExit
  92. or ax,ax
  93. ;;; jnz just_exit
  94. mov ax,DataBASE
  95. mov ds,ax
  96. assumes ds,Data
  97. ifdef DAYTONA
  98. cCall DllEntryPoint, <0, di, ds, cx, 0, 0, 0>
  99. endif
  100. just_exit:
  101. cEnd
  102. sEnd CodeSeg
  103. end LibEntry