Link to home
Start Free TrialLog in
Avatar of has
has

asked on

question to tfai

To get ordinal nos of functions in a dll
dumpbin \exports my.dll workes fine under NT, but not
win95 ? any thing that you know of for this ?

and the other problem is that, kernel32.dll functions
under win95 does not support ordinal calls, (ole32.dll
for example works for win95, and win NT all works.

the following gives correct result under NT,
but fails under win95.

      typedef BOOL (CALLBACK* LPFUNC) (OSVERSIONINFO*);
      HINSTANCE hDLL;
      LPFUNC  lpfunc1, lpfunc2;
      hDLL = LoadLibrary("Kernel32");
      if(hDLL != NULL)
      {

        DWORD GETVERSIONEX;
         lpfunc1 = (LPFUNC) GetProcAddress(hDLL, "GetVersionExA");
            if(lpfunc1)
            {
                  for(int i = 0; i < 1000; i++)
                  {
                        GETVERSIONEX = i;
                        lpfunc2 = (LPFUNC) GetProcAddress(hDLL, (char*) GETVERSIONEX);
                        if(lpfunc1 == lpfunc2)
                        {
                              CString mess;
                              mess.Format("ordinal is : %d",i);
                              MessageBox(mess,"result");
                              break;
                        }
                  }
                  FreeLibrary(hDLL);
            }
            else
            {
                  FreeLibrary(hDLL);
                  int error_no;
                  error_no = GetLastError();
                  CString mess;
                  mess.Format("error # %d",error_no);
                  MessageBox(mess,"lpfunc1");
            }
      }

in here I wanted to find the ordinal no for a specific
function, programatically. Is there a better way ? thanks
Avatar of nietod
nietod

I'm evesdropping, but Dumpbin /exports works fine for me under Win95.  What problem are you having with it?
ASKER CERTIFIED SOLUTION
Avatar of tflai
tflai

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Funny thing what Microsoft can do to make developers' life tougher  :-)
Avatar of has

ASKER

thank you so win95 has one more problem to work around.
nietod says no problem of dumpbin in win95, I tried on three
win95 systems, non can recocnize it, nt of course does the job ?
what is your opinion ? thanks a lot
Strange?  DUMPBIN works fine on my machine.
Are you sure you're using MSDEV's DUMPBIN.EXE?