Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Sept/Oct 2019 Issue of The NT Insider available


Download PDF here: http://insider.osr.com/2019/ntinsider_2019_01.pdf

It’s a particularly BIG issue, too: 40 pages of technical goodness, ranging from WDF to Minifilters. Check it out.
Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

Accessing exported variable in .asm file

sudhakarsudhakar Unsubscribed Member Posts: 24

Hi,

After few trials I could get a procedure to be declared in .asm as something like:

extrn [email protected]: proc

But for a variable, I am not sure what is to be mentioned instead of 'proc' on the similar lines.

Can you let me know.

Thanks
Sudhakar

Comments

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,066

    That's a DLL import. It's extremely rare to have a variable exported from a DLL. If you're just trying to hook to a variable from some other .obj in the link, use
    extrn totalModuleCount: dword
    or substitute the appropriate type.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • sudhakarsudhakar Unsubscribed Member Posts: 24

    Thanks Tim for the reply.

    I am not sure if it is a rare need but I was trying to access a variable defined in the first module which gets loaded to control the function instrumentation calls with _penter in remaining modules.

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,066

    "defined in the first module" doesn't tell us anything. Are you trying to connect to a variable in another .obj, or do you actually have a variable exported from a DLL? The methods are very different.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • sudhakarsudhakar Unsubscribed Member Posts: 24

    We have many driver modules. The first of the modules which gets loaded has the variable defined. This is made as export driver. So the .lib is specified during link time to access the variable in other modules. So it is not from .obj.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
Writing WDF Drivers 21 Oct 2019 OSR Seminar Space & ONLINE
Internals & Software Drivers 18 Nov 2019 Dulles, VA
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 27 Apr 2020 OSR Seminar Space & ONLINE