home *** CD-ROM | disk | FTP | other *** search
/ CICA 1993 August / CICA.cdr / cis_libs / mswin32 / 17 / win32s.txt < prev    next >
Encoding:
Text File  |  1992-10-26  |  7.8 KB  |  144 lines

  1. Subj:  Win32s: W32 Subset 4 W31                Section: Product Information
  2. From:  Alistair Banks/Microsoft 73740,3417     # 1144, 3 Replies 
  3.   To:  All                                     Date: 26-Feb-92 06:58:07
  4.  
  5. "Win32s(TM): The Win32(TM) Subset API for Windows 3.1"
  6.  
  7. There's been allusion and rumour about something we call "Win32s" recently
  8. - We've now officially announced it, so I'll explain...
  9.  
  10. Here and elsewhere we've explained many times that Win32 is a single new
  11. API which will be first made available in Windows NT this year, and later
  12. in a major update to Windows on MS-Dos.
  13.  
  14. Win32s is a developers toolkit which delivers a binary compatible subset
  15. of the Win32 API on Windows 3.1. As Win32 is defined as "the Win16 API
  16. stretched to portable 32-bit + new functionality", so Win32s API is
  17. exactly that subset of Win32 without the "new functionality".
  18.  
  19. Late in Win3.1's development cycle, we defined some hooks that we'll
  20. document under our "Open Tools" banner, which allow a VxD to load to
  21. handle the new flat Win32/Windows NT .exe type. You may have already heard
  22. of "BigWin" & other "Windows extenders". Win32s is a combination of VxDs
  23. and .dlls (a runtime) which adds on to Win3.1 to support Win32 32-bit
  24. binaries on Win3.1. All the Win32 APIs are included in the Win32s .dlls,
  25. and those which aren't functional simply return an error code.
  26.  
  27. So you can develop one Win32 app, & have it start a thread. On Win3.1 that
  28. CreateThread call will return an error, so you take "Plan B", and on
  29. Windows NT the call will succeed, so off you go... Error returns will be
  30. given for all functionality beyond that in Win16 including beziers, paths,
  31. memory mapped file i/o, semaphores, etc, but given the clean error return,
  32. you can choose to write a single binary that works on Win3.1, and yet
  33. fully exploits the features of Windows NT.
  34.  
  35. We think Win32s will bring more market justification (in the the large
  36. Win3.1 installed base) to bring Win32 applications to market more quickly,
  37. and therefore allow Windows NT to succeed more quickly than it might,
  38. given only Windows NT's technical merits.
  39.  
  40. Win32s: Details...
  41.  
  42. Win32s toolkit comes from Microsoft's languages group & will include their
  43. forthcoming 32-bit C & C++ compiler and the Win32s runtime for Win3.1.
  44. This runtime & an installer will be shippable by developers for no-royalty
  45. with an application that uses it. Therefore, the application created will
  46. work on any enhanced mode Windows 3.1, and will not require any further
  47. upgrade to Windows (last year, Windows was shipped onto >80% 32-bit
  48. platforms). Microsoft will be agressively promoting Windows 3.1 &
  49. upgrades. We have no doubt that Win3.1 & Windows NT will be by far the
  50. highest volume platform for 32-bit graphical applications. We also believe
  51. that a Win32s application will be suitable for every catagory. Win32s will
  52. be available mid-year, in the same timeframe to the same people as the
  53. Windows NT SDK - clearly we expect Win32s & Win32 development to be "in
  54. tandem".
  55.  
  56. Since we're leaving the Win32s interfaces open, with our "Open Tools"
  57. policy, we expect other 32-bit Windows extenders to be developped or
  58. upgraded to Win32s functionality to be shipped with other development
  59. tools. As announced previously, the Win32s functionality will be shipped
  60. with Windows on MS-Dos itself in a future major upgrade which supports the
  61. full Win32 API.
  62.  
  63. There's one exception to the rule that Win32s adds no functionality beyond
  64. 32-bitness & Win16 APIs - We're great fans of structured exception
  65. handling, and we want every Win32 application to use it, so we've included
  66. that functionality in Win32s. You can read about structured exception
  67. handling in the Win32 API Specifications, available on MSOPSYS, lib 2 "ISV
  68. Communications", and now available in printed form from MS-Press.
  69.  
  70. The full Win32 functionality is very compelling, and an argument could be
  71. made to add each new feature to Windows (we're working on that!), but we
  72. consider the timely delivery of Win32s to be its most important priority.
  73.  
  74. Architectural Issues:
  75.  
  76. A Win32 application using the Win32s toolkit will find some of its APIs
  77. serviced within a 32-bit VxD, and some of its APIs serviced by the 32-bit
  78. .dlls. In general "base" functionality will go to the VxD, and the
  79. equivalents of Win16 APIs in the .dlls.
  80.  
  81. Win32 applications can't use Int XX functionality, so the Win32s VxD has
  82. Win32 entries for each Int 21 & various other Int XX (BIOS) calls. The
  83. Win32 memory management APIs are directly implemented in the Win32s VxD
  84. (you can't map 32-bit memory management to 16-bit reasonably) and the Int
  85. XX equivalents are mapped back to the virtualised MS-Dos.
  86.  
  87. The Win32s .dlls "thunk" back to Win16 - As a Win32 application makes a
  88. call, so its 32-bit parameters are copied from the 32-bit stack to a
  89. 16-bit stack, and the 16-bit entry point is called. You'll notice that
  90. you're only very allocated Window handles up to 0x0000FFFF, as you'd
  91. expect, but don't assume it, since that won't be true when you run the
  92. same binary on Windows NT.
  93.  
  94. There are other semantic difference between Win3.1 & Windows NT - Win3.1
  95. runs Win32 apps non-preemtively in a single shared address space, while
  96. Windows NT runs them pre-emptively in seperate address spaces. Its
  97. therefore important that you test your Win32 app on both Win3.1 & Windows
  98. NT, and that you use DDE_SHARE memory, when you really mean it to be
  99. shared.
  100.  
  101. If you need to call 16-bit functionality from 32-bit code, you'll have to
  102. do this using "RPC" or client-server techniques. Your 32-bit app would
  103. package its parameters into a data structure and send it as a message to a
  104. dummy 16-bit .exe which would call the 16-bit .dll on its behalf. DDE,
  105. OLE, Clipboard, Metafile, Bitmaps are all interchangeable between Win16 &
  106. Win32 applications on both Win3.1 & Windows NT.
  107.  
  108. Win32s: Speed & other comparisons:
  109.  
  110. Q: How much faster will a Win32s app go on Win3.1 than a Win16 app?
  111.  
  112. A: It depends how often you cross the "thunk" boundary, and how much
  113. simpler your data access gets using 32-bit access. The thunks are an
  114. overhead (<10% per call), and the simpler data access speeds up
  115. applications. The answer will be different for each application.
  116.  
  117. Architecturally Win32s provides 32-bitness in the same way as OS/2 2.0 -
  118. OS/2 2.0 provides a 32-bit API over 16 bit drivers, 16-bit file systems,
  119. 16-bit graphics engine (PMGRE & PMGPI), with 32-bit kernel & memory
  120. management; Win3.1+Win32s has 32-bit drivers (VxDs), some of which call to
  121. 16-bit file systems (MS-Dos in Virtual mode), & some of which directly
  122. implement functionality (Win32s Memory Management), a 32-bit pre-emptive
  123. kernel (Windows enhanced mode), 16-bit graphics and windowing (GDI &
  124. USER). Both OS/2 2.0 & Windows 3.1 contain various drivers which use
  125. 32-bit capabilities when they find them, and both offer backward
  126. compatibility for 'old' 16-bit drivers. Both Win3.1 & OS/2 2.0 have an
  127. architecture that allows 16-bit pieces to be replaced with 32-bit pieces
  128. selectively, as the work is done.
  129.  
  130. IBM is claiming that 32-bit apps give you great speed advantages. We're
  131. more conservative, but believe that in general 32-bitness will speed up
  132. your Windows application more than thunking will slow it down. In any
  133. case, the architecture is very competitive, and a great step while we work
  134. on a 100% 32-bit Windows on MS-Dos to match our 100% 32-bit Windows NT.
  135.  
  136. Summary: Win32s fills a percieved "gap" sooner between Windows on MS-Dos &
  137. Windows NT by providing a common, binary compatible 32-bit API between
  138. them. It'll be available to developers in the same timeframe as Windows NT
  139. is, and it will make Windows 3.1 & Windows NT the highest volume 32-bit
  140. graphical platform soonest. It makes life simpler for developers,
  141. particularly those not used to segmentation, and in general, faster.
  142.  
  143. -- Alistair
  144.