How to run a Windows 32bit dll jmail.dll under Windows 2008 x64

So you have a 32bit jmail.dll that runs under Windows 2003 (32 bit), xp etc but not in Windows 2008 x64. This will include the software called jmail which is proving to be a massive pain for customers as it appears the company is no longer contactable.

Testing

To test it actually works on your x64 server

NB. Assuming you have setup smtp and its tested and working

  1. Install Jmail to the default location
  2. Copy your .vbs script to a directory .e.g c: and rename test.vbs
  3. Start, Run, c:windowssyswow64cscript.exe
  4. c:
  5. cd
  6. cscript test.vbs

This should now run without the error and your test user should receive an email.

The Fix

The following paragraph is a mirror of the helpful article from sarbashish-bhattacharjee and not my own work.

Scenario:

Let me assume that you have a 3rd party 32-bit COM DLL provided by a vendor. The DLL works fine on 32bit Operating system and the moment you move to a x64 environment it does not work even though you have tried to register it through regsv32.

Also let me assume that the name of the DLL is “ASXUpload.DLL”. I will use this name in the solution which I am providing below.

Solution

Please follow the steps below:

  1. First of all if you have already registered the DLL in x64 Operating System the unregister the DLL. To do that just type the following in the run command “regsvr32 /u ” something like “regsvr32 /u C:MyDLLASXUpload.DLL”. If you have already unregistered the DLL from the x64 OS then no need to run this step.
  2. Also make sure that you have not kept your DLL inside the Windows folder which is normally C:Windows. For this example I have kept the DLL in the following folder C:MyDLL.
  3. Now we need to add the COM+ Components using Component Services of Microsoft. To start Component Services, go to Control Panel / Administrative Tools/ Component Services. Once inside component Services, drill down into Computers, then My Computer, then COM+ Applications. Then Right-click on COM+ Applications and choose “New” -> “Application”.
  4. At “Welcome to the COM Application Install Wizard” screen, click “Next >”.
  5. Click on “Create an Empty Application” button.
  6. Enter the name. Since my DLL name is ASXUpload.dll so I have typed in the name as “ASXUpload”. When asked “Library or Server”, select “Server”.
  7. Click “Next >” button and then choose “This User”.
  8. Enter the User or click Browse to select the user. Clicking Browse is safer, to ensure that the correct domain and spelling are used. Enter the password and confirm the password. Warning, be sure to include the domain/username if required. Click on “Finish”. (Note: We recommend “This User”, otherwise, someone must be logged onto the server in order for DLL to run.). In my case I have chosen the domain administrator account. You can also add a Service Account. If you are not sure please consult with your system administrator.
  9. Now “Add Application Roles” screen will appear. Do not add anything just click on the “Next >” button.
  10. Now “Add Users to Role” screen appear. Do not add anything just click on the “Next >” button.
  11. Now you will see that under Component Services -> Computers -> My Computer -> COM+ Application -> you will see the newly added application. In this example the application name would be “ASXUpload”. Now drill down the newly added application “ASXUpload” by clicking the “+” icon and you will see “Components”.
  12. Now right-click on “Components” and then choose “New Component”. At “Welcome to the COM Application Install Wizard” screen, click “Next >”.
  13. Click on “Install new component(s)” and now select the DLL which you want to register. In the case it would be “C:MyDLLASXUpload.DLL”.
  14. Once you select the DLL you will see that it will show you the components found. Click on the “Next >” button to proceed and finally hit the “Finish” button to complete.
  15. Now is the tricky part. Right click on the application you have added which you will find under Component Services -> Computers -> My Computer -> COM+ Application. In my case the application name is “ASXUpload”. After you right click on the Application select “Properties”. The application properties window will open up. Click on the “Security” tab. In the Security tab make sure that under “Authorization” section the checkbox “Enforce access checks for this application” is unchecked.

Under “Security Level” section select the radio button “Perform access checks only at the process level. Security property will not be included on the object context. COM+ security call context will not be available.”

Make sure that option “Apply restriction policy” is unchecked.

Set “Impersonate Level” to “Anonymous”

  1. If you want to access the DLL from web Application then make sure that you add the IUSR and IWAM account. To do this go to COM+ Application -> Application Name (In this case it will be ASXUpload) -> Roles -> CreateOwner -> Users. Right click on the Users and add the IUSR and IWAM account used by Internet Information Server.
  2. Also set the NTFS permission on the folder where you kept the DLL. In this case I have kept the DLL inside the folder C:MyDLL. Now right click on the folder “MyDLL” and go to the security tab and then add the IUSR and IWAM account.

This is all you need to do and you should be able to consume the DLL.

 

Leave a Comment

Your email address will not be published.

Follow

Get every new post on this blog delivered to your Inbox.

Join other followers: