ESE is still not so easy for me!

by Michael S. Kaplan, published on 2007/04/13 05:47 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2007/04/13/2112495.aspx


Koushal asks via the contact link:

Hi Michael,

How you doin? I found your reply to a post regarding the steps to be followed and APIs to be used to get a list of tables in a .edb file using ESE APIs. You've written that you are not providing the sample source code because it was way long back when you had written and tested it and now, it may not work.

But I'll be very much grateful to you if you can give me the source code. Presently, I dont have any source of reference so as to use the ESE APIs. I dont have the ESENT.H file and the ESENT.LIB file either. I didnt find the mentioned files in the Exchange SDK and I'm just referring to sample codes on the internet to get the constants and datatypes which any ESE programmer is supposed to collect from the ESENT.H file.

So, can you please send to me your source code (no matter if it doesnt work) ? Also, if you could send me the header and lib files, it will help me in getting things going the right way. Presently, I have to load the ESE.DLL library and call GetProcAddress() for every function I have to use. If I had the LIB, I could had saved 1 function call with every step I had to perform and eventually lessen the size of my source code.

Hoping to get your help at the soonest,

Thanks in advance,

Koushal

I have actually checked with folks here (like Brett!) and although I was able to repro the problem of not having esent.h/esent.lib in some versions of the Platform SDK/Windows SDK, all versions of the Core SDK from Window Server 2003 SP1 has the files -- so all you have to do is install the core SDK and you will have them installed.

Contrasted with code calling Jet Red which I cannot give any headers or lib files for, which are not in the Platform SDK, and whose functions are exported without even having names, and trust me when I say that trying to learn about ESE through them is like trying to learn about driving by reading a comic book!

The source code I had can occasionally give insights into using ESE, but more often it does not and occasionally it can be downright misleading (their functionality has never matched and their respective APIs have diverged over the years). And as I pointed out in this post, I won't usually know the answer. On top of everything, it is pretty off-topic here at SIAO!

You may have better luck asking Brett or the Exchange Team Blog which has links to several other Exchange blogs....


# Mihai on 13 Apr 2007 12:23 PM:

It is also easy to generate your own .lib from a .dll

 dumpbin /exports user32.dll > user32.def

Open in a text editor, and look for the list of exported funcitons:

...

   ordinal hint RVA      name
         1    0 0001D32A ActivateKeyboardLayout
         2    1 00021100 AdjustWindowRect
         3    2 00010272 AdjustWindowRectEx
         4    3 0005D2A6 AlignRects

Remove everything before and after that list, change the "title" to EXPORTS.

Remove the columns ordinal, hint, and RVA.

EXPORTS
   ActivateKeyboardLayout
   AdjustWindowRect
   AdjustWindowRectEx
   AlignRects

And now generate the .lib:

lib /machine:ix86 /def:user32.def /out:user32.lib

# Michael S. Kaplan on 13 Apr 2007 1:25 PM:

Well, be careful -- that will only work for .lib files with no code in them. :-)

Yuhong Bao on 15 Feb 2009 3:20 AM:

"Contrasted with code calling Jet Red which I cannot give any headers or lib files for, which are not in the Platform SDK, and whose functions are exported without even having names"

Now, Jet Red since 4.0 have symbols on the MS symbol server, which make exporting functions ordinal-only useless.

Michael S. Kaplan on 15 Feb 2009 10:59 AM:

Um, huh? Without a .LIB file containing the names, you still can't hook up to the functions by name unless you build your own .LIB file. Oh, and the header files are also not around, either. Am I missing something here?


Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

go to newer or older post, or back to index or month or day