Click here to Skip to main content
15,893,508 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: Which is better - a long list of potentially null parameters or a Key Value list Pin
Luc Pattyn8-Feb-12 8:17
sitebuilderLuc Pattyn8-Feb-12 8:17 
GeneralRe: Which is better - a long list of potentially null parameters or a Key Value list Pin
Ger Hayden8-Feb-12 21:46
Ger Hayden8-Feb-12 21:46 
AnswerRe: Which is better - a long list of potentially null parameters or a Key Value list Pin
Philippe Mori19-Feb-12 2:15
Philippe Mori19-Feb-12 2:15 
QuestionDLL Not getting registered Pin
arc.dream2-Feb-12 22:21
arc.dream2-Feb-12 22:21 
AnswerRe: DLL Not getting registered Pin
Wes Aday8-Feb-12 9:41
professionalWes Aday8-Feb-12 9:41 
AnswerRe: DLL Not getting registered Pin
rana ray14-Feb-12 19:07
rana ray14-Feb-12 19:07 
AnswerRe: DLL Not getting registered Pin
Chandrakantt29-Feb-12 6:29
Chandrakantt29-Feb-12 6:29 
QuestionOTS COM elevation problem standard user not seeing debug messages or writing to the registry Pin
Christine_Irene25-Jan-12 9:33
Christine_Irene25-Jan-12 9:33 
Hi,

I have a COM dll with a class in it. This class alters the registry at HKLM\Software\Policies\MyPolicy

The DLL has a UAC execution level of Highest Available (I think I had it still happen with asInvoker as well).

The executable that cals this dll has an execution level of invoker.

If I run this as administrator, I get the UAC prompt when my class gets invoked, and I see all my debug messages in dbgview and any debug message boxes show up.

If I log in as standard user, and right click runas administrator, everything works fine.

However, If I simply double-click, I see the UAC elevation prompt when my class gets invoked. I enter in the correct password, and the COM object creation passes, but the Registry is never changed, AND I do not see any debug messages or message boxes. If I turn off "Run all administrators in admin approval mode", I see the messages, but the program fails to set the registry keys.

Anybody have any clues? Also, do you know of any great debuggers that I may use to solve this?


More Info:

I modified the DllRegisterServer function to add the following keys to the registry:
HKLM\Software\Classes\AppID\My AppGuid(found in dllMain.h)>\ROTFlags(a string set to "1")
HKLM\Software\Classes\AppID\My AppGuid\DllSurrogate(a string set to empty)

HKLM\Software\Classes\CLSID\My ClassID (found in ClassName.rgs)\AppID (a string set to My AppGuid)
HKLM\Software\Classes\CLSID\My ClassID\LocalizedString (an expanding string set to @dllPath.dll,-100(where 100 is a string
in the string table)).

HKLM\Software\Classes\CLSID\My ClassID\Elevation\Enabled (a DWORD set to 1)

HKLM\Software\Classes\CLSID\My ClassID\Elevation\IconReference (An expanding string set to 'applicationIcon')

Also, my calling code uses the standard old

HRESULT CallingClass::CoCreateInstanceAsAdmin(HWND hwnd,REFCLSID rClsid, REFIID rIid, void** ppv)
{
  try
  {

    HRESULT     hr;
    BIND_OPTS3	bo;
    WCHAR		wszCLSID[255];
    WCHAR		wszMonikerName[300];

    StringFromGUID2(rClsid,wszCLSID,sizeof(wszCLSID)/sizeof(wszCLSID[0])); 

    hr = StringCchPrintf(
       wszMonikerName,sizeof
       (wszMonikerName)/
       sizeof(wszMonikerName[0]),   
       L"Elevation:Administrator!new:%s", 
       wszCLSID);

    if(FAILED(hr))
    {
      . . .ShowMyDebugMessage		
      return hr;
    }

    memset(&bo, 0, sizeof(bo));
    bo.cbStruct	= sizeof(bo);
    bo.hwnd	= hwnd;
    bo.dwClassContext = CLSCTX_LOCAL_SERVER;
    return CoGetObject(wszMonikerName, 
        &bo, rIid, ppv );
  }
  catch(...)
  {
    . . .Show my debug message
    return E_FAIL;
  }

  return S_OK;

}

Christine Murphy
C# developer


modified 25-Jan-12 15:40pm.

QuestionHow can I get /clr support it's giving errors Pin
appollosputnik24-Jan-12 0:58
appollosputnik24-Jan-12 0:58 
AnswerRe: How can I get /clr support it's giving errors Pin
Wes Aday24-Jan-12 3:18
professionalWes Aday24-Jan-12 3:18 
GeneralRe: How can I get /clr support it's giving errors Pin
appollosputnik24-Jan-12 19:59
appollosputnik24-Jan-12 19:59 
GeneralRe: How can I get /clr support it's giving errors Pin
Wes Aday25-Jan-12 3:05
professionalWes Aday25-Jan-12 3:05 
GeneralRe: How can I get /clr support it's giving errors Pin
appollosputnik26-Jan-12 17:35
appollosputnik26-Jan-12 17:35 
GeneralRe: How can I get /clr support it's giving errors Pin
Wes Aday27-Jan-12 3:28
professionalWes Aday27-Jan-12 3:28 
GeneralRe: How can I get /clr support it's giving errors Pin
Wes Aday27-Jan-12 3:51
professionalWes Aday27-Jan-12 3:51 
AnswerRe: How can I get /clr support it's giving errors Pin
Richard MacCutchan24-Jan-12 3:58
mveRichard MacCutchan24-Jan-12 3:58 
GeneralRe: How can I get /clr support it's giving errors Pin
appollosputnik24-Jan-12 20:00
appollosputnik24-Jan-12 20:00 
GeneralRe: How can I get /clr support it's giving errors Pin
Richard MacCutchan24-Jan-12 22:01
mveRichard MacCutchan24-Jan-12 22:01 
JokeRe: How can I get /clr support it's giving errors Pin
Wes Aday25-Jan-12 3:06
professionalWes Aday25-Jan-12 3:06 
GeneralRe: How can I get /clr support it's giving errors Pin
appollosputnik26-Jan-12 17:31
appollosputnik26-Jan-12 17:31 
GeneralRe: How can I get /clr support it's giving errors Pin
Richard MacCutchan26-Jan-12 22:09
mveRichard MacCutchan26-Jan-12 22:09 
GeneralRe: How can I get /clr support it's giving errors Pin
Wes Aday27-Jan-12 3:26
professionalWes Aday27-Jan-12 3:26 
GeneralRe: How can I get /clr support it's giving errors Pin
John Schroedl27-Jan-12 6:16
professionalJohn Schroedl27-Jan-12 6:16 
GeneralRe: How can I get /clr support it's giving errors Pin
Philippe Mori19-Feb-12 2:42
Philippe Mori19-Feb-12 2:42 
QuestionWhere is this managed object stored? Pin
Frank__Q18-Jan-12 14:17
Frank__Q18-Jan-12 14:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.