Author Topic: "Unable to register the DLL/OCX: RegSvr32 failed with exit code 0x5"  (Read 2693 times)

Offline KoujiBEAR76

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
I can't seem to install the latest version of CopyHandler. This is a pretty new Windows 10 installation. I'm aware "0x5" is some sort of access/permission issue, but I'm running the installer as administrator and I'm using the main/only Windows account which has admin rights. So... any thoughts?

Offline Xallde

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: "Unable to register the DLL/OCX: RegSvr32 failed with exit code 0x5"
« Reply #1 on: December 19, 2020, 01:04:58 pm »
Same issue for me >:(, anybody solved?

Offline Xallde

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: "Unable to register the DLL/OCX: RegSvr32 failed with exit code 0x5"
« Reply #2 on: December 19, 2020, 06:33:38 pm »
this happens woth copy handler 1.45 (chext64.dll is the origin of failure) tried 1.44: no problem

Offline KryziK

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: "Unable to register the DLL/OCX: RegSvr32 failed with exit code 0x5"
« Reply #3 on: December 19, 2020, 08:29:47 pm »
Can confirm there's an issue on Win10-x64 with running regsvr32 on the chext dll.

Attempted with the following:
* Running as admin
* Any/all antivirus disabled

However, when I first installed v1.44, and then immediately after installed v1.45, it appears to have worked. There might be a bug in anything it's expecting to already exist when v1.45 is the FIRST version the user has ever installed. It could possibly be DllRegistration.RemoveLegacyEntries crashing if those entries don't exist?

this happens woth copy handler 1.45 (chext64.dll is the origin of failure) tried 1.44: no problem

Try installing v1.45 now, without uninstalling v1.44. Does it work?
« Last Edit: December 19, 2020, 08:33:20 pm by KryziK »

Offline Ixen

  • Administrator
  • Full Member
  • *****
  • Posts: 221
  • Karma: +5/-0
    • View Profile
Re: "Unable to register the DLL/OCX: RegSvr32 failed with exit code 0x5"
« Reply #4 on: December 21, 2020, 08:11:28 pm »
What is the exact version of Win10 that you've used?
Looks like some dependency problem, but I'll have to try reproducing it on some clean Win10 vm.

Offline KryziK

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: "Unable to register the DLL/OCX: RegSvr32 failed with exit code 0x5"
« Reply #5 on: December 21, 2020, 08:55:25 pm »
What is the exact version of Win10 that you've used?
Looks like some dependency problem, but I'll have to try reproducing it on some clean Win10 vm.

OS Name   Microsoft Windows 10 Pro
Version   10.0.19041 Build 19041

Offline Ixen

  • Administrator
  • Full Member
  • *****
  • Posts: 221
  • Karma: +5/-0
    • View Profile
Re: "Unable to register the DLL/OCX: RegSvr32 failed with exit code 0x5"
« Reply #6 on: December 21, 2020, 10:00:08 pm »
Thanks. I can reproduce problem with fresh install of Win10 2004.
I've filed a bug for further tracking: https://dev.copyhandler.com/browse/CH-369

I'll try to take a look at it tomorrow.

Offline KryziK

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: "Unable to register the DLL/OCX: RegSvr32 failed with exit code 0x5"
« Reply #7 on: December 21, 2020, 10:51:53 pm »
Thanks. I can reproduce problem with fresh install of Win10 2004.
I've filed a bug for further tracking: https://dev.copyhandler.com/browse/CH-369

I'll try to take a look at it tomorrow.

Command
C:\Windows\System32\regsvr32.exe C:\Users\Test\Desktop\ch-portable-1.45\64bit\chext64.dll

Working Directory
C:\Users\Test\Desktop\ch-portable-1.45\64bit

Module
chext64.dll

API
RegOpenKeyExW ( HKEY_CLASSES_ROOT, "Directory\Shellex\DragDropHandlers", 0, KEY_ALL_ACCESS, 0x0000000000b3e198 )

Return Value
ERROR_FILE_NOT_FOUND

Error
2 = The system cannot find the file specified.

Notes
Code: [Select]
void DllRegistration::RegisterDropMenuExt()
{
std::wstring strClsID = CLSID2String(CLSID_DropMenuExt);
RegisterClass(strClsID, L"DropMenuExt Class", L"Apartment");

CreateNodes(HKEY_CLASSES_ROOT, L"CLSID", strClsID + L"\\shellex\\MayChangeDefaultMenu");

CreateNodeWithDefaultValue(HKEY_CLASSES_ROOT, L"Directory\\Shellex\\DragDropHandlers", L"chext", strClsID.c_str());
CreateNodeWithDefaultValue(HKEY_CLASSES_ROOT, L"Drive\\Shellex\\DragDropHandlers", L"chext", strClsID.c_str());
CreateNodeWithDefaultValue(HKEY_CLASSES_ROOT, L"Folder\\Shellex\\DragDropHandlers", L"chext", strClsID.c_str());

CreateSingleValue(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved", strClsID.c_str(), L"chext");
}
« Last Edit: December 21, 2020, 11:08:36 pm by KryziK »

Offline KryziK

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: "Unable to register the DLL/OCX: RegSvr32 failed with exit code 0x5"
« Reply #8 on: December 21, 2020, 11:32:30 pm »
Sorry for double-post.

Code: [Select]
void TRegistry::ReOpen(HKEY key, const wchar_t* pszKey, bool bReadOnly /*= true*/)
{
if (!pszKey)
throw std::invalid_argument("pszKey");

if (m_hKey)
RegCloseKey(m_hKey);

LSTATUS lStatus = RegOpenKeyEx(key, pszKey, 0, bReadOnly ? KEY_QUERY_VALUE : KEY_ALL_ACCESS, &m_hKey);
if (lStatus != ERROR_SUCCESS || m_hKey == nullptr)
throw std::runtime_error("Cannot open registry key");
}

Can confirm that throw std::runtime_error("Cannot open registry key"); is getting hit.

Offline Xallde

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: "Unable to register the DLL/OCX: RegSvr32 failed with exit code 0x5"
« Reply #9 on: December 22, 2020, 08:22:01 am »
Error seen with Win 10 20H2 build 19042.658

Offline Ixen

  • Administrator
  • Full Member
  • *****
  • Posts: 221
  • Karma: +5/-0
    • View Profile
Re: "Unable to register the DLL/OCX: RegSvr32 failed with exit code 0x5"
« Reply #10 on: December 22, 2020, 07:12:43 pm »
@KryziK: thanks for pinpointing the specific part of code - that sped things up.

Fix has been committed to git repo. I'll release 1.46 in a day or two after fixing one more problem with shell extension. If anyone would like to test the fix - please pm me.

Offline KryziK

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: "Unable to register the DLL/OCX: RegSvr32 failed with exit code 0x5"
« Reply #11 on: December 22, 2020, 07:21:25 pm »
Not a problem! Glad it helped.

If you want me to test the fix on one of my VMs, I can. Just tell me what specifics you want me to verify (other than the error going away during install, obviously).

Offline Ixen

  • Administrator
  • Full Member
  • *****
  • Posts: 221
  • Karma: +5/-0
    • View Profile
Re: "Unable to register the DLL/OCX: RegSvr32 failed with exit code 0x5"
« Reply #12 on: December 22, 2020, 08:05:20 pm »
I've sent you a PM on this forum with link. Thanks!

Offline KryziK

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: "Unable to register the DLL/OCX: RegSvr32 failed with exit code 0x5"
« Reply #13 on: December 22, 2020, 10:42:26 pm »
I've sent you a PM on this forum with link. Thanks!

Responded. Overall things are looking good. Replying here because I don't see any of my replies in sent messages, and want to make sure you got them.

 

AdminAccess