views:

15

answers:

2

I have to build OEM versions of a COM library (DLL). Does anyone know a tool (ressource hacker) which may replace some of my interface guids after build time?

I just want to build and test one DLL and generate the OEM versions afterwards.

+1  A: 

No tool that I know of. You could use an automated build process to actually build dll#s with different GUID's.

TomTom
That's what we do at the moment.But through this we have to build and test each OEM version - instead of just one!
ndee
A: 

Replacing interface ids in the compiled binary is not that easy. They are usually hardcoded and the compiler allocates them in static storage and they might even have static linkage so you will have problems finding them. Remember how QueryInterface() is usually implemented?

HRESULT CImpl::QueryInterface( IID& iid, void** result )
{
    if( iid == __uuidof( IInterfaceThisClassImplements1 ) ) {
       *result = static_cast<IInterfaceThisClassImplements1*>( this );
    } else {
       ///same stuff for other interfaces
    }
    //call AddRef() if succeeded
}

It's not limited to resource editing, you have to actually patch the static data of the binary image and likely no tool will be able to do this automatically for you.

Since you have the full source your best bet is to just rebuild the binary.

sharptooth