News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

No way to make the ".shared" section ?

Started by Vermi, April 30, 2006, 03:51:13 PM

Previous topic - Next topic

Vermi

I'm coding a DLL, and I need a .shared section, but I can't make it directly.
I use the SEGMENT directive, and I wanted to do :
.shared SEGMENT
.shared ENDS

but MASM don't like the ".", so I can make :
shared SEGMENT
shared ENDS

But windows don't like, I have to rename the section with a PE editor....
As anyone the solution ? The section name MUST be ".shared". :/
I have try things like : ".shared" SEGMENT
but it don't work. If you have an idea...

@+
Vermi

Vermi

I have foud a solution. I have add a param to the link.exe :
/MERGE:shared=.shared

And it have renamed automatically my section name. It's not a very nice solution, but it work. If you have another one, tell me !

@+
Vermi

Biterider

Have you tried "option dotname" ?

Regards,

Biterider

Vermi

I have a bigger probleme, when I rename the section to .shared ( in stay of shared ), the function SetWindowsHookEx freeze. I have trace the API to see when it freeze, and I have founds it's on a INT 2E ( if I remember well ), it's when API switch to ring 0.
I don't understand why, but I can't have my .shared section because of that **** API ( lol ) ... :'(

@+
Vermi

Ossa

Well, it's been a while since I last fiddled with this stuff, but if I recall correctly, to make the segment shared (ie not just calling it that) you must change the segemnt permissions, so if you have:


option dotname

.shared SEGMENT
.shared ENDS


you must use the following in the linker commandline:

/SECTION:.shared,S

This changes the permission DWORD from the default of C0000040 to D0000040.

You should be able to do this without altering the commandline, but I forget the commands.

Hope that helps,
Ossa
Website (very old): ossa.the-wot.co.uk

Vermi

Thanj you, it's work fine :p
Thank you very much XD

@+
Vermi