www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/05/06:33:40

Date: Wed, 5 Jun 1996 13:29:51 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Carl Johansson <carl DOT johansson AT helsinki DOT fi>
Cc: djgpp AT delorie DOT com
Subject: Re: File sharing?
In-Reply-To: <4ovfjt$egp@oravannahka.Helsinki.FI>
Message-Id: <Pine.SUN.3.91.960605131917.26109D-100000@is>
Mime-Version: 1.0

On 3 Jun 1996, Carl Johansson wrote:

> >How come that DJGPP v2 appears to ignore 
> >file sharing completely? It so happens that I
> 
[snip]
> 
> With VC++ I get the following error message:
> 
> Sharing violation reading drive D
> Abort, Retry, Fail?
> Error setting somefile.ext, error: 
> 
> for each file Windows uses (ex. KEYBOARD:DRV, USER:EXE etc.) 
> at the time the program attempts to access it (note that
> strerror fails to return anything, not even "No error").  
> With DJGPP I get nothing, it works perfectly from my point of 
> view here. 

From the above error messages I'm not sure DJGPP ``works perfectly''.  
The key question is: does DJGPP-compiled code indeed change the 
attributes of the files, or just silently fails?  If it fails, then I 
think I understand what's going on.  Windows doesn't want you to access 
those files, so it opens them in a DENYALL (or some such) sharing mode.  
When your program tries to access the file, SHARE (or VSHARE) generates 
Int 24h.  Your program doesn't install a handler for Int 24h, so for VC++ 
you see the usual "Abort, Retry, Explode" message.  But DJGPP is a DPMI 
program, and most DPMI servers (Windows among them) just silently fail 
the DOS call that triggered Int 24h.  So you think DJGPP program works 
while in reality it just silently fails.

If I'm correct, then there is no way you can protect your system files by 
just changing their attributes, unless you find a way to temporarily 
disable the SHARE locks.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019