rExtExtension RemoveExtension Failure and Execute (.., (DOT) unload,,) crash windbg 6.12

Does Engext
m_Control->RemoveExtension() facilitate removing self ?

ULONG64 HANDLE myHand
HRESULT Status;;
Status = mControl->AddExtension(“Path to Self”,NULL,&myHand);
if (…)
){

}
Status = m_Control->RemoveExtension(myhand)

doesnt seem so though i get an S_OK as Result

if i do IDebugControl->Execute ( …,“.unload”,…)

it unloads the dll and crashes windbg along

m_Control->Execute( DEBUG…,".unload { Name of Self } " …DEFAULT);
if this is issued from a currently executing extension dll
it crashes 6.12 windbg

is it possible to unload an extension dynamically

similar to the follwing sequence of commands

.unload foo.dll ; .shell copy blah.dll foo.dll /y .load foo.dll

is it feasible to unload and reload an extension dll ? from an
extesnion command ??

i can type .load foo.dll ; .unload foo.dll in windbg command window
and it works properly

i am looking for a way to do it from a currently executing extension dll

i have used BeginUpdateResource,UpdateResource,EndUpdateResource in
the currently executing dll to update the resources and at the moment
i have a duplicate copy of the executing extension dll with updated
resources in the same directory

at the moment i am unloading the extension dll by typing .unload
XXX.dll in windbg command window

and then run a bat file which contains

copy YYY.DLL XXX.DLL /y

where YYY.DLL is the duplicate of XXX.dll with only resource modification

and then issue a .load xxx.dll and the in the newly loaded XXX.dll i
can use the new resources

any pointers ?

On 8/30/13, raj_r wrote:
> Does Engext
> m_Control->RemoveExtension() facilitate removing self ?
>
> ULONG64 HANDLE myHand
> HRESULT Status;;
> Status = mControl->AddExtension(“Path to Self”,NULL,&myHand);
> if (…)
> ){
>
> }
> Status = m_Control->RemoveExtension(myhand)
>
> doesnt seem so though i get an S_OK as Result
>
>
> if i do IDebugControl->Execute ( …,“.unload”,…)
>
> it unloads the dll and crashes windbg along
>
> m_Control->Execute( DEBUG…,".unload { Name of Self } " …DEFAULT);
> if this is issued from a currently executing extension dll
> it crashes 6.12 windbg
>
> is it possible to unload an extension dynamically
>
> similar to the follwing sequence of commands
>
> .unload foo.dll ; .shell copy blah.dll foo.dll /y .load foo.dll
>