public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Memory Violation With Windres and Shared Data Segments
@ 1999-08-06  7:58 Harold Weissfield
  1999-08-06  8:51 ` Chris Faylor
  1999-08-31 23:49 ` Harold Weissfield
  0 siblings, 2 replies; 16+ messages in thread
From: Harold Weissfield @ 1999-08-06  7:58 UTC (permalink / raw)
  To: cygwin

Gentlemen, I have recently downloaded Mumit's Mingw32 distribution with GCC 
2.95 as the compiler, and everything is working well.  However, I have had 
the consistent problem of when I tried to use windres, Windows pops up a 
messagebox that says something similar to the following:

"Your program accessed memory currently in use at 00003FBC from 1654:02FE.

You should save all your work, and then quit your programs.  If you continue 
running this program, your system may become unstable.  Do you want to 
continue?"

I was wondering if anyone else had encountered this problem before or if it 
was just my computer at fault.

On a different note, I have been searching through the documentation for GCC 
for information on how to created a shared data segment in a DLL, but so far 
have been unable to come up with anything.  Under Visual C++, this was done 
with a #pragma comment(linker, "-section:Shared,rws") and then a #pragma 
data_seg("Shared").  Is there any equivalent construct in GCC?

I appreciate any comments or suggestions, and thank you for your time.

Cheers,
Harold Weissfield


_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 16+ messages in thread
[parent not found: <37AB1289.4EBCA966@hem2.passagen.se>]
* Re: Memory Violation With Windres and Shared Data Segments
@ 1999-08-06 20:25 Harold Weissfield
  1999-08-06 21:10 ` Mumit Khan
  1999-08-31 23:49 ` Harold Weissfield
  0 siblings, 2 replies; 16+ messages in thread
From: Harold Weissfield @ 1999-08-06 20:25 UTC (permalink / raw)
  To: cygwin

>I believe the only difference is that it has the "SHARED" bit set in
>the section attributes, in addition to the usual initialized data,
>read-write, etc flags.
>
>Can someone send me a testcase so I can see if my local changes fix this
>or not? If it's obvious already, I know nothing about these shared
>segments.
>
>Regards,
>Mumit

Thank you for your help, Mumit, Chris, and Anders.  I will try to experiment 
around with the information that you guys have provided, and I shall reply 
back if I find any favorable results.

In case you are wondering why I'm doing this, I am writing a shell 
replacement for Explorer for our lab at school, and one of the 
implementation details involves creating a global hook using 
SetWindowsHookEx().  Unfortunately, the requirements for having such a hook 
involve having a shared data segment in a DLL, so that is the dilema that I 
am presently trying to solve.

Mumit, I am not aware of the proper procedures for submitting code, so 
forgive me if my approach is mistaken.  During the process of developing 
this shell, I noticed that the following notification messages for the 
appbar were not in shellapi.h

#define ABN_STATECHANGE    0x0000000
#define ABN_POSCHANGED     0x0000001
#define ABN_FULLSCREENAPP  0x0000002
#define ABN_WINDOWARRANGE  0x0000003

Please feel free to add them to the headers at your convenience.  Meanwhile, 
I thank you once again, and I shall get busy on my coding.

Cheers,
Harold Weissfield


_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 16+ messages in thread
* Re: Memory Violation With Windres and Shared Data Segments
@ 1999-08-09 10:55 Dirk Fieldhouse
  1999-08-31 23:49 ` Dirk Fieldhouse
  0 siblings, 1 reply; 16+ messages in thread
From: Dirk Fieldhouse @ 1999-08-09 10:55 UTC (permalink / raw)
  To: cygwin

On Sat, 07 Aug 1999 22:55:16 -0500, Mumit Khan <khan@xraylith.wisc.EDU> wrote:
>...>[binutils &c enhancements for shareable data segments]

>Just to let you folks know, I just submitted patches to both binutils >and gcc to make this happen.
>
>In the future, you'll be able to do this:
> 
>  int __attribute__((section ("shared"), shared)) foo = 0;
>  int
>  main ()
>  {
>    /* do stuff to foo. */
>    return 0;
>  }
>
>and all running copies of the executable will share ``foo''.
>...

That certainly explains why my hook DLL with 
 
static HHOOK __attribute__ ((section("SHARED"))) g_hHook = NULL;

(hoping for magic in the section name) didn't fly!

I'll look forward to a better result with the enhanced tools.

Thanks
/df

-- 
Dirk Fieldhouse                 Logica UK Limited
fieldhouse@logica.com           75 Hampstead Road
c=gb;a=attmail;p=logica;        London NW1 2PL
o=LOGICA;ou1=UK;s=fieldhouse    UK
+44 (171) 637 9111

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~1999-08-31 23:49 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-08-06  7:58 Memory Violation With Windres and Shared Data Segments Harold Weissfield
1999-08-06  8:51 ` Chris Faylor
1999-08-06  9:05   ` Mumit Khan
1999-08-31 23:49     ` Mumit Khan
1999-08-31 23:49   ` Chris Faylor
1999-08-31 23:49 ` Harold Weissfield
     [not found] <37AB1289.4EBCA966@hem2.passagen.se>
1999-08-06 10:47 ` Mumit Khan
1999-08-31 23:49   ` Mumit Khan
1999-08-06 20:25 Harold Weissfield
1999-08-06 21:10 ` Mumit Khan
1999-08-07 22:04   ` Mumit Khan
1999-08-31 23:49     ` Mumit Khan
1999-08-31 23:49   ` Mumit Khan
1999-08-31 23:49 ` Harold Weissfield
1999-08-09 10:55 Dirk Fieldhouse
1999-08-31 23:49 ` Dirk Fieldhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).