setdlldirectory vs adddlldirectory

Update 2: Specify the search path for DllImport in .NET Mentions that SetDllDirectory or AddDllDirectory can be used. This also restores safe DLL search mode based on the SafeDllSearchMode registry value. Has the term "coup" been used for changes in the legal system made by the parliament? Adds a directory to the search path used to locate DLLs for the application. 20DLL. If the function succeeds, the return value is nonzero. Whether your office needs a reliable exterminator or your home is under attack by a variety of rodents and insects, you dont need to fear anymore, because we are here to help you out. Browse other questions tagged, Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide. If so, Hunting Pest Services is definitely the one for you. Do you not control the other process? that of python.exe) * the user DLL search directories that get added by SetDllDirectory() and AddDllDirectory(), such as with os.add_dll_directory . I also tried to use the QCoreApplication::addLibraryPath: If this value is used, %windows%\system32 is searched. LOAD_LIBRARY_SEARCH_USER_DIRS. To get extended error information, call If you create some loader app(exe that sets search paths and then loads the main module as dll) it would work: SetDllDirectory, Nokia Certified Qt Specialist. To compile an application that uses this function, define _WIN32_WINNT as 0x0502 You can rate examples to help us improve the quality of examples. path, see You need to be a member in order to leave a comment var lib1 = NativeLibrary.GetLibraryPathname ("Lib1.dll"); To subscribe to this RSS feed, copy and paste this URL into your RSS reader. AddDllDirectory . SetDllDirectory() is a fairly useless function, it will only help your DLLs find DLLs they need themselves. string[] paths. The workaround is for those programs to configure their DLL search path using the the AddDllDirectory or SetDllDirectory APIs. To remove a directory added with AddDllDirectory, He has a code snippet for SetDllDirectory, but the argument is -------------------------------------------------------------------------------------------------------------------------------------. If the function fails, the return value is zero. This topic has been deleted. I can't imagine very many legitimate reasons that an app would want to do that. Visit Microsoft Q&A to post new questions. This also restores safe DLL search mode based on the SafeDllSearchMode registry value. Trying to reinstall Windows 7 pro 64bit on an E6440 that had a failed hard drive. lpBuffer, in characters, not including the terminating null character. SetDefaultDllDirectories is not a security feature. And it will only work if you use LoadLibrary () to load DLLs. Looks like your connection to Qt Forum was lost, please wait while we try to reconnect. I suspect you actually use implicitly loaded DLLs, they'll be loaded before you get a chance to call SetDllDirectory (). GetProcAddress to retrieve the function's address An absolute path to the directory to add to the search path. https://docs.microsoft.com/en-us/windows/desktop/api/libloaderapi/nf-libloaderapi-setdefaultdlldirectories. You can do some tricks if you don't know exactly what version you are loading. 2 D(,:CDE.) That's what I was hoping for[/quote]. Has 90% of ice around Antarctica disappeared in less than a decade? directory to the process DLL search path, the order in which those directories are searched is unspecified. There are two versions of these libraries, 32 and 64bit. developers correctly and securely load external libraries. The winbase.h header defines GetDllDirectory as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. To specify more than one directory, use the AddDllDirectory function and call LoadLibraryEx with LOAD_LIBRARY_SEARCH_USER_DIRS. "/Users/ata2/Developer/starlab-build/distrib/starlab.app/Contents/MacOS/libdynamic_surfacemesh.dylib" Our professional rodent controlwill surely provide you with the results you are looking for. Super User is a question and answer site for computer enthusiasts and power users. Which Template are you using? I will try to convince my team to do as you all have suggested me here. Thank you very much If your app is in c:\app and the dlls are in c:\app\dll, and if the current-dir is c:\app then if you do ..\dll you actually get c:\dll which is not what you want. This forum has migrated to Microsoft Q&A. AddDllDirectory are added to the process DLL search As soon as I realized what this was, I closed everything up andstarted looking for an exterminator who could help me out. DLLSetDllDirectory. And finally when we're done with the dynamic library, we have to free the native handles. At what point of what we watch as the MCU movies the branching started? Preface 1.1. If more than one path has been added, the order in which the paths are searched is unspecified. This can be beneficial to other community members reading this thread. for the life of the process. Create an account or sign in to comment. VS testrunner, , , : . LoadLibraryDLLDLLDLLLoadLibrary"DLL" Try reinstalling the program to fix this problem.". (with the same effects as if they were in the exe folder). For more It's not like the application directory is user-visible. That depends a lot on the platform you are on. In 3.8+, the search path for the dependent DLLs of a normally imported extension module includes the following directories: * the loaded extension module's directory * the application directory (e.g. For what particular purpose? Why would you need to do that? Yes, after installation it works well. Guaranteed Reliability and Proven Results! More info about Internet Explorer and Microsoft Edge, WindowsVista, WindowsXP with SP1 [desktop apps only]. installed on the target platform. Sign up for a free GitHub account to open an issue and contact its maintainers and the community. What makes Hunting Pest Services stand out from any other pest services provider is not only the quality of the results we deliver but also our versatility. use the SetDefaultDllDirectories function to I am not seeing any example on how to use this in C#. Already on GitHub? Edit 2: Microsoft updated Windows 7 KB2533623 fix with some additional other security patches too. If you have a really good reason for putting the DLLs in a different directory, then you have a limited number of options. Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support. windows,: 1 Windows,CmdEnter. Is the nVersion=3 policy proposal introducing additional policy rules and going against the policy principle to only relax policy rules? But probably you're right, we should avoid it as it is only for a "nice to see" reason. GetLastError. @harrymc Just go to link then after try to (Update for Windows 7 (KB2533623) download software. Unfortunately you can't use a compiler switch to make the default C compiler in interface blocks the one that you get if you use !DEC$ ATTRIBUTES STDCALL. MSDN Support, feel free to contact MSDNFSF@microsoft.com. AA . Only users with topic management privileges can see it. Please contribute it! The size of the output buffer, in characters. Microsoft Update Catalog : KB4457144. Making statements based on opinion; back them up with references or personal experience. If the function succeeds, the return value is an opaque pointer that can be passed to Thank you for your contributions. The content of the DLL is known, so I want to use the DllImport attribute to easily call the methods of the DLL. Specifies a default set of directories to search when the calling process loads a DLL. The program can't start because libgcc_s_dw2-1.dll is missing, Loading the same named library from different folder. Above is my folder structure. By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. Notes: Pretty straight-forward to use. Find centralized, trusted content and collaborate around the technologies you use most. use the RemoveDllDirectory function. Dir2 to the process DLL search path, specify \Dir2. But it is still available from the, procedure entry point setdefaultdlldirectories could not be located kernel32.dll, The open-source game engine youve been waiting for: Godot (Ep. Update 2: Thanks for contributing an answer to Stack Overflow! The System directory (LOAD_LIBRARY_SEARCH_SYSTEM32). The to your account. You basically need .\dll (which will now be c:\app\dll). FFplaymain1 . VS :. specify a default DLL search path for the process that eliminates the most vulnerable directories and limits the You mentioned that delay-load does not work for you? Not the answer you're looking for? Connect and share knowledge within a single location that is structured and easy to search. How can I explain to my manager that a project he wishes to undertake cannot be performed by the team? Few examples that I have tried: This is where my app is installed: C:\Users\AAA\App\hello\platforms\windows\build\windows\Debug\x64\AppX and I can see that my DLL is there. Our exe is injecting a library into a running process. I am not seeing any example on how to use this in C#. agregar una ruta de bsqueda DLL personalizada @ aplicacin de inicio. @nagisa I disagree. Houses, offices, and agricultural areas will become pest-free with our services. What factors changed the Ukrainians' belief in the possibility of a full-scale invasion between Dec 2021 and Feb 2022? Je viens d installer windows 7 sur un pc Dell optiplex 7010 avec un dvd Dell. Add twoto your attack modifier deck. I don't want the user to need root privileges to install/run this application.). SetDllDirectoryWinbase.hSetDllDirectorySetDllDirectoryVC2012<windows.h> (You can prevent this type of attack by calling SetDllDirectory and passing an empty string to remove the current directory from the search order, but now we're back to problem #1. Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. These are the top rated real world C++ (Cpp) examples of AddDllDirectory extracted from open source projects. DLLs are guests in the application process and therefore should not go changing the carpet. How to extract the coefficients from a long exponential expression? This doesn't quite sound like always present. 0xc000007b. Windows7, Windows Server2008R2, WindowsVista and Windows Server2008:To use this function in an application, call Expert extermination for a safe property. Tips . To get extended error information, call application. After calling SetDllDirectory, the DLL search path is: The directory from which the application loaded. SetDllDirectory does "cascade" and thus will affect how dependent DLLs are loaded. I feel that this specific change is out-of-scope for the Rusts standard library. So the default service name is Tomcat9.. or later. installed on the target platform. LOAD_LIBRARY_SEARCH flags, and directories added with other directories that are searched. LOAD_LIBRARY_SEARCH_USER_DIRS, directories specified with QLibrary lib(libAbsPath); qDebug() << lib.errorString(); Hi Tobias, thanks for the quick answer. Yet.. is there a way of dynamically loading the libraries after the program starts? You can't use AddDllDirectory as the above-quoted documentation goes on to advise, because you don't control the code in lib1.dll and therefore can't modify it to call LoadLibraryEx with the LOAD_LIBRARY_SEARCH_USER_DIRS flag. First we load the DLL, then the methods within the dynamic library. @ Well occasionally send you account related emails. The directory to be added to the search path. All C++ static initializers are also run before main is ever called, so Rust never has a chance to call SetDefaultDllDirectories before that stuff happens. LoadLibraryEx function calls that specify For more information, see Conventions for Function Prototypes. Acceleration without force in rotational motion? As a result, your viewing experience will be diminished, and you have been placed in read-only mode. Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. Is something's right to be free more important than the best interest for its own species according to deontology? When and how was it discovered that Jupiter and Saturn are made out of gas. We are focusing on developing If you use LoadLibrary, just specify the full . For more information, see Thanks a lot. because using delay-load in conjunction with SetDllLibrary seems to be a very simple way to solve your issue. QString libAbsPath(baseDir.absolutePath()+"/libdynamic_surfacemesh.dylib"); That library path juggling is handled by the OS and the loader and the env vars must be set before the program starts. information, call GetLastError. Just remember that this is about Windows 7. If The system directory. Update 2: Specify the search path for DllImport in .NET Mentions that SetDllDirectory or AddDllDirectory can be used. The 16-bit system directory. He has a code snippet for SetDllDirectory, but the argument is string[] paths. SetDllDirectory . SetDllDirectoryDLL. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. Thank you for your help. AddDllDirectory can be removed by calling If you put the DLLs in the application directory, they will be found first before the current directory is ever searched, closing the attack vector before it can ever be exploited.). Suspicious referee report, are "suggested citations" from a paper mill? If AddDllDirectory is used to add more than one SetDllDirectoryAddDllDirectory SetDefaultDllDirectories LOAD_LIBRARY_SEARCH_DEFAULT_DIRS(0x00001000) (Windows . Nokia Certified Qt Specialist. DLL AddDllDirectory So unless you are dynamically loading and calling into a DLL, this approach won't help you. How would I specify the relative argument? To help protect against DLL pre-loading attacks, the Rust compiler could emit similar code to restrict its DLL search path for all Windows Rust programs. Therefore, the only DLLs that will be loaded without bringing in a crate (or calling winapi APIs directly) will be those that were dynamically linked to as part of building. All normal DLL dependencies are loaded and their symbols resolved before main is ever called. NoScript). A pointer to a buffer that receives the application-specific portion of the search path. https://searchfox.org/mozilla-central/rev/5117a4c4e29fcf80a627fecf899a62f117368abf/toolkit/mozapps/update/updater/loaddlls.cpp#15-30, https://searchfox.org/mozilla-central/rev/5117a4c4e29fcf80a627fecf899a62f117368abf/security/sandbox/chromium/sandbox/win/src/process_mitigations.cc#46-58. Obviously, is usually going to be called before calling LoadLibraryEx(). Given this, what is the correct way to customize the DLL search path before main is called? I had not opened my garage for more than two months, and when I finally decided to completely clean it, I found out that a swarm of wasps had comfortably settled in it. privacy statement. SetDllDirectorypathSystem.ComponentModel.Win32Exception } [DllImport"kernel32.dll"CharSet=CharSet.AutoSetLastError=true] bool SetDllDirectory } true Installation went fine. Duress at instant speed in response to Counterspell. Welcome Do you urgently need a company that can help you out? harry's answer also worked on a similar error on my dell laptop. Universal Windows apps issue, and your issue is more relative to Cordova, I will movethis thread to corresponding forum for a professional answer. The directory specified by the lpPathName parameter. This is false for all the Qt libs, it usually works for plugins. To me it seems that the more appropriate location to do this would be in libraries that wrap/implement dynamic library loading or, in case winapi APIs are being called directly, by the caller. searched in the following order: It is not possible to revert to the standard DLL search path or remove any directory specified with To specify more than one directory, use the AddDllDirectory function and call LoadLibraryEx with LOAD_LIBRARY_SEARCH_USER_DIRS. path. An application can On Windows, it is possible to modify the dll search path inside the program, but it only works for dynamically loaded modules, as all others are loaded before main. Navigate to C:\Windows\System32\kernel32.dll. Rust can inject a call to it before main ever runs. IBscanUltimate.dllC. This search order is also used by Windows when it implicitly loads dependencies for child processes. The same can be said about arriving at your workplaceand finding out that it has been overrun by a variety of pests. You can also set probing paths in an application configuration file. Windows7, Windows Server2008R2, WindowsVista and Windows Server2008:To call this function in an application, use the But still I'm getting the exception that DLL cannot be found. If this parameter is NULL, the function restores the default search order. Restrict Windows DLL search path as a precaution against DLL pre-loading attacks, https://web.archive.org/web/20190113103607/https://blogs.msdn.microsoft.com/oldnewthing/20170126-00/?p=95265#comments, Maintainment: Use SetDllDirectory to set dll search path. SetDllDirectory is a fairly useless function, it will only help your DLLs find DLLs they need themselves. Those libraries will not be affected by SetDefaultDllDirectories in any way. 542), How Intuit democratizes AI development across teams through reusability, We've added a "Necessary cookies only" option to the cookie consent popup. If the function fails, the return value is zero. Specify shared library search path at runtime. NULLSetDllDirectory"DLL"DLL win8windows server 2012MSDNSetDefaultDllDirectories AddDllDirectoryRemoveDllDirectory If some other code in your process is calling SetDllDirectory, then it is undoing your first call. If it is code in lib1.dll that does this before it attempts to load lib2.dll, then the attempt to load lib2.dll will fail. If I start the program in the folder where the library is, everything is ok. In short, the idea is to download a native library (DLL) into a temporary directory (not in the application folder), and use its methods. Removes a directory that was added to the process DLL search path by using AddDllDirectory. If this value is used, the application's installation directory is searched. The directories that are listed in the PATH environment variable. RemoveDllDirectory to remove the DLL from the SetDefaultDllDirectories from the search The best answers are voted up and rise to the top, Not the answer you're looking for? This leaves you with the options of either using DLL redirection, or adding information about your dependencies in your application's manifest. Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. But I face this problem: On Windows 7 you need to download and install update KB2533623 from How to stop DLL Hijacking for secondary IMPLICITLY loaded DLLs. LoadLibrary and Other executable modules? Now you can parse/modify this path to your dlls-path and then call SetDllDirectory using this path. It doesn't answer your question, but I have to ask anyway: what is the motivation of putting the DLLs in a "dlls" subdirectory of your application folder? You can't download. The AddDllDirectory function can be used to add What is this application? Now, granted, this is bad behavior on the part of lib1.dll. 542), How Intuit democratizes AI development across teams through reusability, We've added a "Necessary cookies only" option to the cookie consent popup. The order of C++ static initializers is not well defined, so there's no guarantee that an initializer in one compilation unit will run before an initializer in a different compilation unit. Otherwise, directories specified with the 7. The standard library consciously avoids dealing with dynamic library loading. But not all code out there is well-behaved, which makes this a fragile strategy. SetDllDirectory does "cascade" and thus will affect how dependent DLLs are loaded. There is no function that obtains the path of this directory, but it is searched. process DLL search path. I am not sure what is it that I am doing wrong and why the DLLImport cannot find my dll. To get extended error QLibrary is just a wrapper around the native dlopen/LoadLibrary functions to ease the latter. If the function succeeds, the return value is nonzero. After calling SetDllDirectory, the DLL search path is: The directory from which the application loaded. The process DLL search path applies only to the calling process and persists Malware purposes mostly spring to mind. Having Rust implicitly call SetDefaultDllDirectories would bring in the possibility of breaking existing programs that rely on the default DLL search order, and from experience I can say that trying to figure out why a DLL can no longer be found is an incredibly frustrating ordeal. If the function succeeds, the return value is nonzero. It also effectively disables safe DLL search mode while the specified directory is in the search path. This value represents the recommended maximum number of directories an application should include in its User-Defined Types: None. @ Dynamic-Link Library Search Order. Ackermann Function without Recursion or Stack, Theoretically Correct vs Practical Notation, Dealing with hard questions during a software developer interview. Your browser does not seem to support JavaScript. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. Specify the search path for DllImport in .NET Mentions that SetDllDirectory or To get extended error information, call It only takes a minute to sign up. path is used when LoadLibraryEx is called with no The winbase.h header defines SetDllDirectory as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. CUDA C++ Best Practices Guide. https://msdn.microsoft.com/en-us/library/windows/desktop/hh447159(v=vs.85).aspx, Specify the search path for DllImport in .NET. Furthermore, it modifies global state, so I suspect that it is best to call it as early as possible. SetDllDirectory () is a fairly useless function, it will only help your DLLs find DLLs they need themselves. Adds a directory to the process DLL search path. Asking for help, clarification, or responding to other answers. the witch boy book 4 release date; ritning jakttorn vildsvin; setdlldirectory vs adddlldirectory; konstutstllning rns slott; radhus uthyres helsingborg; lkemedelsberkning prov; praktikertjnst ortopedi stockholm. The supplied lib files are most likely import libs (they just contain the definition stubs). static extern bool SetDllDirectory(string lpPathName); VB Signature: Declare Function SetDllDirectory Lib "kernel32.dll" (TODO) As TODO. How can I explain to my manager that a project he wishes to undertake cannot be performed by the team? SetDefaultDllDirectories is a Windows API, and so will always be present. path. However, I'm not sure if that can be done with system dlls. DirectXV4.2 DirectX (DirectX Repair). How to extract the coefficients from a long exponential expression? However, whenever I try to install any of the Dell drivers, I get the following error: "The procedure entry point AddDllDirect. SetDefaultDllDirectories is a Windows API, and so will always be present. I suspect you actually use implicitly loaded DLLs, they'll be loaded before you get a chance to call SetDllDirectory(). My app uses the same libraries, but in VB.NET. If you have a guest in your house that's modifying the DLL search order, this isn't a reliable fix for the security issue. Example of BIND(C) interface body that works: module M use ifwin use ISO_C_BINDING implicit none private public SetDllDirectory . For example, as a precaution, Firefox removes the current directory from the DLL search path and then restricts the DLL search path to the application's installation directory, the Windows system directory, and any paths explicitly added using the AddDllDirectory or SetDllDirectory APIs. GetLastError. Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. The AddDllDirectory function can be used to add any absolute path to the set of directories that are searched for a DLL. DLL pre-loading attack. LoadLibraryEx with one or more You signed in with another tab or window. information, visit the following Microsoft webpages: Edit: The download has disappeared from the above link, but is still available from the However, AddDllDirectory and SetDllDirectory can be used to influence the search path. If you create some loader app(exe that sets search paths and then loads the main module as dll) it would work: SetDllDirectory. This forum is closed. int i; Converts an integer value to a resource type compatible with the resource-management functions. User-Defined Types: None. I have already searched the forums and found many posts which described making changes to environment variables and the registry, which are not an option for me (target machines will not have rights to make these changes). LoadPackagedLibrary function can be used to load the dll. QString aPath = applicationDirPath(); Learn more about Stack Overflow the company, and our products. Thanks very much for your help in advance! springMvcfilefile. Using the Windows Headers. It can be done with manifest files. SetDllDirectory function affects all subsequent calls to the The system directory. However, there is a fatal flaw in SetDllDirectory, as called out in the documentation: Each time the SetDllDirectory function is called, it replaces the directory specified in the previous SetDllDirectory call. How to Fix Kernel32.dll missing error KERNEL32.dll Entry Point Error| FIX Windows 7 2019this will likely fix your error with whatever application you are try. Your business came highly recommended, and I am glad that I found you! to the Developing Universal Windows apps forum! I tried to point it to my dylib but the isLoaded() gave me "false". Windows' standard DLL search path contains directories that can be vulnerable to DLL pre-loading attacks. If you have any compliments or complaints to Update 3: Class1.cs is like this: The IBScanUltimateApi.cs & _IBSU_GetSDKVersion look somethinglike this: I have placed the DLL in many locations to see if it'll get picked up and they all have the above properties. For Win32 processes that are not running a packaged or protected process, calling this function will also affect the DLL search order of the children processes started from the process that has called the function. If not, you're stuck with deploying them in the same folder as the .exe. from Kernel32.dll. Another way this could go wrong would be if lib1.dll loads lib2.dll by calling LoadLibraryEx and passing one of the many flags that override the default search order, like LOAD_LIBRARY_SEARCH_APPLICATION_DIR. Basically, SetDllDirectory allows you to modify the process's default search order for DLLs, and whatever changes are made to this affect the entire process, including any DLLs that may be loaded into that process. We are a Claremont, CA situated business that delivers the leading pest control service in the area. This should work. LoadLibrary and Not working either Or to attempt to load the library manually at runtime: If the function succeeds, the return value is the length of the string copied to "DYLD_LIBRARY_PATH" works in OSX :) (and hopefully in linux). public partial class MyForm : Form { [DllImport("Kernel32.dll", CallingConvention = CallingConvention.StdCall)] public static extern bool SetDllDirectory(String lpPathName); private void MyForm_Load(object sender, EventArgs e) { // Restores the default search order SetDllDirectory(null); // Add dll directory pathcsharp SetDllDirectory(AppDomain.CurrentDomain.BaseDirectory + "Dlls");csharp . From the screenshots, it doesn't look like a Cordova Application. see Naming Files, Paths, and Namespaces. ata2 AT pluto ~/Developer/starlab-build/distrib/starlab.app/Contents: ./MacOS/starlab Although this approach is suitable for straight-in landing minimums in every sense, why are circle-to-land minimums given? Yes, the SetDllDirectory function affects the DLL search path for the entire process. GetProcAddress function to retrieve its address from Microsoft has released new API enhancements for Windows to help Other Gloomhaven Scenarios can also be received as add-ons for $5 each. the path. SetDefaultDllDirectories is first called with I execute an exe from a directory, say, "C:/test" Syntax BOOL RemoveDllDirectory( [in] DLL_DIRECTORY_COOKIE Cookie ); Parameters [in] Cookie. Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. The package can be found in More info about Internet Explorer and Microsoft Edge, Windows8 [desktop apps only],KB2533623 on Windows7, Windows Server2008R2, WindowsVista, and Windows Server2008. Windows IV . @ Does Cosmic Background radiation transmit heat? The directory specified by the lpPathName parameter. To compile an application that uses this function, define _WIN32_WINNT as 0x0502 or later. Again not working, as the output of the qDebug above is: The application must work on Windows 10, so I can use a function introduced in Windows 8 AddDllDirectory. This search For more information, see Conventions for Function Prototypes. However, AddDllDirectory and SetDllDirectory can be used to influence the search path. With the NativeLibrary class above, we can try to load a library using only two lines of code.

James Bullock Astrophysicist Wife, Walter Connolly Obituary, Watermelon Festival Texas 2022, Articles S

setdlldirectory vs adddlldirectory