Does XP still use the win16mutex?

This is a discussion on Does XP still use the win16mutex? within the Windows Programming forums, part of the Platform Specific Boards category; In previous versions of windows calling Lock on the primary surface in directdraw would grab the win16mutex and prevent other ...

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    14

    Does XP still use the win16mutex?

    In previous versions of windows calling Lock on the primary surface in directdraw would grab the win16mutex and prevent other apps from using DirectDraw/GDI to update any portion of the screen until it had been unlocked. I am trying to do the same thing under XP, and it will not work. Either my code is buggy, or XP just won't let you do it anymore. Which is it, API XPerts?

    Also, is there any other way to prevent any application from accessing the display while my application has it locked? I've have googled my brains out. Either I don't know the correct search terms, or it can't be done without writing a driver.

    Just in case your wondering, I am trying to write a subliminal messages application that will:
    1)Copy rect to 2 backbuffers
    2)write message to backbuffer1
    -----Trouble is at step 3 ------------
    3)lock entire display (or just rect whatever works)
    4)write rect with text out to screen
    5)wait specified number of frames
    6)write unaltered rect back to screen
    7)Unlock primary display

    Thanks,
    Steve
    Thanks,
    E-Monk

  2. #2
    Registered User
    Join Date
    Oct 2005
    Posts
    1
    emonk,

    NT kernel based systems (NT 4, Win2K, WinXP... etc) do not run Win16 processes in a shared memory space, rather they are each given their own memory space via a technology called WoW (Windows on Windows). The Win32 API in NT is fully 32-bit, fully reentrant, and never thunks to 16-bit code (indeed, flat thunks are not even supported). Thus, there is no need to prevent reentrance in the Win16 subsystem (it never happens) and Win16Mutex thus does not exist.

    HTH,
    John

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,823
    > 08-22-2003, 10:15 PM
    Next time, read the forum rules before dredging up old posts.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 05-07-2009, 12:31 PM
  2. Trying to Install XP over Vista with SATA HD
    By Shamino in forum Tech Board
    Replies: 2
    Last Post: 12-13-2008, 06:56 PM
  3. Need help with program
    By HAssan in forum C Programming
    Replies: 8
    Last Post: 06-10-2007, 09:05 PM
  4. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM
  5. Windows XP regression over time
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 12-17-2002, 10:49 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21