home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / os2bbs / os2prg.cfo < prev    next >
Encoding:
Text File  |  1992-10-31  |  94.6 KB  |  2,379 lines

  1.  
  2.  This forum is supplied for demonstration purposes only and is
  3.  accessible via the IBM OS/2 BBS system.  What you see below is the
  4.  forum as it existed on 10/30/92.  The IBM OS/2 Bulletin Board System
  5.  (BBS) is IBM's new electronic support offering for OS/2 Version 2.0.
  6.  With OS/2 BBS you can electronically review OS/2 technical
  7.  information, submit program defects to IBM, and receive information
  8.  on how to solve problems.  Users of the OS/2 BBS not only include
  9.  OS/2 customers, but the OS/2 expertise of the entire internal IBM
  10.  community worldwide.  OS2BBS makes all this available via a local
  11.  or toll free number in most major cities.
  12.  
  13.  To request a complete OS/2 BBS Information Package detailing
  14.  the OS/2 BBS offering and including pricing and registration/access
  15.  information, please call:  1-800-547-1283.
  16.  
  17. ===== OS2PRG CFORUM created at 01:50:23 on 92/04/08 GMT (by HOPKINS at AUSVM8)
  18.                             IBM UNCLASSIFIED
  19.                             ----------------
  20.       The information in this forum is considered by IBM to be
  21.       external and may be shared by everyone who is given access.
  22.       This forum is shared with the internal IBM employee conferences.
  23.  
  24. Forum: OS2PRG CFORUM
  25.  
  26. Forum subject:  OS/2 Base Programming and System Routines
  27.  
  28.           This FORUM is provided as a conferencing tool to promote
  29.           discussion of issues, questions, and problems relating
  30.           to OS/2 Base Programming and System Routines.
  31.  
  32. Contributions must not contain confidential or proprietary information.
  33.  
  34. Each contributor agrees, in placing material in this forum, that IBM and
  35. other users are free to prepare derivative works based upon it, and to use,
  36. reproduce, perform, display and distribute inside and outside their company
  37. such material and such derivative works, without obligation or charge.
  38.  
  39. IBM is not responsible or liable for the use, copying, or distribution of
  40. materials placed on this forum, and has therefore no obligation to control
  41. such acts.
  42.  
  43. All subscribers are required to abide at all times by the conference
  44. rules described in the Bulletin Board Rules under "News and Announcements".
  45.  
  46. All IBM personnel are required to abide at all times by the IBMPC RULES
  47. and the IBM Business Conduct Guidelines. IBM personnel will read the
  48. CUSTOMER FORUM RULES in IBMPC RULES before contributing.
  49.  
  50. Contributions violating these rules will be deleted by the CFORUM
  51. Owner or their delegate, and in some cases by an IBM conference
  52. Administrator.
  53.  
  54. The OS2BBS CFORUM is where anyone may raise concerns regarding rules
  55. violations found in this and other CFORUMS.
  56.  
  57.    The IBM Owner of this forum is:
  58.    Name:            Kenneth M. Hopkins, OS/2 Support Services
  59.    Mailing Address: IBM Manufacturing and Development
  60.                     11400 Burnet Road
  61.                     Internal Zip 2900-042/1D003
  62.                     Austin, Texas    78758
  63.    IBM Node/Userid: AUSVM8/HOPKINS
  64.  
  65. ----- OS2PRG CFORUM appended at 22:02:43 on 92/05/05 GMT (by IL80988 at OS2CUST)
  66. Subject: comm port address
  67.  
  68. does anyone recall the comm port address for programming ?
  69.  
  70. ----- OS2PRG CFORUM appended at 14:07:34 on 92/05/06 GMT (by SHOWPM1 at TPAVMPS2)
  71. Subject: comm port address
  72. Ref: Append at 22:02:43 on 92/05/05 GMT (by IL80988 at OS2CUST)
  73.  
  74. If you are writing a device driver then the COM address depends
  75. on which COM port you want to use. I think that the address for
  76. COM1 is 3F8H. I do not know about other COM ports. If you are
  77. writing a OS/2 application all you need to use is DosOpen, to
  78. open the COM port, DosRead, to read information from the COM port,
  79. DosWrite, to write information to the COM port, and use DosDevIOCtl
  80. to control the COM port.
  81.  
  82. Joseph Mogavero
  83.  
  84. ----- OS2PRG CFORUM appended at 19:18:59 on 92/05/07 GMT (by SSIA013 at OS2CUST)
  85. Subject: Com port address
  86.  
  87. Shouldn't you get the COM port address from 0:400 - 407?  If I install a com
  88. port and have it address some place else (other than the standard post), then
  89. it should be reflected there.
  90.  
  91. pgk
  92.  
  93. ----- OS2PRG CFORUM appended at 14:34:07 on 92/05/11 GMT (by SHOWPM1 at TPAVMPS2)
  94. Subject: Com port address
  95. Ref: Append at 19:18:59 on 92/05/07 GMT (by SSIA013 at OS2CUST)
  96.  
  97. Yes, That is correct you would look at the absolute address 400 - 406
  98. to find out the port base address. Thank you, I should have added that
  99. to my first reply. If you need more information about this I would
  100. get the 'Personal System/2 and Personal Computer BIOS Interface
  101. Technical Reference', you can order this book from you branch
  102. office. The IBM number on this book is S04G-3283-00.
  103. You can also get the book 'Micro Channel Architecture Revolution
  104. in Personal Computing', ISBN number 0-442-00433-8 this will help
  105. a little. I also know that there are some other books out there
  106. that talk about the BIOS.
  107.  
  108. Joseph
  109.  
  110. ----- OS2PRG CFORUM appended at 18:00:44 on 92/05/13 GMT (by TEMP19GD at CLTVM1)
  111. Subject: Peeking a memory location
  112.  
  113. How does one go about looking at the contents of memory at some
  114. memory location under OS/2 2.0?
  115.  
  116. Thanks,
  117. Justin Smith
  118.  
  119. ----- OS2PRG CFORUM appended at 16:36:34 on 92/05/15 GMT (by FIECHTNE at BCRVMPC1)
  120. Subject: Peeking a memory location
  121. Ref:     Append at 18:00:44 on 92/05/13 GMT (by TEMP19GD at CLTVM1)
  122.  
  123. You must be able to build a Selector which includes the memory location
  124. where you wish to look.  Only a device driver can build selectors.
  125.  
  126. Mark Fiechtner
  127.  
  128. ----- OS2PRG CFORUM appended at 02:57:13 on 92/05/19 GMT (by WZ00541 at OS2CUST)
  129. Subject: Converting Windows programs to OS/2 via "MIRRORS"
  130.  
  131. We are currently using the MIRRORS libraries to convert our Windows
  132. applications to OS/2.  We have run into a couple of problems with MIRRORS.  I
  133. am trying to find the correct forum to ask questions about MIRRORS conversion
  134. and report problem.
  135.  
  136. ----- OS2PRG CFORUM appended at 13:09:37 on 92/05/19 GMT (by LECTION at BETASVM2)
  137. Subject: Converting Windows programs to OS/2 via "MIRRORS"
  138. Ref:     Append at 02:57:13 on 92/05/19 GMT (by WZ00541 at OS2CUST)
  139.  
  140. The most correct forum would be OS2WIN CFORUM. Also, if you have any
  141. questions about direct conversion of Windows code to OS/2 code, please
  142. ask away in that forum! I've programmed Windows apps for IBM for seven
  143. years, and I am now doing OS/2. So I can compare the two programming
  144. wise to a great extent.
  145.  
  146. David B. Lection
  147.  
  148. ----- OS2PRG CFORUM appended at 13:14:26 on 92/05/19 GMT (by WEEKS at AUSVM2) -
  149. ..... OS2PRG CFORUM modified at 15:26:22 on 92/05/19 GMT (by WEEKS at AUSVM2) .
  150. Subject: Converting Windows programs to OS/2 via "MIRRORS"
  151. Ref:     Append at 02:57:13 on 92/05/19 GMT (by WZ00541 at OS2CUST)
  152.  
  153. | Yeah, OS2WIN is probably better.
  154.  
  155. Craig Weeks
  156. OS/2 Application Development Center
  157. Austin, Texas
  158.  
  159. ----- OS2PRG CFORUM appended at 18:56:47 on 92/05/19 GMT (by KMCCARTH at ENDVM1)
  160. Subject: SYS RC4
  161.  
  162.   I am coding in C using PM and multiple threads and I get an ocasional
  163. RC 4 on a dosopen. I coded a dossetmaxfh to 40 but I don't have near
  164. that amt of files open. Does anyone know why this may be happening.
  165.  
  166. Kevin E. Mc Carthy
  167.  
  168. ----- OS2PRG CFORUM appended at 21:42:51 on 92/05/19 GMT (by UST1013 at OS2CUST)
  169. Subject: OS/2 Monitor
  170.  
  171. aaadkfdjkdj kjasjsdjlasdj lksdjlksdfjlkjsdlsd
  172.  
  173. ----- OS2PRG CFORUM appended at 21:44:05 on 92/05/19 GMT (by UST1013 at OS2CUST)
  174. Subject: OS/2 Monitor
  175.  
  176.  (no text entered)
  177.  
  178. ----- OS2PRG CFORUM appended at 21:47:29 on 92/05/19 GMT (by UST1013 at OS2CUST)
  179. Subject: OS/2 Monitor
  180.  
  181. Looking for an OS/2 monitor.  Facilities should include a display summary of
  182. the active sessions/processes/threads.  Would prefer one written in C that
  183. is packaged with C source code.  P.W.
  184.  
  185. ----- OS2PRG CFORUM appended at 15:30:19 on 92/05/20 GMT (by WWRAGG at SFOVMIC1)
  186. Subject: Converting Windows programs to OS/2 via "MIRRORS"
  187. Ref:     Append at 13:14:26 on 92/05/19 GMT (by WEEKS at AUSVM2)
  188. Thanks for taking care of my customer
  189.  
  190. ----- OS2PRG CFORUM appended at 14:59:42 on 92/05/21 GMT (by IL21834 at OS2CUST)
  191. Subject: Keyboard Buffer - Want to increase size
  192.  
  193. I have an OS/2 PM application with a Dialog Box containing an entry field;
  194. input to this entry field is either keyboard entry or a bar code scanner;
  195. the scanner input is coming through the keyboard port.
  196.  
  197. The problem we have is sometimes the scanner sends data to the keyboard buffer
  198. faster than the application can process it; the keyboard buffer is full;
  199. the PS/2 beeps; and characters are lost.
  200.  
  201. Two questions: 1) What is the current size of the Keyboard buffer?
  202.                2) Is there a way for us to increase the size of the
  203.                   keyboard buffer?
  204.  
  205. Thank You
  206. Ken Prince - EI DuPont
  207.  
  208. ----- OS2PRG CFORUM appended at 14:24:38 on 92/05/28 GMT (by AOI1075 at OS2CUST)
  209. Subject: SYS RC4
  210. Ref: Append at 18:56:47 on 92/05/19 GMT (by KMCCARTH at ENDVM1)
  211.  
  212. Are you opening files across the LAN?  If so, I believe you can get a return
  213. code 4 from DosOpen because of the configuration settings on the server.
  214.  
  215. J.Farmer
  216.  
  217. ----- OS2PRG CFORUM appended at 18:04:28 on 92/06/04 GMT (by WZ00541 at OS2CUST)
  218. Subject: Converting Windows programs to OS/2 via "MIRRORS"
  219. Ref: Append at 15:30:19 on 92/05/20 GMT (by WWRAGG at SFOVMIC1)
  220.  
  221. (no text entered)
  222.  
  223. Joel Rosenberger, Attachmate Corporation
  224.  
  225. ----- OS2PRG CFORUM appended at 20:10:17 on 92/06/04 GMT (by UDSS013 at OS2CUST)
  226. Subject: Program Abends During Exit Processing
  227.  
  228. I am in the midst of developing a PM application.  One of the bugs that I am
  229. currently trying to remedy is an abend during the execution the "return"
  230. statement in main().  I am getting a SYS3175.  I got into the debugger
  231. and set a breakpoint on the "return" statement.  If I step into the code, I
  232. am dropped into the assembler and I abend there during what I presume is
  233. exitlist handling.  I have coded no exitlist processing of my own.
  234.  
  235. This is a multithreaded PM application and my current theory is that it has
  236. something to do with the cleanup of the threads.   I do not terminate the
  237. threads in my code.  I just exit the main routine.  I've never had any
  238. problems with this under OS/2 v1.x.   This is my first 32-bit PM application.
  239. I am using C Set/2.
  240.  
  241. Any suggestions?  The threads were started using _beginthread.  I did not
  242. allocate any thread stack, as I understand that OS/2 v2.0 handles that now
  243. automatically.  This one's got me stumped.
  244.  
  245. Gary Murphy
  246.  
  247. ----- OS2PRG CFORUM appended at 20:50:07 on 92/06/04 GMT (by OCANUC at BETASVM2)
  248. Subject: Program Abends During Exit Processing
  249. Ref:     Append at 20:10:17 on 92/06/04 GMT (by UDSS013 at OS2CUST)
  250.  
  251. From an OS/2 command prompt, try "help sys3175" (if you haven't
  252. already).  The error text suggests a problem with pointers rather
  253. than threads.  Secondary threads should be shutdown automatically
  254. when the main thread is shutdown.
  255.  
  256. Brandon Booth   Advanced Programming - ICSRS
  257.  
  258. ----- OS2PRG CFORUM appended at 12:08:13 on 92/06/05 GMT (by WZ00576 at OS2CUST)
  259. Subject: How to turn an APIRET into a string?
  260.  
  261. Pollling through the documentation, I can't find any way to get a
  262. character string version of one of the ERROR_ APIRET values. I could
  263. type in my own table of strings for them, but it would only be in
  264. english. This is for some substrate code that can't make assumptions
  265. about Vio versus PM. Is there something I don't know?
  266.  
  267. Benson Margulies
  268.  
  269. ----- OS2PRG CFORUM appended at 13:58:43 on 92/06/05 GMT (by OCANUC at BETASVM2)
  270. Subject: How to turn an APIRET into a string?
  271. Ref:     Append at 12:08:13 on 92/06/05 GMT (by WZ00576 at OS2CUST)
  272.  
  273. I know exactly what you're talking about because I looked for
  274. the same thing a couple of years back.  I even started on the
  275. project, but quit (and for much the same reason you mention).
  276. So, if you write the dll, can I have a copy? (not serious;-)
  277.  
  278. Brandon Booth   Advanced Programming - ICSRS
  279.  
  280. ----- OS2PRG CFORUM appended at 17:16:45 on 92/06/05 GMT (by IL11901 at OS2CUST)
  281. Subject: How to turn an APIRET into a string?
  282. Ref: Append at 13:58:43 on 92/06/05 GMT (by OCANUC at BETASVM2)
  283.  
  284. Funny you should mention this at this point in time.  We are finishing up a
  285. high level runtime API debugger and production code monitor.  It reports the
  286. error which occurred AND a description of what the error means.  This idea
  287. was born out of the problem you describe (having to look up every error code)
  288. and the concept of centralizing error handling.
  289.  
  290. Message back if you are interested in more information.
  291.  
  292. Steve Dacek - Soft & GUI Inc
  293.  
  294. ----- OS2PRG CFORUM appended at 17:25:44 on 92/06/05 GMT (by IL11901 at OS2CUST)
  295. Subject: Program Abends During Exit Processing
  296. Ref: Append at 20:10:17 on 92/06/04 GMT (by UDSS013 at OS2CUST)
  297.  
  298. Most likely, you are not allocating enough stack or heap space (My money would
  299. be on heap space).  Add a lot more in your definition file and see if the
  300. problem goes away.  The minimum for both should be about 8K each.  This has
  301. usually solved the problem you describe whenever it has happened to me.
  302.  
  303. Good Luck.
  304.  
  305. Steve Dacek - Soft & GUI Inc
  306.  
  307. ----- OS2PRG CFORUM appended at 18:42:11 on 92/06/05 GMT (by XXNOVA24 at TORVMCOP)
  308. Subject: Program Abends During Exit Processing
  309. Ref:     Append at 20:10:17 on 92/06/04 GMT (by UDSS013 at OS2CUST)
  310.  
  311. Instead of 'return'-ing you can call the DosExit function. I haven't
  312. tried it with GA CSET/2 but this should do the job.
  313.  
  314. Geza Szivos
  315. NOVACOR Chemicals (403)-290-6583
  316.  
  317. ----- OS2PRG CFORUM appended at 20:22:48 on 92/06/05 GMT (by OCANUC at BETASVM2)
  318. Subject: Program Abends During Exit Processing
  319. Ref:     Append at 20:50:07 on 92/06/04 GMT (by OCANUC at BETASVM2)
  320.  
  321. One other thing to look at is the size of the thread stack(s).
  322. You can (potentially) have three kinds of stacks: the main
  323. stack (specified in the def file), secondary thread stacks
  324. (specified on the _beginthread call), and a 16-bit stack if
  325. you make calls to 16-bit routines (this value is specified
  326. in a pragma in IBM C-Set2).
  327.  
  328. Brandon Booth   Advanced Programming - ICSRS
  329.  
  330. ----- OS2PRG CFORUM appended at 22:34:35 on 92/06/05 GMT (by PMUELLR at CARVM3)
  331. Subject: How to turn an APIRET into a string?
  332. Ref:     Append at 13:58:43 on 92/06/05 GMT (by OCANUC at BETASVM2)
  333.  
  334. It may be overkill, but you can get text messages for os/2 error
  335. codes from the OSO001.MSG and OSO001H.MSG files in \os2\system (2.0).
  336. You can even do this in rexx with SysGetMessage()!
  337.  
  338. Patrick Mueller - IBM Cary
  339.  
  340. ----- OS2PRG CFORUM appended at 21:04:13 on 92/06/09 GMT (by ANFUSO at STLVM27)
  341. Subject: VIO Problems
  342.  
  343. I have a non-IBM friend who is trying to port an application
  344. to OS/2 (1.1+). I'm not a programmer, but I'll pose his
  345. problem as best I can:
  346.  
  347. .......................................................
  348. His application will run in a character-mode full-screen
  349. OS/2 session. He is concerned about the default colors
  350. available. He contends that the system pallette offers
  351. 16 colors, but notices that other applications use colors
  352. that don't seem to be available when he tries all of the
  353. 16 default colors. He is convinced that these other applications
  354. may be re-defining the system pallette, but wonders how this is
  355. done. He thinks it has something to do with "VIO".
  356. .........................................................
  357.  
  358. I'm not even sure if this is even a good forum to append this
  359. question to, since I don't know if PM has anything to do with it.
  360. His program is, apparently, NOT a PM program.
  361.  
  362. Any help at all would be appreciated, even if you can steer
  363. me in a better direction!
  364.  
  365. Tom Anfuso  J63/G331
  366. TL 543 - 4835
  367.  
  368. ----- OS2PRG CFORUM appended at 21:02:03 on 92/06/10 GMT (by WZ00576 at OS2CUST)
  369. Subject: Vio, in 2.0, what's that?
  370.  
  371. The CP documentation makes passing reference to several
  372. vio things, including popups and the like. But no where
  373. in the $300 box of programming documentation can I find
  374. any other information about it. Is There Another Book?
  375.  
  376. Benson Margulies
  377.  
  378. ----- OS2PRG CFORUM appended at 21:06:38 on 92/06/10 GMT (by WZ00576 at OS2CUST)
  379. Subject: How to turn an APIRET into a string?
  380. Ref: Append at 12:08:13 on 92/06/05 GMT (by WZ00576 at OS2CUST)
  381.  
  382. I saw the reply from someone at Cary referencing some files with
  383. strings in them, and a Rexx procedure to poke around therin.
  384. I'm finding it hard to believe that OS/2 2.0 lacks some API
  385. for fetching messages out of Locale=dependent files. In short,
  386. its hard to believe that there isn't a c-callable way to open
  387. the system message catalog and fish out the string for a
  388. particular APIRET. WHen I signed up for this BBS, the literature
  389. said that I could count on responses from the OS/2 support/devo
  390. group. Is this the right place to expect that?
  391.  
  392. Benson Margulies
  393.  
  394. ----- OS2PRG CFORUM appended at 11:53:23 on 92/06/11 GMT (by PMUELLR at CARVM3)
  395. Subject: How to turn an APIRET into a string?
  396. Ref:     Append at 21:06:38 on 92/06/10 GMT (by WZ00576 at OS2CUST)
  397.  
  398. I think you're referring to my append.  Sorry I only referenced the
  399. rexx function SysGetMessage (in the RexxUtil.dll external functions).
  400. There is also a function you can use from C - DosGetMessage() (this is
  401. the name in 1.3 - it may have changed in 2.0, but I don't have the 2.0
  402. toolkit at home).
  403.  
  404. Note that the original append seemed to want a way to translate a
  405. return code, say 8, into the string "ERROR_NOT_ENOUGH_MEMORY".  There
  406. is a define in the toolkit for
  407.    #define ERROR_NOT_ENOUGH_MEMORY 8
  408. I don't know how to do this.  The SysGetMessage() and DosGetMessage()
  409. functions return the text for the message.  For instance, here is a
  410. session from rexxtry with the 8 message:
  411.  
  412.    [E:\] rexxtry
  413.      REXXTRY.CMD lets you interactively try REXX statements.
  414.        Each string is executed when you hit Enter.
  415.          Enter 'call tell' for a description of the features.
  416.      Go on - try a few...             Enter 'exit' to end.
  417.    say sysgetmessage(8,oso001.msg)
  418.    SYS0008: There is not enough storage available to
  419.    process this command. All available storage is in use.
  420.  
  421.      ................................................ REXXTRY.CMD on OS/2
  422.    say sysgetmessage(8,oso001h.msg)
  423.    EXPLANATION: If segment swapping is active, the swap file may be
  424.    full, or an input/output (I/O) error may have occurred on the
  425.    auxiliary storage device that contains the swap file.
  426.    ACTION: Do one of the following and then retry the command:
  427.    1. Reduce the number of running programs.
  428.    2. Reduce the value of the BUFFERS=, TRACEBUF=, DISKCACHE=,
  429.       THREADS=, RMSIZE=, or DEVICE=VDISK.SYS statement
  430.       in the CONFIG.SYS file. Then restart the system.
  431.    3. Remove unwanted files from the swap file
  432.  
  433.      ................................................ REXXTRY.CMD on OS/2
  434.    exit
  435.  
  436. As I said before, this may be overkill.  Also note that the rexx
  437. function is implemented by calling DosGetMessage().  DosGetMessage()
  438. can be used to read any suitable OS/2 message file.
  439.  
  440. Patrick Mueller - IBM Cary
  441.  
  442. ----- OS2PRG CFORUM appended at 20:55:58 on 92/06/11 GMT (by JDEEN at AUSVM1) -
  443. Subject:Changing File Attributes
  444.  
  445. I am in the midst of programming an application that at one time
  446. may need to write/delete files with the read-only or hidden-file
  447. file attributes, I would like to DosOpen() and DosSetFileInfo() but
  448. this is clearly out because I can not not DosOpen() with write flags
  449. on when the file is write protected. Am I missing something or is there
  450. a 2.0 api that I can change a read_only to normal file status..
  451.  
  452. JAMES DEEN
  453.  
  454. ----- OS2PRG CFORUM appended at 00:35:45 on 92/06/12 GMT (by RICHKULP at CARVM3)
  455. Subject: Changing File Attributes
  456. Ref:     Append at 20:55:58 on 92/06/11 GMT (by JDEEN at AUSVM1)
  457.  
  458. Look up DosSetPathInfo. This allows you to change the attributes of
  459. a closed file. The only restriction is that nobody else can have
  460. the file open (i.e. Read-Only is OK to allow changes).
  461.  
  462. Rich Kulp
  463.  
  464. ----- OS2PRG CFORUM appended at 17:54:58 on 92/06/12 GMT (by DAVISN at HOUVMSCC)
  465. Subject: Vio, in 2.0, what's that?
  466. Ref:     Append at 21:02:03 on 92/06/10 GMT (by WZ00576 at OS2CUST)
  467.  
  468. The VIO and MOU calls (and maybe some others) are available in 2.0 for
  469. compatibility with 1.x.  They are not available as 32-bit entry points,
  470. and are not documented with the 32-bit toolkit.  If you need to find
  471. out how to use these calls, find a good book on programming OS/1 1.x
  472.  
  473. sorry,
  474.    Nathan Davis
  475.  
  476. ----- OS2PRG CFORUM appended at 12:44:40 on 92/06/23 GMT (by WZ00576 at OS2CUST)
  477. Subject: How to turn an APIRET into a string?
  478. Ref: Append at 11:53:23 on 92/06/11 GMT (by PMUELLR at CARVM3)
  479.  
  480. This is just what I wanted to know. Thanks.
  481.  
  482. Benson Margulies
  483.  
  484. ----- OS2PRG CFORUM appended at 12:50:14 on 92/06/23 GMT (by WZ00576 at OS2CUST)
  485. Subject: Vio, in 2.0, what's that?
  486. Ref: Append at 21:02:03 on 92/06/10 GMT (by WZ00576 at OS2CUST)
  487.  
  488. The response is not informative.
  489.  
  490. When the Control Program reference, particularly on the topic
  491. of DosExecPgm and DosStartSession, references Vio popups,
  492. is is describing a feature that is no longer meaningful? Is there
  493. no 32 bit API to OS/2 session windows at all? Is there a corresponding
  494. PM concept the documentation should reference instead?
  495.  
  496. Benson Margulies
  497.  
  498. ----- OS2PRG CFORUM appended at 14:45:03 on 92/06/24 GMT (by LINSUSAN at HKGVM8)
  499. Subject: compiling and linking 16-bit OS/2 API programs in 2.0
  500.  
  501. I have a sample program which calls the AS/400 PC Support API's.
  502. This sample program was compiled using MS C 6.0 and OS/2 1.3 toolkit.
  503. Therefore these must be 16 bit API's.
  504.  
  505. How do I call these API's in a 32 bit program developed using
  506. C Set/2, Toolkit 2.0? Unfortunaly the DLL that came with this
  507. API must be a 16 bit DLL. I seem to recall that I can call a 16 bit DLL
  508. from a  32 bit program.
  509.  
  510. What changes must I make to the header file? Right now the
  511. header contains statements such as :
  512.  
  513. extern int extentry QSNDDTAQ(...........
  514.  
  515. but my compiler doesn't like it.
  516.  
  517. How about any special options I must set to compile and link this?
  518.  
  519. Susan S. Lin
  520.  
  521. ----- OS2PRG CFORUM appended at 14:48:25 on 92/06/24 GMT (by LINSUSAN at HKGVM8)
  522. Subject: Minimize a session
  523.  
  524. I have written a OS/2 full screen program to DosStartSession a
  525. DOS FS program, after the DOS program finishes running, I do not
  526. want to close the session but want to minimize it and put it in
  527. the background.
  528.  
  529. What function do I need to make this happen? There is a DosSelectSession
  530. to bring a dependent child session to the foreground but what
  531. about moving the child session to the background?
  532.  
  533. Susan S. Lin
  534.  
  535. ----- OS2PRG CFORUM appended at 01:51:09 on 92/06/25 GMT (by LINSUSAN at HKGVM8)
  536. Subject: compiling and linking 16-bit OS/2 API programs in 2.0
  537.  
  538. I have a sample program which calls the AS/400 PC Support API's.
  539. This sample program was compiled using MS C 6.0 and OS/2 1.3 toolkit.
  540. Therefore these must be 16 bit API's.
  541.  
  542. How do I call these API's in a 32 bit program developed using
  543. C Set/2, Toolkit 2.0? Unfortunaly the DLL that came with this
  544. API must be a 16 bit DLL. I seem to recall that I can call a 16 bit DLL
  545. from a  32 bit program. Do I have to do some thunking or what?
  546.  
  547. What changes must I make to the header file? Right now the
  548. header contains statements such as :
  549.  
  550. extern int extentry QSNDDTAQ(...........
  551.  
  552. but my compiler doesn't like it.
  553.  
  554. How about any special options I must set to compile and link this?
  555. If someone has a short sample to do this, please send it to me. Thanks.
  556.  
  557. - Susan Lin (IBM China/Hong Kong)
  558.  
  559. ----- OS2PRG CFORUM appended at 14:11:54 on 92/06/25 GMT (by OCANUC at BETASVM2)
  560. Subject: compiling and linking 16-bit OS/2 API programs in 2.0
  561. Ref:     Append at 01:51:09 on 92/06/25 GMT (by LINSUSAN at HKGVM8)
  562.  
  563. The C-Set/2 Users Guide has a chapter on calling 16-bit functions
  564. from 32-bit code.  The bit of information that helped me the most
  565. was changing the function prototype of the 16-bit call from APIENTRY
  566. (which equates to _System) to APIENTRY16 (which equates to _Far16
  567. _Pascal).  The linker seemed to figure everything else out.  You
  568. do have to think about the 16-bit stack.  This is a pragma in C_SET/2
  569. (pragma stack16).
  570.  
  571. Brandon Booth   Advanced Programming - ICSRS
  572.  
  573. ----- OS2PRG CFORUM appended at 16:13:56 on 92/06/25 GMT (by LNK1SM3 at MARTLINK)
  574. Subject: compiling and linking 16-bit OS/2 API programs in 2.0
  575. Ref: Append at 01:51:09 on 92/06/25 GMT (by LINSUSAN at HKGVM8)
  576.  
  577. For a 32 bit program to call a 16 bit API in a DLL you must put:
  578.  
  579. APIRET16 APIENTRY16 16BITAPI(
  580.  
  581. This will tell the compiler to put thunking in for you. If this does
  582. not work give me some code and I will look at it. You should not
  583. to have to change your header at all unless you have you prototype
  584. there.
  585.  
  586. By the does any know if 'thunking' means my program is not 'thinking'!
  587.  
  588. Joseph A. Mogavero
  589.  
  590. ----- OS2PRG CFORUM appended at 17:17:40 on 92/06/29 GMT (by WZ00576 at OS2CUST)
  591. Subject: Named Pipe Local Host Name?
  592.  
  593. When using named pipes across a network, it would seem fairly
  594. important to be able to determine the local host name -- the
  595. name that some other machine would put into \\NAME\pathname.
  596. Where can I get it?
  597.  
  598. Benson Margulies
  599.  
  600. ----- OS2PRG CFORUM appended at 15:40:37 on 92/06/30 GMT (by XXTCAN06 at TORVMCOP)
  601. Subject: OS/2 command from Smalltalk/V PM 1.4.
  602.  
  603. Hi!
  604.   Does anybody know how to issue OS/2 commands from a Smalltalk/V PM 1.4
  605. program?  I'm specifically looking to run 'NET VIEW' commands.  Actually,
  606. the next step after that will be to refine the methods to use the NET API
  607. (which I'm not familiar with at all!).  So, as a 2nd question: Does
  608. anybody have any experience in making calls to DLLs from Smalltalk?  And
  609. were can I find the NET API DLL(s) and documentation?
  610.  
  611. Thanks.
  612.                                                 Pierre Legault
  613.                                                 Transport Canada
  614.                                                 1-613-993-7149
  615.  
  616. ----- OS2PRG CFORUM appended at 11:47:47 on 92/07/02 GMT (by WZ00576 at OS2CUST)
  617. Subject: DosRead of 0, waits?
  618.  
  619. I need to do a read-with-timeout from a perhaps local or perhaps
  620. remote named pipe. I don't see a way given the restriction of
  621. semaphore binding to local pipes.
  622.  
  623. Benson Margulies
  624.  
  625. ----- OS2PRG CFORUM appended at 03:22:53 on 92/07/03 GMT (by SDETWEIL at DETVMIC4)
  626. Subject: Named Pipe Local Host Name?
  627. Ref:     Append at 17:17:40 on 92/06/29 GMT (by WZ00576 at OS2CUST)
  628.  
  629. See the NetWkStaGetInfo api in the Lan Server manual...
  630.  
  631. It will return the Workstation name, Domain name and
  632. User name (if any)..this can't tell you the SERVER
  633. name of the pipe tho, as you CAN talk CROSS DOMAIN
  634. with Named Pipes PROVIDED you have access rights
  635. to the pipe AND are logged on..
  636.  
  637. Sam
  638.  
  639. ----- OS2PRG CFORUM appended at 03:23:53 on 92/07/03 GMT (by SDETWEIL at DETVMIC4)
  640. Subject: DosRead of 0, waits?
  641. Ref:     Append at 11:47:47 on 92/07/02 GMT (by WZ00576 at OS2CUST)
  642.  
  643. DosPeekNmPipe will tell you any data Exists..
  644.  
  645. Sam
  646.  
  647. ----- OS2PRG CFORUM appended at 11:39:24 on 92/07/03 GMT (by WZ00576 at OS2CUST)
  648. Subject: DosRead of 0, waits?
  649. Ref: Append at 03:23:53 on 92/07/03 GMT (by SDETWEIL at DETVMIC4)
  650.  
  651. I need to make a tnread wait for input but not read any imput.
  652. The routine you reference won't do that, will it?
  653.  
  654. Benson Margulies
  655.  
  656. ----- OS2PRG CFORUM appended at 11:42:26 on 92/07/03 GMT (by WZ00576 at OS2CUST)
  657. Subject: DosRead of 0, waits?
  658. Ref: Append at 03:23:53 on 92/07/03 GMT (by SDETWEIL at DETVMIC4)
  659.  
  660. I don't have the lan server API. What I have is the Novell
  661. netware requester, which supports Named Pipes, so I'm trying
  662. to just use them with the Control Program API. Is this as stupid
  663. an idea as I'm beginning to suspect? Does the Lan Server API work with plain
  664. Novell Named Pipes?
  665.  
  666. Somewhat on the subject, is there any chance of making semaphores
  667. work with remote named pipes. Its mighty inconvienient not to be
  668. able to do any sort of wait on them except DosRead.
  669.  
  670. Benson Margulies
  671.  
  672. ----- OS2PRG CFORUM appended at 18:01:59 on 92/07/06 GMT (by A157623 at OS2CUST)
  673. Subject: OS/2 and Smalltalk
  674.  
  675. I have interfaced Smalltalk with DLLs and can share that info with you.  The
  676. NET APIs calls are documented in the SDK for Lan Manager.  I have such a book
  677. and can give the details on the calls you will be needing.
  678.  
  679. Larry Mason
  680. Texas Instruments
  681.  
  682. ----- OS2PRG CFORUM appended at 18:13:08 on 92/07/07 GMT (by IL12431 at OS2CUST)
  683. Subject: Changing Keyboard States
  684.  
  685. Is there example code available showing how to change the keyboard (numlock,
  686. caps lock, and scroll lock) states?  I recall an older IBM IUO utility that
  687. changed startup states but I need example code for per session management.
  688.  
  689. Thanks in advance.
  690.  
  691. Dave Scheffer, ARGO Data Resource Corp.
  692.  
  693. ----- OS2PRG CFORUM appended at 21:26:05 on 92/07/07 GMT (by IL12431 at OS2CUST)
  694. Subject: Changing VIO font mode
  695.  
  696. Is there example code available showing how to change the operative video mode
  697. of an OS/2 VIO window to 132 character mode?  Am I able to do so internally or
  698. must I externally define the object/window?
  699.  
  700. Thanks in advance.
  701.  
  702. Dave Scheffer, ARGO Data Resource Corp.
  703.  
  704. ----- OS2PRG CFORUM appended at 14:21:19 on 92/07/09 GMT (by DALNK03 at OS2CUST)
  705. Subject: Changing Keyboard States
  706. Ref: Append at 18:13:08 on 92/07/07 GMT (by IL12431 at OS2CUST)
  707.  
  708. Here's a fragment of code which turns on the NumLock key when the program
  709. is activated, and turns it off when the program is deactivated.  Hope it
  710. helps:
  711.  
  712. MRESULT EXPENTRY WindowProc (HWND hwnd, USHORT msg, MPARAM mp1, MPARAM mp2)
  713. {
  714. static  BOOL    Toggled;
  715. static  BYTE    KeyStateTableì256┘;
  716.  
  717. switch (msg)
  718.     {
  719.     case WM_ACTIVATE:
  720.     case WM_SETFOCUS:
  721.         {
  722.         SHORT NumLockState;
  723.  
  724.         if (SHORT1FROMMP(mp1))
  725.             {
  726.             NumLockState = WinGetKeyState (HWND_DESKTOP, VK_NUMLOCK);
  727.             Toggled = NumLockState & 0x0001;
  728.  
  729.             if (!Toggled)
  730.                 {
  731.                 WinSetKeyboardStateTable(HWND_DESKTOP,
  732.                                         (PBYTE) KeyStateTable,
  733.                                         FALSE);
  734.  
  735.                 KeyStateTableìVK_NUMLOCK┘ |= 0x01;
  736.  
  737.                 WinSetKeyboardStateTable(HWND_DESKTOP,
  738.                                         (PBYTE) KeyStateTable,
  739.                                         TRUE);
  740.                 }
  741.             }
  742.         else
  743.              if (!Toggled)
  744.                  {
  745.                  KeyStateTableìVK_NUMLOCK┘ &= 0xFE;
  746.                  KeyStateTableìVK_CTRL┘ = 0;
  747.                 KeyStateTableìVK_ALT┘ = 0;
  748.  
  749.                 WinSetKeyboardStateTable(HWND_DESKTOP,
  750.                                         (PBYTE) KeyStateTable,
  751.                                         TRUE);
  752.                 }
  753.  
  754.         return (WinDefDlgProc(hwnd, msg, mp1, mp2));
  755.         }
  756.     }
  757. }
  758.  
  759. Patrick Malneritch, Delta Air Lines
  760.  
  761. ----- OS2PRG CFORUM appended at 13:16:42 on 92/07/10 GMT (by KWINZ at RALVM5) -
  762. ..... OS2PRG CFORUM modified at 13:50:39 on 92/07/10 GMT (by KWINZ at RALVM5) .
  763. Subject: Drive letter -> drive number
  764. Ref:     None
  765.  
  766. | Urk.  Never mind.  Looks like DosOpen is happy with opening
  767. | "a:panda.ndf" anyway, so I don't need to mess with the path.
  768. | There was an unrelated bug that was causing the DosOpen to
  769. | fail.  Shows what I get for jumping to conclusions....
  770.  
  771. Given a drive letter, is there any way for me to find out the drive
  772. number that's required for DosQCurDir?
  773.  
  774. What I need to do is to take an input of the form x:filename.ext,
  775. and insert the fully qualified path for the current directory
  776. on that drive, to come up with x:\panda\filename.ext.  That should
  777. give me a valid pathname that I can pass to DosOpen.
  778.  
  779. The problem is that I have a drive letter passed in, but DosQCurDir
  780. wants a drive number.  Is the drive number an absolute or a
  781. relative thing?  For example, if I get a drive letter "F:", will that
  782. always be drive number 6, or does it depend on how many logical
  783. drives are defined with lower letters on the system?
  784.  
  785. Kim Winz
  786.  
  787. ----- OS2PRG CFORUM appended at 13:33:18 on 92/07/10 GMT (by LECTION at BETASVM2)
  788. Subject: Drive letter -> drive number
  789. Ref:     Append at 13:16:42 on 92/07/10 GMT (by KWINZ at RALVM5)
  790.  
  791. Kim,
  792.  
  793. It is my impression that the drive number is an absolute number, with
  794. drive A: starting at zero. So if you have a letter you could use the
  795. following c code to get the number:
  796.  
  797.   int iDriveNumber =  (int) ( toupper('x') - 'A' );
  798.  
  799.   Where "x" is the drive letter.
  800.  
  801. David B. Lection
  802.  
  803. ----- OS2PRG CFORUM appended at 13:51:54 on 92/07/10 GMT (by KWINZ at RALVM5) -
  804. Subject: Drive letter -> drive number
  805. Ref:     Append at 13:33:18 on 92/07/10 GMT (by LECTION at BETASVM2)
  806.  
  807. I just found out that I was jumping to conclusions and I don't need
  808. to do this after all, but thanks for the info anyway.  Its good to
  809. know that; I'll file it away.
  810.  
  811. Thanks,
  812.  
  813. Kim Winz
  814.  
  815. ----- OS2PRG CFORUM appended at 13:55:17 on 92/07/10 GMT (by 64924111 at TOROHON1)
  816. Subject: Drive letter -> drive number
  817. Ref:     Append at 13:51:54 on 92/07/10 GMT (by KWINZ at RALVM5)
  818.  
  819. I believe that you only need the drive number to change drives from
  820. inside a program.
  821.  
  822. Regards.....Pete Liukaitis
  823.  
  824. ----- OS2PRG CFORUM appended at 16:53:07 on 92/07/10 GMT (by IL12431 at OS2CUST)
  825. Subject: Changing Keyboard States
  826. Ref: Append at 14:21:19 on 92/07/09 GMT (by DALNK03 at OS2CUST)
  827.  
  828. Thanks very much for the fragment, Patrick.
  829.  
  830. Dave Scheffer, ARGO Data Resource Corp.
  831.  
  832. ----- OS2PRG CFORUM appended at 18:23:03 on 92/07/10 GMT (by IL22868 at OS2CUST)
  833. Subject: Named Pipe Local Host Name?
  834. Ref: Append at 17:17:40 on 92/06/29 GMT (by WZ00576 at OS2CUST)
  835.  
  836. I believe the WHOAMI program in the Software Library section of this
  837. BBS has what you need (it contains both C source and EXE).
  838.  
  839. Ken Singer, Shell Oil, Houston
  840.  
  841. ----- OS2PRG CFORUM appended at 18:48:25 on 92/07/10 GMT (by IL22868 at OS2CUST)
  842. Subject: API For PSTAT.EXE Information
  843. Ref: Append at 18:03:29 on 92/06/25 GMT (by AT at VIA) -----
  844.  
  845. I have info on DosQProcStatus for 2.0 -- got it from KILLM2 on
  846. Gilmore's Magnum BBS (it may also be on other OS/2 BBSs).  If you
  847. can't find it, I may be able to FAX you the source.  Also on
  848. Gilmore's BBS, but in a more restrictive area, is PROCTST.  KILLM2
  849. includes source and an include file for the structure of the buffer
  850. returned from the OS/2 2.0 version of DosQProcStatus.  Following is
  851. the README.DOC file for KILLM2:
  852.  
  853. ===============================================================================
  854. KILLEM.EXE kills running processes by name. It works with version 6.177h or
  855. OS/2 2.0. Haven't tried any version before or after. It uses the undocumented
  856. API DosQProcStatus to get a list of running processes - therefore its stability
  857. is in question because IBM could change or remove this API without telling
  858. anyone.
  859.  
  860. Usage: KillEm process-name process-name ...
  861.  
  862. If no extension is given for process-name, .EXE is appended. process-name is
  863. the name that the program was started with.
  864.  
  865. All instances of all process-names will be killed unless those processes
  866. ignore KillProcess signals.
  867.  
  868. Any comments, suggestions, bug reports can be sent to my CIS id 72251,750.
  869.  
  870. Hope this utility proves useful.
  871.  
  872. Rick Fishman
  873. Code Blazers, Inc.
  874. 4113 Apricot
  875. Irvine, CA 92720
  876. ===============================================================================
  877.  
  878. Ken Singer, Shell Oil, Houston
  879.  
  880. ----- OS2PRG CFORUM appended at 12:09:13 on 92/07/13 GMT (by IL62623 at OS2CUST)
  881. Subject: Named Pipe Local Host Name?
  882. Ref: Append at 18:23:03 on 92/07/10 GMT (by IL22868 at OS2CUST)
  883.  
  884. Too bad IBM still hasn't supplied me with a version of PMHPO that
  885. can download. I'll ask my SE to fetch it. Thanks.
  886.  
  887. ----- OS2PRG CFORUM appended at 18:50:08 on 92/07/14 GMT (by KURODA at RALVM5)
  888. Subject : DosReallocSeg return code
  889.  
  890. I get return codes ERROR_ACCESS_DENIED (5) and ERROR_LOCKED (212)
  891. from DosReallocSeg.  I want to know what the return codes means.
  892.  
  893. Does anyone help me ?
  894.  
  895. Thanks in advance,
  896. Aki Kuroda  -----  Yamato, Japan
  897.  
  898. ----- OS2PRG CFORUM appended at 00:41:32 on 92/07/15 GMT (by PSC31 at OS2CUST)
  899. Subject: 32-bit executable file format
  900.  
  901. Is the 32-bit executable file format documented.  If so, where?
  902.  
  903. Bob Dedrick, Prodigy Services Company (P*HFDD60A)
  904.  
  905. ----- OS2PRG CFORUM appended at 00:52:53 on 92/07/15 GMT (by KENKAHN at PKSMRVM)
  906. Subject: DosReallocSeg return code
  907. Ref:     Append at 18:50:08 on 92/07/14 GMT (by KURODA at RALVM5)
  908.  
  909. There was a lot of discussion on this RC=5 problem with DosReallocSeg (I was
  910. getting it myself).  I'll see if I can dig up the exact discussion but I do
  911. remember that the *fix* was to simply reissue the DosReallocSeg call if you
  912. got a RC=5 on the first try.  The second try usually works.
  913.  
  914. Kenneth Kahn    Staff of IBM Fellow/NetWork Computing    Poughkeepsie, NY
  915. Internet: KENKAHN@PKSMRVM.VNET.IBM.COM       IBMMAIL: USIB25P9 at IBMMAIL
  916.  
  917. ----- OS2PRG CFORUM appended at 01:36:03 on 92/07/15 GMT (by V$IPAULD at BCRVMPC1)
  918. Subject: 32-bit executable file format
  919. Ref:     Append at 00:41:32 on 92/07/15 GMT (by PSC31 at OS2CUST)
  920.  
  921. The header files are available as part of the toolkit, along with
  922. a program EXEHDR that dumps info from an executable. Documentation
  923. on the format has been made available external to IBM. I can print
  924. and mail you a copy, or mail you a diskette, or transfer with a
  925. modem. Get me a mailing address or a phone number ...
  926.  
  927. Paul Devriendt, OS/2 Development.
  928.  
  929. ----- OS2PRG CFORUM appended at 12:37:04 on 92/07/15 GMT (by KURODA at RALVM5)
  930. Subject : DosReallocSeg return code
  931. Ref: Append at 00:52:53 on 92/07/15 GMT (by KENKAHN at PKSMRVM)
  932.  
  933. Kenneth, thanks for your response,
  934.  
  935. I call DosReallocSeg in my own memory management component.  This
  936. component calls RodSubSet, DosSubAlloc, and DosSubFree to manage
  937. the memory.  This component is a set of functions like library
  938. and the other components(thread) share this component to manage
  939. the memory pool.
  940.  
  941. I'm worried that I made some bug in my code.  Please let me know if
  942. you find some more information.
  943.  
  944. Thanks again,
  945. Aki Kuroda  -----  Yamato, Japan
  946.  
  947. ----- OS2PRG CFORUM appended at 23:20:39 on 92/07/15 GMT (by PSC31 at OS2CUST)
  948. Subject: 32-bit executable file format
  949. Ref: Append at 01:36:03 on 92/07/15 GMT (by V$IPAULD at BCRVMPC1)
  950.  
  951. Paul,
  952.  
  953. Probably U.S. mail is easiest.  My address is
  954.  
  955. Bob Dedrick
  956. Systems Development Manager
  957. Prodigy Services Company
  958. 445 Hamilton Avenue, Mail Stop B12D
  959. White Plains, NY 10601
  960.  
  961. We wrote a 16-bit post-mortem debugger for 1.3 which we're porting to 2.0.
  962.  
  963. Thanks.
  964.  
  965. Bob Dedrick, Prodigy Services Company (P*HFDD60A)
  966.  
  967. ----- OS2PRG CFORUM appended at 14:42:49 on 92/07/16 GMT (by IL61500 at OS2CUST)
  968. Subject: SYTOS PLUS FOR OS/2
  969.  
  970. HELLO EVERYONE!!!
  971.  
  972. DOES ANYONE KNOW OF A WAY THIS SCENARIO CAN BE ACCOMPLISHED:::
  973.  
  974. USING SYTOS PLUS FOR OS/2 1.3 ON AN OS/2 LANSERVER 1.3 TO B/U TO A SCSI ATTACHE
  975. D TECMAR B/U UNIT. UNIT IS ATTACHED TO SERVER; SW IS INSTALLED AT SERVER.
  976. WOULD LIKE TO WRITE A PROGRAM THAT WOULD ACCESS SYTOS PLUS, CHECK THE HEADER ON
  977.  THE CURRENT INSERTED TAPE AND RETURN A CONDITION TO ADVISE A USER TO CHANGE TH
  978. E TAPE IF IT MATCHES THE ONE OBSERVED PREVIOUSLY. SYTRON HAS BEEN OF NO ASSISTA
  979. NCE.
  980.  
  981. I KNOW THIS IS A TOUGH ONE.
  982.  
  983. ANY IDEAS?
  984.  
  985. THANKS!!
  986. LOU
  987.  
  988. LOU BREIT, DEAN WITTER REYNOLDS
  989.  
  990. ----- OS2PRG CFORUM appended at 16:05:54 on 92/07/16 GMT (by IL62623 at OS2CUST)
  991. Subject: Exit from executable entry, what do I do?
  992.  
  993. I just took a program that was working when entirely linked
  994. as a single module and broke it into a small executable and two
  995. dlls.
  996.  
  997. Now, when I run it (it is a pmtype:vio) from command line, it exits
  998. immediately. From ipmd, I learn that it terminates someplace in the
  999. startup code. I don't know where to look next. Can someone
  1000. give me a hint?
  1001.  
  1002. ----- OS2PRG CFORUM appended at 16:22:51 on 92/07/16 GMT (by KARRI at WINVMK) -
  1003. Subject: Exit from executable entry, what do I do?
  1004. Ref:     Append at 16:05:54 on 92/07/16 GMT (by IL62623 at OS2CUST)
  1005.  
  1006. Hello,
  1007.  
  1008.   Did you write your own DLL initialisation routine or are you letting
  1009. C Set/2 handle it for you?
  1010.  
  1011. Cheers, Karri.
  1012.  
  1013. ----- OS2PRG CFORUM appended at 17:07:05 on 92/07/16 GMT (by IL62623 at OS2CUST)
  1014. Subject: Exit from executable entry, what do I do?
  1015. Ref: Append at 16:22:51 on 92/07/16 GMT (by KARRI at WINVMK) -
  1016.  
  1017. I have no custom init routines. My .def file looks like:
  1018.  
  1019. LIBRARY libos
  1020. PROTMODE
  1021. DATA MULTIPLE NONSHARED READWRITE LOADONCALL
  1022. CODE LOADONCALL
  1023. EXPORTS
  1024.  
  1025. and then the exports list.
  1026.  
  1027. I'm using tcpip 1.2.1, which is 16 bit. Is it possible
  1028. that PROTMODE is a bad idea if my dll calls into the TCP dll
  1029. which is 16 bit?
  1030.  
  1031. ----- OS2PRG CFORUM appended at 17:07:36 on 92/07/16 GMT (by IL62623 at OS2CUST)
  1032. Subject: Exit from executable entry, what do I do?
  1033. Ref: Append at 16:22:51 on 92/07/16 GMT (by KARRI at WINVMK) -
  1034.  
  1035.  (no text entered)
  1036.  
  1037. ----- OS2PRG CFORUM appended at 08:27:04 on 92/07/17 GMT (by KARRI at WINVMK) -
  1038. Subject: Exit from executable entry, what do I do?
  1039. Ref:     Append at 17:07:05 on 92/07/16 GMT (by IL62623 at OS2CUST)
  1040.  
  1041. I suppose the 1st ? I have to ask you is that: is your DLL 32-bit?
  1042. i.e. for OS/2 2.00? Would help a lot if you could either append a
  1043. code snippet or even send it over so that I could have a look and a
  1044. play around with it.
  1045.  
  1046. All the Best, Karri.
  1047.  
  1048. ----- OS2PRG CFORUM appended at 11:17:19 on 92/07/17 GMT (by IL62623 at OS2CUST)
  1049. Subject: Exit from executable entry, what do I do?
  1050. Ref: Append at 08:27:04 on 92/07/17 GMT (by KARRI at WINVMK) -
  1051.  
  1052. It is a brand new 32 bit dll, built with icc and link386. I don't
  1053. have any way to upload it at this time, except perhaps with help from
  1054. my SE. It would be moderately large. Can I fedex you a disk?
  1055.  
  1056. ----- OS2PRG CFORUM appended at 11:33:43 on 92/07/17 GMT (by IL62623 at OS2CUST)
  1057. Subject: Exit from executable entry, what do I do?
  1058. Ref: Append at 11:17:19 on 92/07/17 GMT (by IL62623 at OS2CUST)
  1059.  
  1060. Some more experiments show that the dll's are themselves fine -- I can
  1061. create a trivial executable that calls them, link it with them, and
  1062. it works. So there is something wrong with the executable I'm actually
  1063. trying to run.
  1064.  
  1065. Is there any way to really verify that I haven't accidently compiled
  1066. a .obj file with the /Ge- flag and then tried to link it into an
  1067. executable?
  1068.  
  1069. The failing program is pretty large and complex, and worked when the
  1070. whole mess was compiled /Ge+ and linked all into one .exe. Surely
  1071. there are a limited number of conditions that would provoke this sort
  1072. of behavior?
  1073.  
  1074. ----- OS2PRG CFORUM appended at 11:47:55 on 92/07/17 GMT (by IL62623 at OS2CUST)
  1075. Subject: Exit from executable entry, what do I do?
  1076. Ref: Append at 11:33:43 on 92/07/17 GMT (by IL62623 at OS2CUST)
  1077.  
  1078. Well, indeed, one module linked to my base executable had been
  1079. mistakenly compiled /Ge-. Couldn't link386 somehow detect and complain
  1080. about this?
  1081.  
  1082. ----- OS2PRG CFORUM appended at 13:12:34 on 92/07/17 GMT (by KARRI at WINVMK) -
  1083. Subject: Exit from executable entry, what do I do?
  1084. Ref:     Append at 11:47:55 on 92/07/17 GMT (by IL62623 at OS2CUST)
  1085.  
  1086. Did it fix the problem though?
  1087.  
  1088. Cheers, Karri.
  1089.  
  1090. ----- OS2PRG CFORUM appended at 19:02:07 on 92/07/17 GMT (by IL62623 at OS2CUST)
  1091. Subject: Exit from executable entry, what do I do?
  1092. Ref: Append at 13:12:34 on 92/07/17 GMT (by KARRI at WINVMK) -
  1093.  
  1094. Oh yes. Once I compiled all the executable pieces /Ge+ the thing worked
  1095. fine.
  1096.  
  1097. ----- OS2PRG CFORUM appended at 19:08:13 on 92/07/17 GMT (by IL62623 at OS2CUST)
  1098. Subject: longjmp versus exception handling
  1099.  
  1100. Ive an exception handler.
  1101.  
  1102. The exception handler calls a routine that calls longjmp,
  1103. which of course call Unwind.
  1104.  
  1105. The unwind target is scoped within the exception handler,
  1106. so the unwind operation should not disturb the exception handler.
  1107.  
  1108. However, it appears that once the unwind happens, the exception handler
  1109. is somehow disabled, even though it still is listed in the chain
  1110. rooted in the TIB. That is, a general protection fault happening after
  1111. the longjmp is not reported to the exception handler.
  1112.  
  1113. help?
  1114.  
  1115. ----- OS2PRG CFORUM appended at 21:02:48 on 92/07/29 GMT (by IL71794 at OS2CUST)
  1116. Subject: TRAP screen information?
  1117.  
  1118. Can anyone direct me to or give me information on interpreting TRAP screens?
  1119.  
  1120. Chris Eytalis
  1121.  
  1122. ----- OS2PRG CFORUM appended at 15:56:40 on 92/07/30 GMT (by DALNK03 at OS2CUST)
  1123. Subject: TRAP screen information?
  1124. Ref: Append at 21:02:48 on 92/07/29 GMT (by IL71794 at OS2CUST)
  1125.  
  1126. I put together this info from what I've been able to figure out.  Hope it
  1127. helps:
  1128.  
  1129. To make use of the Trap Screen Information:
  1130.  
  1131.  1   Add /Fc to C compiler options
  1132.  2   Add /MAP to Link options
  1133.  
  1134.  3   Look at the IP number from the Trap Screen
  1135.  
  1136.  4   Search the map file for the routine that the number falls into.
  1137.         (the bottom information in the map file is sorted by
  1138.          address order)
  1139.  
  1140.       Example: IP=4194  from trap screen.
  1141.  
  1142.       Map file listings:
  1143.  
  1144.             .
  1145.             .
  1146.             .
  1147.  
  1148.          0001:33B6       _print_ifdef_script
  1149.          0001:3840       _find_and_hash_each_line
  1150.          0001:443E       _read_files
  1151.          0001:462A       _print_normal_script
  1152.  
  1153.             .
  1154.             .
  1155.             .
  1156.  
  1157.       The trap happened in routine _find_and_hash_each_line
  1158.  
  1159.         (IP > 3840 and IP < 443E
  1160.  
  1161.  5   Subtract the offending functions address from the IP
  1162.  
  1163.         4194 - 3840 = 960 hex.
  1164.  
  1165.  6   Now search the .COD file which was generated (/Fc option) for the
  1166.      function (_find_and_hash_each_line)
  1167.  
  1168.         example:
  1169.  
  1170.                 _find_and_hash_each_line    PROC FAR
  1171.                 *** 000278  c8 1a 00 00         enter   26,0
  1172.  
  1173.  7   Take the hex number (000278) and add it to the calculated number
  1174.      from step 5.
  1175.  
  1176.         (278+960 = BD8 hex)
  1177.  
  1178.  8   Now search down the .COD file for the number calculated in step 7.
  1179.      The trap happened at that instruction.
  1180.  
  1181.         example:
  1182.  
  1183.                 ;|***     if (c != *--p1)
  1184.                 ; Line 442
  1185.                 *** 000bd2  8e 46 e2        mov es,WORD PTR Ã¬bp-30┘
  1186.                 *** 000bd5  49          dec cx
  1187.                 *** 000bd6  8b d9           mov bx,cx
  1188. trapped here -> *** 000bd8  26 38 07        cmp BYTE PTR es:ìbx┘,al
  1189.                 *** 000bdb  75 12           jne $L20084
  1190.  
  1191.         The bug is on line 442 of the source code.
  1192.  
  1193. The CS value seems to be translatable to the .EXE's .MAP file via
  1194. the following assignments:  0047=1:, 0067=2:, 0087=3:, 00a7=4:, ...
  1195.  
  1196. Patrick Malneritch, Delta Air Lines
  1197.  
  1198. ----- OS2PRG CFORUM appended at 18:23:47 on 92/07/30 GMT (by WEEKS at AUSVM2) -
  1199. Subject: TRAP screen information?
  1200. Ref:     Append at 15:56:40 on 92/07/30 GMT (by DALNK03 at OS2CUST)
  1201.  
  1202. This is a good technique for OS/2 1.x.  But it is not applicable
  1203. to 2.0 where IP is really EIP and is 32-bits long.  I haven't
  1204. figured out how to map the EIP value back to the .EXE or .DLL, much
  1205. less the actual routine that was running.  I'm sure our customers
  1206. (and even we internal types) would love to see some guidance on
  1207. how to do this in the 2.0 environment.  Post it here if you have
  1208. any.
  1209.  
  1210. Craig Weeks
  1211. LAN Systems Performance (DCE)
  1212. Austin, Texas
  1213.  
  1214. ----- OS2PRG CFORUM appended at 14:14:22 on 92/07/31 GMT (by KEENLEY at TOROLAB6)
  1215. Subject: TRAP screen information?
  1216. Ref:     Append at 18:23:47 on 92/07/30 GMT (by WEEKS at AUSVM2)
  1217.  
  1218. EXEs are always loaded at address 0x10000 (64K).  DLLs are always loaded
  1219. in high memory ie. somewhere below 512M.  If you get a trap at a
  1220. relatively low address then the trap is probably occurring inside the
  1221. EXE.  Subtract 0x10000 from the EIP value and look up this offset in
  1222. the MAP file.  This will give you the function where the trap occurred.
  1223. Finding TRAPs in DLLs is harder because you have to figure out where
  1224. they are loaded.
  1225.  
  1226. John Keenleyside  OS/2 Compiler Dev.
  1227.  
  1228. ----- OS2PRG CFORUM appended at 17:41:53 on 92/08/01 GMT (by XXPRMN01 at TORVMCOP)
  1229. Subject: Trap information
  1230. One way of interpreting the trap info is to take the address of your
  1231. first function within one of your DLL's.  Usually, you will be able
  1232. to then compute the address similar to the method used to find the
  1233. modules within the .EXE by subtracting 0x10000.
  1234.  
  1235. Matt Smith, Prominare Inc.
  1236.  
  1237. ----- OS2PRG CFORUM appended at 14:14:30 on 92/08/04 GMT (by IL12431 at OS2CUST)
  1238. Subject: Changing Keyboard States
  1239. Ref: Append at 14:21:19 on 92/07/09 GMT (by DALNK03 at OS2CUST)
  1240.  
  1241. I note that this fragment is a WindowProc - will it work for a VIO/Full-screen
  1242. session as well?  If not, does someone have a fragment for non-window sessions?
  1243.  
  1244. Dave Scheffer, ARGO Data Resource Corp.
  1245.  
  1246. ----- OS2PRG CFORUM appended at 15:41:05 on 92/08/04 GMT (by DALNK03 at OS2CUST)
  1247. Subject: Changing Keyboard States
  1248. Ref: Append at 14:14:30 on 92/08/04 GMT (by IL12431 at OS2CUST)
  1249.  
  1250. I think the code should work for a VIO program.  The WinGetKeyState function
  1251. requires a message queue, so you'll need to have the following:
  1252.  
  1253. hab = WinInitialize (0);
  1254. hmq = WinCreateMsgQueue (hab, 0);
  1255.  
  1256. I don't know how a VIO program can determine if it is gaining or losing
  1257. focus, maybe somebody else can help out there.
  1258.  
  1259. Pat Malneritch, Delta Air Lines
  1260.  
  1261. ----- OS2PRG CFORUM appended at 18:46:34 on 92/08/05 GMT (by AMRT071 at OS2CUST)
  1262. Subject: DosQueue and memory problem
  1263.  
  1264.    Are there any known problems using Dos queues ??
  1265.  
  1266.    I have had a random problem of memory being freed during
  1267.    DosReadQueue and DosWriteQueue function calls.
  1268.  
  1269.    My app is multi-threaded and reads/writes to several
  1270.    queues.  One thread creates the queues and seperate threads
  1271.    read from them.  The problem is as follows :
  1272.    1.    A sperate process running on the workstation will allocate
  1273.          a block of memory and send it back to my app via DDE.
  1274.  
  1275.    2.    One thread will allocate a small block of memory that
  1276.          contains the data I wish to pass to the other thread
  1277.          and writes that pointer addess to a queue.
  1278.  
  1279.    3.    A seperate thread will read the pointer address from that queue
  1280.          and the block memory that was allocated by the seperate
  1281.          process is freed in error by the Que function and the value
  1282.          at the pointer address will be put in its place.  The memory
  1283.          coming from the seperate  process IS IN NO WAY used
  1284.          during or at anytime near the time the queue functions are
  1285.          being processed.
  1286.  
  1287.       I really need help with this one.
  1288.  
  1289.       Thanks
  1290.  
  1291. W. David Ashley American Airlines
  1292.  
  1293. ----- OS2PRG CFORUM appended at 23:48:00 on 92/08/05 GMT (by SDETWEIL at DETVMIC4)
  1294. Subject: DosQueue and memory problem
  1295. Ref:     Append at 18:46:34 on 92/08/05 GMT (by AMRT071 at OS2CUST)
  1296.  
  1297. Queues AND DDE do NOT copy data. They pass only POINTERS to data.
  1298.  
  1299. If on the DDE send from app2 to app1, the PM WinProc should malloc()
  1300. and COPY the data sent from app2, OR DosWriteQueue with the
  1301. address, or it will be lost after the Winproc ends.
  1302.  
  1303. DosReadQueue does NOT copy data. It returns the POINTER VALUE
  1304. written at the time of DosWriteQueue.
  1305.  
  1306. I've used Queues extensively and have never encountered this
  1307. problem.
  1308.  
  1309. Is is possible that the shared memeory allocated in app2
  1310. (it MUST BE SHARED for DDE between processes) is not
  1311. DosGiveSeg'd to app1?
  1312.  
  1313. Sam
  1314.  
  1315. ----- OS2PRG CFORUM appended at 17:58:29 on 92/08/06 GMT (by IL57044 at OS2CUST)
  1316. Subject: Trap D in DosSubAlloc
  1317.  
  1318. I Have an app that uses DosAllocSeg and DosSubAlloc to obtain memory. After
  1319. many iterations of DosSubAlloc/DosSubFree I am getting a trap D.  Message SYS31
  1320. 75 indicates DOSCALL1.DLL 0005 as the routine getting the access violation.
  1321. Also, when I request 64K of memory on DosAllocSeg, OS/2 intermittantly gets a
  1322. system trap D.  This is an OS/2 16 bit app developed on OS/2 1.3.  Is there
  1323. something I should be aware of when useing this type of memory management on
  1324. OS/2 2.0?
  1325.  
  1326. Thanks!  Larry Snyders
  1327.  
  1328. ----- OS2PRG CFORUM appended at 19:34:42 on 92/08/11 GMT (by JAMILLE1 at CHGVMIC1)
  1329. Subject: WinQuerySwitchList
  1330. A novice C and OS/2 API programmer needs some help, please!
  1331. I have written a program that looks at the task list entries and
  1332. selects one to become the active program.  Excerpts of the code
  1333. follows:
  1334.  
  1335. typedef struct _SWB {
  1336.     ULONG cswentry;
  1337.     SWENTRY aswentry<48>;  /* square brackets for an array */
  1338.  } SWB;   /* I am establishing a max of 48 entries */
  1339.  
  1340. HAB hab = 0;
  1341. SWB SwitchBlock;
  1342. void main ()
  1343. { ULONG NumberOfTasks,i;
  1344.     NumberOfTasks = WinQuerySwitchList(hab,NULL,0);
  1345.     NumberOfTasks = WinquerySwitchList( (HAB) hab,
  1346.                     (PSWBLOCK) &SwitchBlock,
  1347.                     (ULONG) sizeof(SwitchBlock) );
  1348. etc.
  1349. My problem is that it keeps blowing up on the last statement with
  1350. a "General Protection Fault Exception".  (I step it through debug and
  1351. the 1st WinQuerySwitchList runs fine and returns a valid number in
  1352. NumberOfTasks.)
  1353. I'm doing this with OS/2 2.0 and C-SET/2.
  1354. Any help would be appreciated.  Thanks.
  1355.  
  1356. ----- OS2PRG CFORUM appended at 11:22:01 on 92/08/13 GMT (by DALNK03 at OS2CUST)
  1357. ..... OS2PRG CFORUM modified at 11:32:07 on 92/08/13 GMT (by DALNK03 at OS2CUST)
  1358. Subject: WinQuerySwitchList
  1359. This APPEND was deleted at 07:32:07 on 08/13/92 EST.
  1360.  
  1361. ----- OS2PRG CFORUM appended at 19:31:02 on 92/08/17 GMT (by OCANUC at BETASVM2)
  1362. Subject: Trap D in DosSubAlloc
  1363. Ref:     Append at 17:58:29 on 92/08/06 GMT (by IL57044 at OS2CUST)
  1364.  
  1365. DosAllocSeg no longer exists in OS/2 2.0 due to the flat memory
  1366. model.  As for memory sub-allocation the internal discussion within
  1367. IBM seems to indicate that the malloc and free support in the C-Set/2
  1368. product are just fine for most applications (we use this in particular).
  1369.  
  1370. Brandon Booth   Spoken Language Systems
  1371.  
  1372. ----- OS2PRG CFORUM appended at 19:50:39 on 92/08/17 GMT (by FIECHTNE at BCRVMPC1)
  1373. Subject: Trap D in DosSubAlloc
  1374. Ref:     Append at 19:31:02 on 92/08/17 GMT (by OCANUC at BETASVM2)
  1375.  
  1376. DosAllocSeg certainly DOES exist in 2.0 but not in the 32-bit API set.
  1377. Please re-read the append which you referenced, this is a compatability
  1378. point which we MUST maintain.
  1379.  
  1380. As for solving the original problem, I've not seen this type of problem
  1381. and I have a home grown 16-bit Async Terminal which uses these calls
  1382. all over the place.  I know of no restrictions that are imposed by
  1383. OS/2 2.0 for these services.  I suggest a service call to log a
  1384. problem report against our 1.X compatability.
  1385.  
  1386. Mark Fiechtner (OS/2 Development)
  1387.  
  1388. ----- OS2PRG CFORUM appended at 23:05:17 on 92/08/17 GMT (by IL72906 at OS2CUST)
  1389. Subject: Writing a IFS?
  1390.  
  1391. Where is there information on writing an Installable File System?
  1392.  
  1393. David Alcock - Central and South West Services - Dallas, Tx
  1394.  
  1395. ----- OS2PRG CFORUM appended at 12:47:50 on 92/08/18 GMT (by 72468326 at EHONE)
  1396. Subject: OS/2 V2 and Fortran/2 Malfuntions with READ from a file
  1397.  
  1398. My customer uses large programs compiled with Fortran/2. If he runs
  1399. such programs under OS/2 V2 he gets errors when reading real variables
  1400. from a file. For example:
  1401.   READ (5,'(F10.3)'),A    ( A = 1.000)
  1402.   WRITE (7,'(F10,3)'),A   ( A = +++++++++++)
  1403.  
  1404. Who has any ideas, suggestion? Please respond offline to
  1405.  
  1406. Wilfried Mensching, System Engineer ACIS Hannover, Germany
  1407. HAMENSC at HAMBVM2
  1408.  
  1409. ----- OS2PRG CFORUM appended at 19:49:19 on 92/08/20 GMT (by IL12431 at OS2CUST)
  1410. Subject: OS2 v1.3 VIO 132 column mode
  1411.  
  1412. What VIO function mode is used to get 132 column display?  The DOS mode 20
  1413.  
  1414. was mode 20, and it is not clear to me in the documentation how to toggle
  1415. 132 column VIO setmode.
  1416.  
  1417. Dave Scheffer, ARGO Data Resource Corp.
  1418.  
  1419. ----- OS2PRG CFORUM appended at 20:07:06 on 92/08/20 GMT (by KENKAHN at PKSMRVM)
  1420. Subject: OS2 v1.3 VIO 132 column mode
  1421. Ref:     Append at 19:49:19 on 92/08/20 GMT (by IL12431 at OS2CUST)
  1422.  
  1423. You use the VioSetMode command.  To swtich to 132 columns you use:
  1424.  
  1425.   viomi_Col  = 132;
  1426.   viomi_Row  = 28;
  1427.   viomi_hres = 1056;
  1428.   VioSetMode(..);
  1429.  
  1430. To switch back to 80 column mode
  1431.  
  1432.   viomi_Col  = 80;
  1433.   viomi_Row  = 25;
  1434.   viomi_hres = 720;
  1435.   VioSetMode(..)
  1436.  
  1437. The important part here is setting the Horizontal resolution.
  1438.  
  1439. Kenneth Kahn    Staff of IBM Fellow/NetWork Computing    Poughkeepsie, NY
  1440. Internet: KENKAHN@PKSMRVM.VNET.IBM.COM       IBMMAIL: USIB25P9 at IBMMAIL
  1441.  
  1442. ----- OS2PRG CFORUM appended at 20:36:35 on 92/08/21 GMT (by IL12431 at OS2CUST)
  1443. Subject: OS2 v1.3 VIO 132 column mode
  1444. Ref: Append at 20:07:06 on 92/08/20 GMT (by KENKAHN at PKSMRVM)
  1445.  
  1446. Ken, thanks for the info.  However, when I run this code under OS/2 2.0
  1447. the result is a shaking, banded display and appears to be scrolling very
  1448. rapidly from top to bottom.  Following are the parameters on the call.
  1449.  
  1450. Length    =   34
  1451. Type      =    1
  1452. Color     =    4
  1453. Col       =  132
  1454. Row       =   28
  1455. hres      = 1056
  1456. vres      =  400
  1457. Format ID =    0
  1458. Attrib    =    1
  1459.  
  1460. Interestingly enough, I get similar results on the MODE 132,28 command.
  1461. I do get a zero return code from the system when I pipe my test code
  1462. through CVP, though.
  1463.  
  1464. Could the problem be hardware?  I'm testing on a beta model 57 w/8515
  1465. monitor.  The BIOS is dated 8/28/91, submodel 38, revision 6.
  1466.  
  1467. ----- OS2PRG CFORUM appended at 00:07:53 on 92/08/22 GMT (by KENKAHN at PKSMRVM)
  1468. Subject: OS2 v1.3 VIO 132 column mode
  1469. Ref:     Append at 20:36:35 on 92/08/21 GMT (by IL12431 at OS2CUST)
  1470.  
  1471. I'm fairly certain it's not an OS/2 V2 problem per say.  I got this code from
  1472. an application I have (a 3270 Terminal Emulator) that runs on both 1.x and 2.0
  1473. systems.  I'm afraid I'm not that savy on this so hopefully someone else can
  1474. comment on your problem.
  1475.  
  1476. Just to make sure I got the obvious out of the way, you are using an XGA type
  1477. adapter, right?  132 columns are supported only on an XGA.  Also this will
  1478. olny work in a full screen mode, not in a VIO window.
  1479.  
  1480. Kenneth Kahn    Staff of IBM Fellow/NetWork Computing    Poughkeepsie, NY
  1481. Internet: KENKAHN@PKSMRVM.VNET.IBM.COM       IBMMAIL: USIB25P9 at IBMMAIL
  1482.  
  1483. ----- OS2PRG CFORUM appended at 20:05:40 on 92/08/24 GMT (by DJJQ1 at OS2CUST)
  1484. Subject: Writing a IFS?
  1485. Ref: Append at 23:05:17 on 92/08/17 GMT (by IL72906 at OS2CUST)
  1486.  
  1487. I don't have a document ID, but we obtained from IBM a document titled
  1488. "Installable File Systems For OS/2 Version 2.0" from the OS/2 File Systems
  1489. Department, PSPC Boca Raton, Florida  (dated Feb 17, 1992)   It doesn't have
  1490. "IBM Internal use only" on it so I assume that you should be able to get it
  1491. without too much trouble.   I'm not personally working with IFS, but I
  1492. understand that it is not trivial.
  1493.  
  1494. Hope this helps
  1495.  
  1496. Kevin Phillips - DST Systems, Inc.  Kansas City, MO
  1497.  
  1498. ----- OS2PRG CFORUM appended at 18:01:38 on 92/08/25 GMT (by AMRT071 at OS2CUST)
  1499. Subject: Pgms using IOPL
  1500.  
  1501. I am currently writing a program which needs to play some music to the PC's
  1502. speaker.  All the examples I am using are 1.x programs which use segments
  1503. which have been marked IOPL to the linker.  I have tried using the same
  1504. technique with 32-bit programs but when executed the segments which have been
  1505. marked as IOPL all cause an access violation when the first code instruction (a
  1506. PUSH EBP) is executed.  Can someone give me a hint as to what I am doing wrong?
  1507.  
  1508. Thanks in advance.
  1509.  
  1510. W. David Ashley American Airlines
  1511.  
  1512. ----- OS2PRG CFORUM appended at 23:52:48 on 92/08/26 GMT (by SDETWEIL at DETVMIC4)
  1513. Subject: Writing a IFS?
  1514. Ref:     Append at 20:05:40 on 92/08/24 GMT (by DJJQ1 at OS2CUST)
  1515.  
  1516. The hardest part is memory mgmt, as the IFS runs at ring 0 (kernel mode)..
  1517.  
  1518. I have written a couple of IFSs supporting both 1.3 and 2.0, so
  1519. ask away..
  1520.  
  1521. Sam
  1522.  
  1523. ----- OS2PRG CFORUM appended at 23:54:30 on 92/08/26 GMT (by SDETWEIL at DETVMIC4)
  1524. Subject: Pgms using IOPL
  1525. Ref:     Append at 18:01:38 on 92/08/25 GMT (by AMRT071 at OS2CUST)
  1526.  
  1527. You still have to do the same thing, 32 bit pgms do not yet support
  1528. IOPL level segments.
  1529.  
  1530. So, you must make a 16 bit segment, mark it IOPL as before
  1531. and call it from the 32 bit code..
  1532.  
  1533. 32 bit code CANNOT do IN/OUT instructions directly...
  1534.  
  1535. Sam
  1536.  
  1537. ----- OS2PRG CFORUM appended at 18:22:09 on 92/09/01 GMT (by PNWB016 at HONE81)
  1538. Subject: Exception handler questions            
  1539.  
  1540. One of the developers I work with asked that I submit the
  1541. following questions... thanks in advance for any light that may
  1542. be shed on this.
  1543.  
  1544. I need some help with an Exception Handler:
  1545.    I want to get the same information that is displayed when
  1546.    a trap screen appears.
  1547.  
  1548.    I have found where the EIP is kept
  1549.    (ExceptionAddress field of the EXCEPTIONREPORTRECORD)
  1550.    but...
  1551.    Where is the thread number kept?
  1552.  
  1553.    Where is the Register info. kept?
  1554.    It doesn't appear that it's in the CONTEXTRECORD field because all
  1555.    all values are zero in it when I get control.
  1556.  
  1557. Thanks again!
  1558.  
  1559. Wayne "Not responsible for the contents of this message" Holmes
  1560. U S WEST Communications
  1561.  
  1562. ----- OS2PRG CFORUM appended at 15:59:22 on 92/09/09 GMT (by STINCHI at ROMESC)
  1563. Subject:  DLL.
  1564.  
  1565. We are working with OS/2 DLL. We need to export functions and variables
  1566. from main program (staticly linked)
  1567. to DLL (all the examples show how to
  1568. export functions and variables from DLL to main).
  1569. Is it possible ? Have someone source code
  1570. or some form of documentation on this problem?
  1571. Any help will be appreciated.
  1572.  
  1573. Stefano Stinchi  and Fabrizio Pacelli.
  1574.  
  1575. ----- OS2PRG CFORUM appended at 16:48:52 on 92/09/09 GMT (by WEEKS at AUSVM2) -
  1576. Subject: DLL.
  1577. Ref:     Append at 15:59:22 on 92/09/09 GMT (by STINCHI at ROMESC)
  1578.  
  1579. You can't EXPORT from .EXE to .DLL the way you can from .DLL to
  1580. .EXE (via .DEF file).  If you want the .DLL to have access to the
  1581. .EXE variables you can use shared memory, or pass a pointer to the
  1582. .DLL function as a parameter, or any one of several other (probably)
  1583. techniques.
  1584.  
  1585. Craig Weeks
  1586. LAN Systems Performance (DCE)
  1587. Austin, Texas
  1588.  
  1589. ----- OS2PRG CFORUM appended at 16:55:59 on 92/09/09 GMT (by VENRTC51 at DFWVM04)
  1590. Subject: int 3 obj
  1591.  
  1592.     I need an object file that does an interrupt 3 which I can link
  1593. with my C code.  This is for 16 bit code, large model.
  1594.  
  1595. Thanks,
  1596. Kurt
  1597. (VENRTC51 at DFWVM04)
  1598.  
  1599. ----- OS2PRG CFORUM appended at 01:35:04 on 92/09/10 GMT (by SDETWEIL at DETVMIC4)
  1600. Subject: int 3 obj
  1601. Ref:     Append at 16:55:59 on 92/09/09 GMT (by VENRTC51 at DFWVM04)
  1602.  
  1603. If using MS C6, just make one
  1604.  
  1605. trace()
  1606. {
  1607.  _asm {
  1608.    int 3
  1609.   };
  1610. }
  1611.  
  1612. Then when you need to stop, just add
  1613.   trace(); to your code.
  1614. I pass a parm, when I need to know WHICH trace entry caused the stop
  1615. Sam
  1616.  
  1617. ----- OS2PRG CFORUM appended at 20:28:46 on 92/09/14 GMT (by XXWESB07 at TORVMCOP)
  1618. Subject: DosWriteQueue returns 334
  1619.  
  1620. I am developing a 32-bit multithreaded PM application that is using
  1621. queues (ie. DosCreateQueue, DosWriteQueue, DosReadQueue). My app
  1622. successfully writes/reads from/to the queue a number of times. Then
  1623. a DosWriteQueue() call fails with error 334. Looking this up it says
  1624. "Inadequate queue memory". Doing a help 334 it goes on to say that you
  1625. should contact the supplier of the program! Anyways, I am wondering if
  1626. there is a system configuration parameter that affects the amount of
  1627. memory available to the queues code in the system. I am unable to locate
  1628. any additional information on this error code and how to resolve it.
  1629. My swap file is about 10MB and there is about 35MB left on the swap
  1630. device. I am running 2.0 GA on a P70 with 8MB of RAM using the
  1631. Workset/2 (no CSDs) over a network.
  1632.  
  1633. The code I am using was copied (almost a clone) from the 16-bit version
  1634. of our application that was a background process under OS/2 1.3.
  1635. We never encountered this error under OS/2 1.3.
  1636.  
  1637. Also, if the DosWriteQueue() fails, the app sleeps for 5 seconds and
  1638. then retries but is never able to successfully complete.
  1639. Thanks...
  1640.  
  1641. Craig Knelsen, ISM Corp.
  1642. One Research Drive, Regina, SK  S4S 7H1
  1643. (306) 781-5191
  1644.  
  1645. ----- OS2PRG CFORUM appended at 01:36:49 on 92/09/15 GMT (by SDETWEIL at DETVMIC4)
  1646. Subject: DosWriteQueue returns 334
  1647. Ref:     Append at 20:28:46 on 92/09/14 GMT (by XXWESB07 at TORVMCOP)
  1648.  
  1649. When writing between processes, one must give/get access to the
  1650. shared memory somehow. Under 1.x you did a DosGive/GetSeg on the
  1651. selector and then a DosFreeSeg when you were done. Both sides
  1652. freed the selector eventually, and the use count dropped to 0,
  1653. and the memory was freed...
  1654.  
  1655. Now, under 2.0, the BASE address of the DosAllocMem object must
  1656. be Given/Gotten AND FREED, else the memory does not get freed..
  1657.  
  1658. 334 sounds like the elements were not pulled off the queue,
  1659. but only PEEKed...
  1660.  
  1661. Sam
  1662.  
  1663. ----- OS2PRG CFORUM appended at 15:54:32 on 92/09/15 GMT (by XXWESB07 at TORVMCOP)
  1664. Subject: DosWriteQueue returns 334
  1665. Ref:     Append at 01:36:49 on 92/09/15 GMT (by SDETWEIL at DETVMIC4)
  1666.  
  1667. Thanks for the reply. Your reply tells me that I need to further
  1668. clarify what my app is doing. The 16-bit version communicates with
  1669. other processes (the one who started it and those it starts) using
  1670. pipes (unnamed and named). In the 32-bit version, the process that
  1671. used to start the 16-bit app is now combined into one program with
  1672. multiple threads although it still communicates with 32-bit PM
  1673. apps, that it starts, using named pipes. The queues are used internally
  1674. within the app (either 16 or 32 bit versions) to send messages between
  1675. the threads. We use malloc() to allocate space for the messages.
  1676. However, since our message areas are of a fixed size, we optimize the
  1677. allocation routine by saving the addresses of our processed messages
  1678. in a free list. The allocation routine checks this free list and uses
  1679. a previously allocated message area if there's one available. Otherwise,
  1680. it calls malloc().
  1681. I hope that the system queues code in 2.0 is not expecting the msgs that
  1682. have been written to the queue and then retrieved by DosReadQueue() are
  1683. free'd within a short space of time after that. I do not see why it
  1684. would matter in the above scenario.
  1685.  
  1686. Craig Knelsen, ISM Corp.
  1687. One Research Drive, Regina, SK  S4S 7H1
  1688. (306) 781-5191
  1689.  
  1690. ----- OS2PRG CFORUM appended at 16:26:26 on 92/09/15 GMT (by ALIU at BOSTON) --
  1691. Subject: 'Dir' Command locks resources?
  1692. Hi,
  1693.  
  1694. I am wondering about what's going on with the simple old 'Dir' command.
  1695. Basically, I'm writing a REXX program that is checking the last file
  1696. write access timestamp of a given file.  Everything seems OK
  1697. with the REXX program itself. However, in another OS2 Window, I've
  1698. got another program that will occasionally update the same file.
  1699. When that happens, it appears that as I obtain the Directory information
  1700. of that file via that Rexx program, if I happen to be updating that
  1701. file, I get a Resource/Lock message with an RC = 32. I think I can
  1702. get around this by trapping for RC = 32 in the other process basically
  1703. by doing a retry of the write.
  1704.  
  1705. However, I wonder what's going on with the 'Dir' statement. It seems
  1706. to me that I'm only trying to read the Directory Information of the
  1707. file. Why am I locking up the Resource? Is there some other way of
  1708. getting the Directory Information without locking that resource up?
  1709. Anybody else have another suggestion than checking for RC = 32?
  1710.  
  1711. Regards,
  1712. Art Liu (ALIU at BOSTON)
  1713. IBM Services Company
  1714. Client/Server Practice
  1715.  
  1716. ----- OS2PRG CFORUM appended at 18:11:52 on 92/09/15 GMT (by RICHKULP at CARVM3)
  1717. Subject: 'Dir' Command locks resources?
  1718. Ref:     Append at 16:26:26 on 92/09/15 GMT (by ALIU at BOSTON)
  1719.  
  1720. In your REXX command try doing this command instead of 'Dir' It should
  1721. be easier and faster and may fix your lock problem:
  1722.  
  1723.    filename = 'c:\whatever'  /* Any file name is valid. */
  1724.    .
  1725.    .
  1726.    .
  1727.    datetime = stream(filename, 'c', 'query datetime')
  1728.  
  1729. datetime will then contain the date and time in this format:
  1730.    mm-dd-yy hh:mm:ss
  1731.  
  1732. Rich Kulp
  1733.  
  1734. ----- OS2PRG CFORUM appended at 03:19:54 on 92/09/16 GMT (by SDETWEIL at DETVMIC4)
  1735. Subject: DosWriteQueue returns 334
  1736. Ref:     Append at 15:54:32 on 92/09/15 GMT (by XXWESB07 at TORVMCOP)
  1737.  
  1738. As the queue doesn't actually copy any data, there is no timing
  1739. relationship involved. all the queue does is pass the pointer
  1740. from one place to another..
  1741.  
  1742. I'd say, if you can recreate this in a smaller testcase, then
  1743. you have a legitimate bug..
  1744.  
  1745. Just for grins, have you tried serializing around reading/writing
  1746. from/to the queue from the multiple threads? It shouldn't be
  1747. required, but then bugs are just that..
  1748.  
  1749. Sam
  1750.  
  1751. ----- OS2PRG CFORUM appended at 20:02:25 on 92/09/17 GMT (by XXTCAN06 at TORVMCOP)
  1752. Subject: Interface Smalltalk/V PM 1.4 to NETAPI.DLL under OS/2 2.0.
  1753. Hi!
  1754.   I'm trying to call my 1st API in NETAPI.DLL from Smalltalk/V PM 1.4
  1755. but I'm obviously not doing it quite right yet 'cause I'm getting
  1756. protection exceptions or infinite message loops et al.
  1757.   Firstly: I'm under OS/2 2.0 but I'm reading the usoft 'LAN Manager
  1758. Programmer's Reference for version 2.0'.  Is that reference book valid?
  1759. If so, why would this wrapper method for NetUseEnum not work?:
  1760.  
  1761. useEnum: pszServer level: sLevel buffer: pbBuffer bufferSize: cbBuffer
  1762.   entriesRead: pcEntriesRead totalAvail: pcTotalAvail
  1763.     <api: NETUSEENUM struct short struct ushort struct struct ushort >
  1764.     `self invalidArgument .
  1765.  
  1766. The code to test this method is as follows:
  1767.  
  1768. | answer buffer entriesRead totalAvail |
  1769. buffer := String new: 64 .
  1770. entriesRead := 0 .
  1771. totalAvail := 0 .
  1772. answer := NetAPIDLL open
  1773.  useEnum: '' asParameter
  1774.  level: 1
  1775.  buffer: buffer asParameter
  1776.  bufferSize: (buffer size)
  1777.  entriesRead: entriesRead
  1778.  totalAvail: totalAvail .
  1779. self halt .
  1780.  
  1781. The 'NetAPIDLL open' seems to be working 'cause it inspects as
  1782. 'NetAPIDLL{61 3 }'.
  1783.  
  1784. The prototype for NetUseEnum in the book is:
  1785.  
  1786. #define INCL_NETUSE
  1787. #define INCL_NETERRORS
  1788. #include <lan.h>
  1789.  
  1790. API_FUNCTION
  1791. NetUseEnum (const char far *            pszServer,
  1792.             short                       sLevel,
  1793.             char far *                  pbBuffer,
  1794.             unsigned short              cbBuffer,
  1795.             unsigned short far *        pcEntriesRead,
  1796.             unsigned short far *        pcTotalAvail
  1797.            );
  1798.  
  1799. Anyone with any ideas?  Maybe especially Larry Mason of Texas Instruments
  1800. who said, back in July, that he had some expertise in that field.
  1801.  
  1802. Thanks.
  1803.  
  1804. ----- OS2PRG CFORUM appended at 07:32:17 on 92/09/23 GMT (by DEV0144 at OS2CUST)
  1805. Subject: ACCESSING PHYSICAL MEM VIA IOCtl Device Driver Function
  1806.  
  1807. Howdy, I am writing a device driver, for a memory mapped i/o board. This memory
  1808. mapped i/o board is an isa 8 bit isa class card that runs in an IBM pc 'crone'.
  1809.  
  1810. I would appreciate a code sample that illustrates an application call via
  1811. DosDevIOCtl to a device driver accessing a chunk of physical memory. Also the
  1812. receiving device driver code chunk would be appreciated.
  1813.  
  1814. I am thouroughly confused as to how to accomplish this seemingly simple task.
  1815.  
  1816. Every time I access my device driver I get a 'GP' fault. I have ordered the
  1817. Control Programming Reference manual, but have not received it as yet. I hope
  1818. this will shed some further light on the subject.
  1819.  
  1820. The Physical Device Driver Reference is not very clear on this subject.
  1821.  
  1822. I appreciate IBM's decision to allow folks (such as I) access to this forum.
  1823.  
  1824. Thankyou.
  1825.  
  1826. Any help regarding this matter will be greatly appreciated.
  1827.  
  1828. ----- OS2PRG CFORUM appended at 10:19:00 on 92/09/23 GMT (by KENKAHN at PKSMRVM)
  1829. Subject: ACCESSING PHYSICAL MEM VIA IOCtl Device Driver Function
  1830. Ref:     Append at 07:32:17 on 92/09/23 GMT (by DEV0144 at OS2CUST)
  1831.  
  1832. I thinkwhat you are asking is how an application can request access to the
  1833. physical memory on an adapter card.  If this is the case then the following
  1834. applies (if not the following is useful anyway but you can ignore it).
  1835.  
  1836. In the device driver, you use the PhysToUVirt DevHelp to translate the
  1837. physical memory to a virtual storage address that is accessible via the
  1838. calling process's LDT Table.
  1839.  
  1840. DCA_Address   DD   0CE000h     ; Address of DCA Buffer on 3270 Adapter
  1841.               org
  1842. DCAaddrHI     DW   0000Ch
  1843. DCAaddrLO     DW   0E000h
  1844.  
  1845. Mov   AX,DCAaddrHI        ; Get the High-order address
  1846. Mov   BX,DCAaddrLO        ; Get the  Low-order address
  1847. Mov   CX,8192             ; get the buffer size
  1848. Mov   DH,1                ; make segment R/W
  1849. Mov   DL,DevHlp_PhysToUVirt
  1850. Call  Device_Help
  1851. Mov   CX,ES               ; Save Selector
  1852. Mov   DX,BX               ; Save Offset
  1853. LES   BX,Request_Packet   ; restore request packet address
  1854. LES   BX,ES:[BX+15]       ; get a pointer to IOCtlParms
  1855. Mov   ES:[BX],DX          ; save Offset   into IOCtlParms
  1856. Mov   ES:[BX+2],CX        ; Save Selector into IOCtlParms
  1857.  
  1858. The allocated virtual address will be returned in IOCtlParms.  An application
  1859. would use DosDevIOCtl to call the DD and pass it a 32-bit pointer field.
  1860. The DD would return the values ES:BX in this 32-bit field, which the
  1861. application could then use directly as a pointer to the buffer.
  1862.  
  1863. IOCtlData   DB   50  DUP(?)
  1864. IOCtlParms  DB   50  DUP(?)
  1865. DCApointer  DD   ?
  1866.  
  1867. @DosDevIOCtl IOCtlData,IOCtlParms,2,80h,DD_Handle
  1868.  
  1869. Mov   BX,Word Ptr IOCtlParms     ; get the Offset returned
  1870. Mov   Word Ptr DCApointer,BX     ; save it
  1871. Mov   BX,Word Ptr IOCtlParms+2   ; get the Selector returned
  1872. Mov   Word Ptr DCApointer+2,BX   ; save it
  1873.  
  1874. Kenneth Kahn    Staff of IBM Fellow: IBM Personal/370    Poughkeepsie, NY
  1875. Internet: KENKAHN@PKSMRVM.VNET.IBM.COM       IBMMAIL: USIB25P9 at IBMMAIL
  1876.  
  1877. ----- OS2PRG CFORUM appended at 21:06:33 on 92/10/05 GMT (by DEV2953 at OS2CUST)
  1878. Subject: Direct Access of I/O ports using the IOPL priveleges in OS2 2.0
  1879.  
  1880. I have been having the following problem in converting my OS2 1.3 Applicaation
  1881. to OS2 2.0 application. We have a hardware accelerator that resides on the PC B
  1882. us and the Microchannel.  It only has I/O port for communicatioon. In OS2 1.3 w
  1883. e were able to talk to our hardware  by enabling IOPL=YES  in  the config.sys f
  1884. ile and enabling IOPL privileges for the whole segment that specifically commun
  1885. icated with the hardware.  If a similar procedure is followed on OS2 then I am
  1886. getting exception error whenever I enter the segment with IOPL enabled for the
  1887. segment.  If IOPL is not enabled then the program enters the segment but flags
  1888. an exception whenever it encounters an I/O instruction.
  1889. I would like some help that can resolve my problem vis-a-vis access to our hard
  1890. ware aceelerators ports .  We are currently using WATCOM/386 compiler for OS2.
  1891. The version of the compiler is 9.0.  WATCOM is suggesting that OS2 2.0 does not
  1892.  allowing direct access to hardware ports. "IS IT TRUE".
  1893.  
  1894.  MY REQUEST FOR AN ANSWER IS VERY URGENT.  WE HAVE A MAJOR CUSTOMER WHO HAS REQ
  1895. UESTED US TO PORT OUR LIBRARIES TO OS2 2.0
  1896.  
  1897. My phone number is 619-452-0903 x26 and I am available 12:30 p.m to 10 p.m East
  1898. er Time.
  1899.  
  1900. ----- OS2PRG CFORUM appended at 22:09:07 on 92/10/05 GMT (by ZUBER at RALVM14)
  1901. Subject: Direct Access of I/O ports using the IOPL priveleges in OS2 2.0
  1902. Ref:     Append at 21:06:33 on 92/10/05 GMT (by DEV2953 at OS2CUST)
  1903.  
  1904. IOPL still exists in V2.0, but it has to still look just like it did
  1905. in V1.3.  Or in other words, it can't have 386 instructions.
  1906.  
  1907. Clyde Zuber
  1908.  
  1909. ----- OS2PRG CFORUM appended at 02:20:00 on 92/10/06 GMT (by V$IPAULD at BCRVMPC1)
  1910. Subject: Direct Access of I/O ports using the IOPL priveleges in OS2 2.0
  1911. Ref:     Append at 21:06:33 on 92/10/05 GMT (by DEV2953 at OS2CUST)
  1912.  
  1913. You still have to be at ring 2 to access ports in version 2.0. You
  1914. will trap if you try to access a port from ring 3. There is no
  1915. compiler support for ring 2 in the flat 32-bit world (it requires
  1916. a segment register change, and the concept of changing segment
  1917. registers does not exist in a flat programming model.
  1918.  
  1919. The easiest way to do this is to do the port access from ring 2 in
  1920. 16-bit code just as on versions 1.x, and write a thunk to call the
  1921. 16-bit code from your 32-bit code.
  1922.  
  1923. Paul Devriendt
  1924.  
  1925. ----- OS2PRG CFORUM appended at 12:12:30 on 92/10/06 GMT (by KEENLEY at TOROLAB6)
  1926. Subject: Direct Access of I/O ports using the IOPL priveleges in OS2 2.0
  1927. Ref:     Append at 02:20:00 on 92/10/06 GMT (by V$IPAULD at BCRVMPC1)
  1928.  
  1929. C Set/2 will supply the thunking code for the 32 to 16 call
  1930. automagically.
  1931.  
  1932. John Keenleyside  OS/2 Compiler Dev.
  1933.  
  1934. ----- OS2PRG CFORUM appended at 20:25:26 on 92/10/06 GMT (by ABLI001 at OS2CUST)
  1935. Subject: Direct Access of I/O ports using the IOPL priveleges in OS2 2.0
  1936. Ref: Append at 21:06:33 on 92/10/05 GMT (by DEV2953 at OS2CUST)
  1937.  
  1938. This is interesting. I thought 2.0 was upwardly compatible in this area.
  1939. Did you get the error using the original compiled version (16bit) or did
  1940. it only occur after recompiling with the 386 compiler?
  1941.  
  1942. ->Rich Corbett; ABC Liquors, Inc., Orlando, FL              (NASPA: CORBRIC7)
  1943.  
  1944. ----- OS2PRG CFORUM appended at 21:22:55 on 92/10/06 GMT (by V$IPAULD at BCRVMPC1)
  1945. Subject: Direct Access of I/O ports using the IOPL priveleges in OS2 2.0
  1946. Ref:     Append at 20:25:26 on 92/10/06 GMT (by ABLI001 at OS2CUST)
  1947.  
  1948. OS/2 2.0 is compatible as regards IOPL in that a 1.x application
  1949. with both ring 2 and ring 3 segments will run unchanged on 2.0.
  1950. However, you can not take the source for this application, and
  1951. recompile as 32-bit.
  1952.  
  1953. Paul Devriendt
  1954.  
  1955. ----- OS2PRG CFORUM appended at 14:21:25 on 92/10/08 GMT (by XXPRMN01 at TORVMCOP)
  1956. Subject: Direct Access of I/O ports using the IOPL priveleges in OS2 2.0
  1957. Ref:     Append at 12:12:30 on 92/10/06 GMT (by KEENLEY at TOROLAB6)
  1958.  
  1959. Automagically ??
  1960.  
  1961. Matt Smith, Prominare Inc.
  1962.  
  1963. ----- OS2PRG CFORUM appended at 22:06:28 on 92/10/08 GMT (by THRUMD at SYDVM1)
  1964. Subject: Direct Access of I/O ports using the IOPL priveleges in OS2 2.0
  1965. Ref:     Append at 14:21:25 on 92/10/08 GMT (by XXPRMN01 at TORVMCOP)
  1966.  
  1967. Absolugely!
  1968. Dave
  1969.  
  1970. ----- OS2PRG CFORUM appended at 01:24:32 on 92/10/09 GMT (by AAAF0CY at OS2CUST)
  1971. Subject: DosStartSession
  1972.  
  1973. I would like to start a DOS window from an OS/2 program and have the
  1974. OS/2 program be able to know when the DOS pgm terminates. There are
  1975. several options, but so far the most promising has been to use
  1976. DosStartSession creating a child window and using the TermQ field to
  1977. provide notification to the OS/2 pgm. I'm having a problem where the
  1978. child window immediately terminates. i.e. the window appears with
  1979. "Dos Window" in the title bar then immediately "Closing DOS Window"
  1980. shows up in the title bar and the window terminates. If I create the
  1981. DOS window as independent instead of a child, it works fine. The
  1982. queue is being created and the create function has a return code of
  1983. 0. I don't remember what happens if I start an OS/2 child window. I
  1984. think it also immediately terminates, so there maybe a problem with
  1985. the DosStartSession call. Has anyone had experience with this under OS/2 2.0
  1986. and can give me a helpful hint???
  1987.  
  1988. Thanks
  1989.  
  1990. Jim Sauber, MN Mutual
  1991.  
  1992. ----- OS2PRG CFORUM appended at 03:52:45 on 92/10/13 GMT (by DEV2203 at OS2CUST)
  1993. Subject: PDD access via DOS MVDM using IOCTLS (INT44)
  1994.  
  1995. Can a DOS MVDM session access an OS/2 device driver (PDD) using the
  1996. INT 21 function 44H to create an IOCTL packet for send and receive.
  1997.  
  1998. The general thought here is that you need a VDD to connect to the
  1999. OS/2 PDD.  The DOS program would then speak to the VDD via INT21 (44)
  2000. and the VDD would pass the commands over to the PDD.
  2001.  
  2002. The objective is to allow a DOS program to talk to the existing OS/2
  2003. device driver via INT 21 calls.
  2004.  
  2005. Can this be done without the need for a VDD?
  2006.  
  2007. Thanks,
  2008.  
  2009. Phil
  2010.  
  2011. ----- OS2PRG CFORUM appended at 11:08:49 on 92/10/13 GMT (by FIECHTNE at BCRVMPC1)
  2012. Subject: PDD access via DOS MVDM using IOCTLS (INT44)
  2013. Ref:     Append at 03:52:45 on 92/10/13 GMT (by DEV2203 at OS2CUST)
  2014.  
  2015. This can be done without a VDD. (the MODE command does this)
  2016.  
  2017. Mark Fiechtner
  2018.  
  2019. ----- OS2PRG CFORUM appended at 15:44:58 on 92/10/14 GMT (by SAMEH at YKTVMH) -
  2020. Subject: General OS/2 semaphore question.
  2021.  
  2022. When using an Event semaphore, the system keeps track of the
  2023. number of times that the semaphore gets posted since the last
  2024. Reset. The documentation is clear on this. However, the documentation
  2025. says nothing about what happens to this post count as a result of
  2026. DosWaitEventSem() or DosWaitMuxWaitSem() system calls.
  2027.  
  2028. Does the post count get automatically decremented every time I
  2029. DosWaitEventSem() on the semaphore and find it already posted?
  2030.  
  2031. Does the post count get automatically decremented when I
  2032. DosWaitMuxWaitSem() and the Event semaphore is already posted?
  2033. (This is after adding the event semaphore to the MuxWait semaphore).
  2034.  
  2035. Will the semaphore eventually get automatically 'Reset' when the post
  2036. count reaches zero?
  2037.  
  2038. Also, is there a good OS/2 2.0 reference book like the "The Waite Group's
  2039. OS/2 Programmer's Reference by Asael Dror" was for OS/2 1.3?
  2040.  
  2041. Thanks in advance for any help.....
  2042.  
  2043. Sameh A. Fakhouri
  2044.  
  2045. ----- OS2PRG CFORUM appended at 15:49:35 on 92/10/15 GMT (by PSC30 at OS2CUST)
  2046. Subject: writing mouse device drivers
  2047.  
  2048. I originally posted this question in BASE back in May.  I got some responses
  2049. from KIKO @ TOROLABS (Thanks, Kiko!) but without REAL documentation and the
  2050. toolkit, I couldn't react to them.  I now have BOTH, and the project was
  2051. overdue then.
  2052. I wrote a mouse replacement driver for 1.3 to support a graphics drawing
  2053. pad (absolute positioning device). When I moved this driver to 2.0, it did
  2054. not work. The several suggestions offered then did not work.
  2055. Basically, after the device driver loads via CONFIG.SYS it initializes
  2056. correctly(?) but there is no cursor visible on the screen at all.  KDB seems
  2057. to show that the correct events are being pushed to MOUSE$ via the Process_
  2058. Packet (or Process_Absolute) IDC. The Query_Config and Read_Enable entries
  2059. seem to be entered correctly.  If I run a text program that issues 'MouRead
  2060. EventQue' it shows ever changing (and apparently correct) positions - so I
  2061. assume that the events being pushed to MOUSE$ are being accepted and
  2062. reported.
  2063. My suspicion is that somehow the cursor (pointer arrow) "thinks" it is
  2064. "behind" the desktop, but I have no way of knowing that and I have not yet
  2065. been able to externalize it into visibility.
  2066.  
  2067. Kiko offered the suggestion that ALL 2.0 mouse events MUST show motion (event
  2068. bit 0 = 1), but I have tried that without success and the Toolkit PDD
  2069. manual EXPLICITLY says that absolute position events do not contain motion.
  2070. I also run the device in "relative" mode (Process_Packet) with no success.
  2071.  
  2072. I know that the 2.0 IDC structures have changed slightly from 1.3.  I've
  2073. programmed for that!  In 1.3, the AX register contained non-zero if MOUSE$
  2074. did not accept the event (the carry bit was also set per the doc, but AX
  2075. was also set - I walked through the MOUSE$ code too many times!!)
  2076. I am consistently getting a non-zero AX in 2.0 (documentation claims only
  2077. carry is significant, but carry is off in my case so I must assume that the
  2078. event was accepted in spite of the AX code...
  2079.  
  2080. I'm starting to run on here.  Can anybody help with this?  I think if I
  2081. can get the pointer visible, it would be working correctly....
  2082.  
  2083. Graham Yarbrough - Prodigy Services Co
  2084.  
  2085. ----- OS2PRG CFORUM appended at 15:33:41 on 92/10/16 GMT (by PSC30 at OS2CUST)
  2086. Subject: Writing a IFS?
  2087.  
  2088. Ref: Append at 23:05:17 on 92/08/17 GMT (by Il72906 at OS2CUST)
  2089. I downloaded a copy of "Installable File Systems for OS2 2.0 ....." dated
  2090. May 20, 1992 from the Developers Assistance BB in Boca.  I suggest that you
  2091. start by calling 407-982-6408 to get enrolled.  All you need is a license
  2092. for the 2.0 Toolkit.
  2093. It is a big document and it looks like writing an IFS is non-trivial, but
  2094. it doesn't look like its beyond a good OS/2 knowledgeable programmer.
  2095.  
  2096. Graham Yarbrough - Prodigy Services Co
  2097.  
  2098. ----- OS2PRG CFORUM appended at 12:48:32 on 92/10/21 GMT (by IL84740 at OS2CUST)
  2099. Subject: Programmatic startup of Windows Applications
  2100.  
  2101. Does anyone know how to programmatically start up a Windows application in a
  2102. seamless window?  I want to do the equivalent of "START /WIN PROGRAM.EXE"
  2103. without kicking off a command processor (CMD.EXE).  I have tried starting
  2104. WINOS2.COM with both DosStartSession and WinStartApp to no avail.  Are there
  2105. some parameters I need to send to WINOS2.COM so it only starts the application
  2106. and not a full Windows session (i.e. Program Manager...)?
  2107.  
  2108. Rick Newill Ford Motor Company
  2109.  
  2110. ----- OS2PRG CFORUM appended at 12:56:29 on 92/10/21 GMT (by THRUMD at SYDVM1)
  2111. ..... OS2PRG CFORUM modified at 13:00:37 on 92/10/21 GMT (by THRUMD at SYDVM1)
  2112. Subject: Programmatic startup of Windows Applications
  2113. Ref:     Append at 12:48:32 on 92/10/21 GMT (by IL84740 at OS2CUST)
  2114.  
  2115. | it's late - in retrospect I didn't answer your question.
  2116. | I guess it's time to go home...
  2117.  
  2118. Dave
  2119.  
  2120. ----- OS2PRG CFORUM appended at 17:31:05 on 92/10/21 GMT (by AAAF0CY at OS2CUST)
  2121. Subject: Programmatic startup of Windows Applications
  2122. Ref: Append at 12:48:32 on 92/10/21 GMT (by IL84740 at OS2CUST)
  2123.  
  2124. Using DosStartSession, you can pass in the environment string
  2125. settings for the object and DOS settings. If you send
  2126. "SETPROGTYPE=WINDOWEDWIN;" along with the other settings (including
  2127. setting the DOS environment, i.e. EMS_MEMORY_LIMIT, ...), this should
  2128. make it a windows windowed session. I believe that for the program
  2129. name you only have to name the executable.
  2130.  
  2131. Jim Sauber, MN Mutual
  2132.  
  2133. ----- OS2PRG CFORUM appended at 08:03:47 on 92/10/22 GMT (by DEV4186 at OS2CUST)
  2134. Subject: DosFindFirst/Next() Can't Find Leading spaces
  2135.  
  2136. Ok, Here is an interesting one for all of you. Has anyone tried to locate
  2137. Files with DosFindFirst()? Write a simple program that Call FindFirst,
  2138. printf, while( anymore files?){DosFindNext. printf}
  2139. Compile ICC test.c
  2140. Default Compile and Link.
  2141. Run The Given Program in a Directory with filenames that contain leading spaces
  2142.  They don't show up!
  2143. I have an APAR open on this one, but thought I would see if anyone had
  2144. encountered this one yet?
  2145.  
  2146. Thanks
  2147. Michael Kupka
  2148.  
  2149. ----- OS2PRG CFORUM appended at 03:18:58 on 92/10/27 GMT (by HHSD012 at OS2CUST)
  2150. Subject: Starting a DOS app in the foreground
  2151.  
  2152. Before I embark on trying to write a C program that would start a DOS app
  2153. in the foreground of the WPS, I need to know if it is even possible.
  2154. Problem is that I have a company grown Windoze app that starts some DOS
  2155. apps.  When it does, it starts them in the foreground of Windoze so as to
  2156. give the user easier access to them for response.  As everybody knows,
  2157. OS/2 does not allow a Windows program to start a DOS program.  So we have
  2158. the Windows programs write the command line for the DOS app to a file
  2159. where we have a REXX program looking for writes to the file.  When the
  2160. file is written to, it executes the command line.  Unfortunately, the user
  2161. then has to see the error about not being able to start a DOS app and at
  2162. that time, he or she CNTR-ESCapes to the Window List to pick out the DOS
  2163. app for use.
  2164. I was told that the only way to get the DOS app to start in the foreground
  2165. was by the use of C programming.  Now I am getting a conflicting statement
  2166. from a company that does OS/2 programming for a living.  They say that the
  2167. only way to start a DOS app in the foreground is for the program starting
  2168. it to be in the foreground.  This of course is impossible to accomplish.
  2169. I know that it is also false, since I can get a notification of a print job
  2170. being finished over the network.  Maybe it is totally different, but I think
  2171. that there should be some way, after all we are talking about control of the
  2172. interface (WPS), which a C programmer should have some of.
  2173. Heck, even if the program which starts the DOS app has to give itself
  2174. the focus before starting the DOS app, I can live with that.
  2175. Any suggestions or definitive answers will be appreciated.
  2176. Thanks,
  2177.  
  2178. Nick Gardiner HHSD012
  2179.  
  2180. ----- OS2PRG CFORUM appended at 16:40:33 on 92/10/27 GMT (by NAAO3IY at HONE82)
  2181. Subject: Starting a DOS app in the foreground
  2182. Ref: Append at 03:18:58 on 92/10/27 GMT (by HHSD012 at OS2CUST)
  2183.  
  2184. Why not just start a CMD that executes the DOS program?
  2185.  
  2186. John Kennedy, Hoechst Celanese (The OS/2 Hobbit)
  2187.  
  2188. ----- OS2PRG CFORUM appended at 18:54:23 on 92/10/27 GMT (by MAAV7IB at HONE83)
  2189. Subject: Debugging 16-bit code under OS/2 2.0
  2190.  
  2191. We have an existing OS/2 1.3 application that we want to move to OS/2 2.0.
  2192. Our concern is supporting (debugging) the 16-bit code under OS/2 2.0.
  2193.  
  2194. The current organization is the Application Manager 3 (AM) programs
  2195. call MS C
  2196. 6.0 code, which calls Sybase "Open Client", TCP/IP, and APPC
  2197. routines.
  2198. We want to call this existing C code from AM 4 (on OS/2 2.0).
  2199.  We think we can
  2200. link the existing 16-bit MS C code with AM 4, but are concerned
  2201. with debugging
  2202. the code under 2.0.  We'd rather not convert the existing code
  2203. to C-Set/2
  2204. (32-bit) for the time being.
  2205.  
  2206. What can I use to debug the code under 2.0?  Are there facilities
  2207. in the
  2208. Workset/2 that I can use? OS/2 itself? Or should I be looking
  2209. at 3rd party
  2210. packages?  Any advise would help.
  2211.  
  2212. Thanks in advance!
  2213.  
  2214. Kevin Miller, The Capital Group, Inc. (USCAPFAB at IBMMAIL)
  2215.  
  2216. ----- OS2PRG CFORUM appended at 18:56:52 on 92/10/27 GMT (by HHSD012 at OS2CUST)
  2217. Subject: Starting a DOS app in the foreground
  2218. Ref: Append at 16:40:33 on 92/10/27 GMT (by NAAO3IY at HONE82)
  2219.  
  2220. Oh, if it were only that easy.  We did start off with a REXX that was supposed
  2221. to start the session in the foreground.  But; when you run it and the CMD is
  2222. not in the foreground (which it can't be), it gives you an error about not
  2223. being able to start the session in the foreground and then starts it in the
  2224. background.  That is the point at which I was told I was going to have to
  2225. go to C to force the session into the foreground and hence my concern about
  2226. reports that even mighty C cannot do this...Thanks
  2227.  
  2228. Nick Gardiner HHSD012
  2229.  
  2230. ----- OS2PRG CFORUM appended at 20:15:50 on 92/10/27 GMT (by WZ00813 at LINK21)
  2231. Subject: Order of mail from a mailslot
  2232.  
  2233. I am writing a distributed application using LAN
  2234. Server as the LAN OS.  I am using mailslots to send
  2235. messages and data between computers.  I have run
  2236. into the problem of having the messages and data
  2237. come from the mailslot in a different order than
  2238. they were written.  Is this the way mailslots are
  2239. supposed to work??  These messages/data blocks are
  2240. all first class/priority one.
  2241.  
  2242. Ross D. Schaack
  2243.  
  2244. ----- OS2PRG CFORUM appended at 21:42:56 on 92/10/27 GMT (by WEEKS at AUSVM2) -
  2245. Subject: Debugging 16-bit code under OS/2 2.0
  2246. Ref:     Append at 18:54:23 on 92/10/27 GMT (by MAAV7IB at HONE83)
  2247.  
  2248. I believe IPMD (the C Set/2 debugger) can decode 16-bit code that
  2249. was compiled for Codeview.  Ask over in C-SET2 CFORUM to be sure.
  2250.  
  2251. Craig Weeks
  2252. LAN Systems Performance (DCE)
  2253. Austin, Texas
  2254.  
  2255. ----- OS2PRG CFORUM appended at 16:31:39 on 92/10/28 GMT (by NAAO3IY at HONE85)
  2256. Subject: Starting a DOS app in the foreground
  2257. Ref: Append at 18:56:52 on 92/10/27 GMT (by HHSD012 at OS2CUST)
  2258.  
  2259. Try using a C program to start a CMD in the foreground that
  2260. executes the DOS program.
  2261.  
  2262. John Kennedy, Hoechst Celanese (The OS/2 Hobbit)
  2263.  
  2264. ----- OS2PRG CFORUM appended at 21:09:06 on 92/10/28 GMT (by HHSD012 at OS2CUST)
  2265. Subject: Starting a DOS app in the foreground
  2266. Ref: Append at 16:31:39 on 92/10/28 GMT (by NAAO3IY at HONE85)
  2267.  
  2268. John,
  2269. I take it you mean that a C program can start an OS/2 program in the foreground
  2270. even when it is in the background.  If that is the case, then you have
  2271. answered my question.  If that does work, I should be fixed up...Thanks
  2272.  
  2273. Nick Gardiner HHSD012
  2274.  
  2275. ----- OS2PRG CFORUM appended at 23:12:43 on 92/10/28 GMT (by SC025203 at AUSVM8)
  2276. Subject: Starting a DOS app in the foreground
  2277. Ref:     Append at 03:18:58 on 92/10/27 GMT (by HHSD012 at OS2CUST)
  2278.  
  2279. Nick,
  2280.  
  2281.   You are making this way too complicated for what you are trying
  2282. to do. I'm not sure why you need a WINAP to just start other
  2283. DOS apps but I'll assume you have your reasons. This could be done
  2284. as follows and with minimal (if any) coding:
  2285.  
  2286. 1. Have a CMD file with two commands:
  2287.  
  2288.    WINAP             (Your Windoze app)
  2289.    START WINOUT      (A CMD file that WINAP writes)
  2290.    EXIT              (Optional)
  2291.  
  2292. 2. Have WINAP write to WINOUT.CMD, it has:
  2293.  
  2294.    START DOSAP1      (First DOS app)
  2295.    START DOSAP2      (Second DOS app)
  2296.     . . .
  2297.    START DOSAPn      (Last DOS app)
  2298.    EXIT
  2299.  
  2300. 3. Set up an icon (from templates) that starts the CMD file from number
  2301.    one above; or, start it in STARTUP.CMD (or any other CMD you will
  2302.    be running at this time).
  2303.  
  2304.   You stated that you already have the WINAP writing the DOS app
  2305. names to a file, just change it to write to a CMD file (WINOUT in
  2306. my example but you can name it anything) and to put "START " in front
  2307. of each. The exit at the end is nice for cleanup but not absolutely
  2308. necessary.
  2309.  
  2310. Does this make sense?
  2311.  
  2312. Stephen Poole
  2313. OS/2 Service and Support - IBM Austin, TX
  2314.  
  2315. ----- OS2PRG CFORUM appended at 02:31:53 on 92/10/29 GMT (by HHSD012 at OS2CUST)
  2316. Subject: Starting a DOS app in the foreground
  2317. Ref: Append at 23:12:43 on 92/10/28 GMT (by SC025203 at AUSVM8)
  2318.  
  2319. Stephen,
  2320. First, let me thank you for taking a look at this.  Now on to the meat.
  2321. There are plenty of reasons for a 'homegrown' windoze or OS/2 app to start
  2322. a DOS app.  In this particular case, we use the very powerful wordprocessing
  2323. capabilities of WordPerfect and the graphics capabilities of DrawPerfect
  2324. to process documents that have been put together by our Toolbook app.  The
  2325. data processing people try to only use DOS programs when the Windoze
  2326. versions aren't quite up to snuff yet.  I personally did the same thing with
  2327. Personal AS/2 and WordPerfect for DOS.
  2328.  
  2329. Now; to make it easier for the data processing people to agree to cooperate
  2330. with us black sheep who are using OS/2,we had them write the command line
  2331. of the DOS app to a file before they would try to execute it from Windoze.
  2332. They always write to the same file handle for ease of implementation, but the
  2333. command line is almost always different because of parameters passed along
  2334. also.  To start the Toolbook app, we start our CMD from the desktop like you
  2335. suggested.  It keeps running on the desktop, but unfortunately has to leave
  2336. the foreground so one can interact with the Toolbook app.  When the Toolbook
  2337. app writes to the file handle, the CMD program 'notices' and does a START on
  2338. whatever command line was written to the file.  This works great except for
  2339. one thing, the CMD file CANNOT throw the DOS app to the foreground unless it
  2340. itself is in the foreground.  You might ask why that matters, we could just
  2341. switch to the window list and restore the DOS app.  That is what we do now,
  2342. and I am sorry to tell you that it just isn't good enough.  We have some people
  2343. called'users' here who will not always remember to CNTL-ESCto the Window
  2344. List because when they were running Windoze they didn't have to do that.
  2345.  
  2346. Anyway, having been told on IBMLINK that REXX wouldn't be able to start a
  2347. DOS session in the foreground unless it was there, and having been told that
  2348. the only way to do that was with C (or some such), that started my quest.
  2349. Now I have C-Set/2 and was about to hunker down with it when the programmers
  2350. at a very reputable OS/2 programming house that it couldn't be done with C
  2351. either.  Therefore, I am trying to get OFFICIAL word from IBM either way.
  2352. Can I or Can't I force a DOS app by hook or by crook onto the foreground with
  2353. an application that isn't running in the foreground.  As in a previous thread,
  2354. I don't care if I have to force another OS/2 program into the foreground which
  2355. starts the DOS app in the foreground, because this could be done quickly
  2356. enough so the user doesn't even notice.
  2357.  
  2358. Lastly Stephen, I am sorry that I am even having to do this.  If IBM had
  2359. been able to throw in some sort of pseudo enhanced mode Windoze support,
  2360. I probably wouldn't need to 'Switch to another session to start this
  2361. program'.  Then again, if Asymetrics would come out with a Toolbook 1.5
  2362. for OS/2 I wouldn'tneed pseudo enhanced mode or win-os2 for that matter
  2363. since my company writes half of there apps in Toolbook.
  2364.  
  2365. Thanks for letting me bend your eye,
  2366.  
  2367. Nick Gardiner HHSD012
  2368.  
  2369. ----- OS2PRG CFORUM appended at 19:56:01 on 92/10/29 GMT (by NAAO3IY at HONE84)
  2370. Subject: Starting a DOS app in the foreground
  2371. Ref: Append at 21:09:06 on 92/10/28 GMT (by HHSD012 at OS2CUST)
  2372.  
  2373. I'm shaky myself about this -- but if a C program can start
  2374. CMD.EXE in the foreground, then that CMD.EXE can of course
  2375. run a CMD that will start the DOS program in the foreground.
  2376.  
  2377. John Kennedy, Hoechst Celanese (The OS/2 Hobbit)
  2378.  
  2379.