Re: OS Question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance





"m" wrote:

More importantly, the 'protection' that this scheme offers does not exist
for a period of time when the API call is executing and so any 'rogue' code
can just write to the page then and it will be trashed.



Maxim's situation could be remedied by handling the second exception or
using locks on the APIs to prevent concurrent access to pages.


"Maxim S. Shatskih" <maxim@xxxxxxxxxxxxxxxx> wrote in message
news:e%23jB2tHtIHA.4912@xxxxxxxxxxxxxxxxxxxxxxx
Can you explain? what is not compatible with multithreading? If there is

- 2 threads wants to write access the same data
- first gain the access
- second thread gains the access
- first thread does its work and returns
- on return, the data is marked back as read-only
- then second thread try to do work, and the data is read-only, a crash

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@xxxxxxxxxxxxxxxx
http://www.storagecraft.com




Yes this is absolutely true, and documented for users of the API. There is a
window during which one thread has enabled write access (but only to the
pages it is touching) whilst another thread, not inside the API, erroneously
writes to one of the pages and causes damage.

This is sadly beyond our reach as a goal, but nevertheless the whole feature
is an option and mainly one that new users code will use during testing,
although there is a window I think the benefit afforded far outweighs this.

I think that in a future design, it might be possible to locate "some" of
the API inside some sort of kernel mode component but my knowledge of device
drivers (especially when used in such a "utility" fashion) is not very good.

Windows unfortunately provides no "out of the box" way for programmers to
write application code that can enjoy the same benefits as drivers (i.e. the
context mode change that allows drivers to access/update kernel structures or
pages allocated in one of the kernel heaps).

Hugh

.



Relevant Pages

  • Re: OT: disabling APIs to prevent keystroke logging
    ... done QA and other testing for a few drivers. ... So you try to intercept all the calls to an API and make sure they ... stop a hastily written keylogger in all likelihood. ... A good start would probably be a book on Windows programming. ...
    (alt.sys.pc-clone.dell)
  • Re: Why linux is so stupid with hardware drivers?
    ... that sold to both the CP/M and DOS communities B.W. [Before the Windows ... Linux kernel drivers for complex custom systems that are used in ... Driver] programmer I have a bewildering API from which to choose ... some Windows 95 Device Drivers that can still be loaded and function ...
    (comp.os.linux.development.system)
  • Re: Linux drivers management
    ... Linux source. ... If you split up drivers and the core kernel into two sepperate ... API change needs to be made. ...
    (Linux-Kernel)
  • Re: newbe about API
    ... Emne: Re: newbe about API ... > I found all these API-CALL strings are finally compiled to ... more than that...and Windows simply takes this to an extreme that this ... DLL, when a weak point is found (which, with Microsoft, is something ...
    (alt.lang.asm)
  • Re: Hello Everyone!
    ... It's a music partition editing software. ... Indeed, but, to be compared to Microsoft Windows on the desktop, ... operating system kernel. ... Note that Windows 3.x API from which the Win32 API is directly ...
    (comp.os.linux.misc)