Launching Shell Links (LNKs) from WOW64

后端 未结 4 651
执念已碎
执念已碎 2021-01-14 13:33

Our 32-Bit application launches Windows LNK files (Shell Links) via ShellExecute. When it tries to \"launch\" a link to a 64-Bit binary (such as the \"Internet Explorer (64-

4条回答
  •  不要未来只要你来
    2021-01-14 14:04

    Anytime you here something is impossible on a computer, think again... The key is to utilize the c:\windows\sysnative\ path to shut off the redirection.

    Here is very simple code that will do what you want:

    #include 
    #include 
    #include 
    
    int main(int iArgc, const char *pArgv[])
    {
        ShellExecute(NULL, L"open", L"C:\\windows\\sysnative\\..\\..\\Program Files\\Internet Explorer\\iexplore.exe", NULL, NULL, SW_SHOWNORMAL);
        BOOL bIAmWow64 = FALSE;
        IsWow64Process(GetCurrentProcess(), &bIAmWow64);
        printf("I am a wow64 process: %hs\n", bIAmWow64 ? "Yes": "No");
        return 0;
    }
    

    I hope that is helpful.

提交回复
热议问题