Jump to content
Sign in to follow this  
XTankKiller

[SOLVED] Blocked loading of DLL

Recommended Posts

Hello,

I'm trying to create an extension but i keep getting this message " 03/06/2022 05:25:27 - Blocked loading of file 'C:\Program Files (x86)\Steam\steamapps\common\Arma 3\test_x64.dll'.

I know DLLs have to be whitelisted in order to be loaded by the game but this is a test DLL i won't fill a Battleye contact request just for a test DLL i will have to modify.

I tried to disable battleye but i get the same message.

How can i get this DLL loaded ?

Share this post


Link to post
Share on other sites

well by disabling BE - check the rpt if you made a mistake/double check startup parameters

  • Like 1

Share this post


Link to post
Share on other sites

I disabled battleye but the game is acting like there as no dll.

This is what my dll is made of:

using System.Text;
using System.Runtime.InteropServices;
using RGiesecke.DllExport;

class MyExtension {

#if WIN64
		[DllExport("RVExtensionVersion", CallingConvention = CallingConvention.Winapi)]
#else
		[DllExport("_RVExtensionVersion@8", CallingConvention = CallingConvention.Winapi)]
#endif
		public static void RvExtensionVersion(StringBuilder output, int outputSize)
		{
			output.Append("Test-Extension v1.0");
		}

#if WIN64
		[DllExport("RVExtension", CallingConvention = CallingConvention.Winapi)]
#else
		[DllExport("_RVExtension@12", CallingConvention = CallingConvention.Winapi)]
#endif
		public static void RvExtension(StringBuilder output, int outputSize,
			[MarshalAs(UnmanagedType.LPStr)] string function)
		{
			output.Append(function);
		}

#if WIN64
		[DllExport("RVExtensionArgs", CallingConvention = CallingConvention.Winapi)]
#else
		[DllExport("_RVExtensionArgs@20", CallingConvention = CallingConvention.Winapi)]
#endif
		public static int RvExtensionArgs(StringBuilder output, int outputSize,
			[MarshalAs(UnmanagedType.LPStr)] string function,
			[MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr, SizeParamIndex = 4)] string[] args, int argCount)
		{
			foreach(var arg in args)
			{
				output.Append(arg);
			}
			return 0;
		}
}

That's bohemia's example.

When i call the extension i use:

("test" callExtension "test")

It's supposed to return "test".

But i don't get anything.

I tried to use

("test" callExtension ["test", ["bla","bla"]])

it Returns ["",-1,0]

I checked the RPT file, nothing written in.

Share this post


Link to post
Share on other sites

I still don't know why the game won't load my DLL. When i try to call the DLL in the game it doesn't do anything i just get ["",-1,0] but when i try to replace the DLL after calling it it says the DLL is currently used by a program. So i guess the game is trying to open my DLL but for a reason it's not working. I think there isa problem with the package UnmanagedExport. I tried package UnmanagedExport.Repack and UnmanagedExport.Repack.Update but it cause the game to crash.

Share this post


Link to post
Share on other sites

I solved the problem ! Finallyyy! The problem is coming from my misunderstanding of Visual Studio 2022. I was trying to create a project based on .Net and Standard .Net. You must create a project based on .Net Framework and select Framework 3.5 in the project properties to have it working ! A superior Framework will not work !

  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×