home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / misc / 4603 < prev    next >
Encoding:
Internet Message Format  |  1993-01-05  |  1.7 KB

  1. Path: sparky!uunet!olivea!spool.mu.edu!sdd.hp.com!ux1.cso.uiuc.edu!cs.uiuc.edu!vela!bcmatusz
  2. From: bcmatusz@vela.acs.oakland.edu (Brian Matusz)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: GlobalAlloc questions ...
  5. Message-ID: <1993Jan5.171037.26950@vela.acs.oakland.edu>
  6. Date: 5 Jan 93 17:10:37 GMT
  7. Organization: Oakland University, Rochester MI.
  8. Lines: 33
  9.  
  10. Being posted for a friend; followup to center03@cps201.cps.cmich.edu
  11. --------------------------------------------------------------------
  12.  
  13. I'm having some ... difficulties ... with global memory allocation.
  14. The correct flag for memory that will be allocated by one task and freed
  15. by another is GMEM_SHARE, right?  Do any other flags need to be present?
  16. I'm having messages like:
  17.  
  18. GlobalUnlock: Object usage count underflow
  19. GLOBALFREE+15: Invalid global memory object
  20.  
  21. I just perused the code, and every Lock has an Unlock, and the allocs are
  22. with the GMEM_SHARE.  Comments?
  23.  
  24. Also, in another project, there's a possibility that a memory object
  25. gets locked and then passed to another process, which then locks it,
  26. uses it, unlocks it and frees it.  Is this legal (ie, 2x locking, with
  27. only 1 unlock, and then attempt to free?)  Should there be an unlock
  28. before it's passed?  It sounds bizarre, so I thought I'd ask ...
  29.  
  30. Last, seeing the message cracker for GlobalAllocPtr, it seems that MSoft
  31. decided that it's all right to allocate and lock memory and leave it
  32. locked (for 3.1, assumably).  If I'm writing a 3.0 app, should I not
  33. use this?  Even if the application is pmode only?
  34.  
  35. Thanks for any help ...
  36. Brad Wilson
  37. center03@cps201.cps.cmich.edu
  38. -- 
  39.  
  40. ---
  41. bcmatusz@vela.acs.oakland.edu
  42. "Use DEVICE=EXXON to screw up your environment."
  43.