code: def test_load_dll_with_flags(self):
      _sqlite3 = import_helper.import_module("_sqlite3")
      src = _sqlite3.__file__
      if src.lower().endswith("_d.pyd"):
          ext = "_d.dll"
      else:
          ext = ".dll"
  
      with os_helper.temp_dir() as tmp:
          # We copy two files and load _sqlite3.dll (formerly .pyd),
          # which has a dependency on sqlite3.dll. Then we test
          # loading it in subprocesses to avoid it starting in memory
          # for each test.
          target = os.path.join(tmp, "_sqlite3.dll")
          shutil.copy(src, target)
          shutil.copy(
              os.path.join(os.path.dirname(src), "sqlite3" + ext),
              os.path.join(tmp, "sqlite3" + ext),
          )
  
          def should_pass(command):
              with self.subTest(command):
                  subprocess.check_output(
                      [
                          sys.executable,
                          "-c",
                          "from ctypes import *; import nt;" + command,
                      ],
                      cwd=tmp,
                  )
  
          def should_fail(command):
              with self.subTest(command):
                  with self.assertRaises(subprocess.CalledProcessError):
                      subprocess.check_output(
                          [
                              sys.executable,
                              "-c",
                              "from ctypes import *; import nt;"
                              + command,
                          ],
                          cwd=tmp,
                          stderr=subprocess.STDOUT,
                      )
  
          # Default load should not find this in CWD
          should_fail("WinDLL('_sqlite3.dll')")
  
          # Relative path (but not just filename) should succeed
          should_pass("WinDLL('./_sqlite3.dll')")
  
          # Insecure load flags should succeed
          # Clear the DLL directory to avoid safe search settings propagating
          should_pass(
              "windll.kernel32.SetDllDirectoryW(None); WinDLL('_sqlite3.dll', winmode=0)"
          )
  
          # Full path load without DLL_LOAD_DIR shouldn't find dependency
          should_fail(
              "WinDLL(nt._getfullpathname('_sqlite3.dll'), "
              + "winmode=nt._LOAD_LIBRARY_SEARCH_SYSTEM32)"
          )
  
          # Full path load with DLL_LOAD_DIR should succeed
          should_pass(
              "WinDLL(nt._getfullpathname('_sqlite3.dll'), "
              + "winmode=nt._LOAD_LIBRARY_SEARCH_SYSTEM32|"
              + "nt._LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR)"
          )
  
          # User-specified directory should succeed
          should_pass(
              "import os; p = os.add_dll_directory(os.getcwd());"
              + "WinDLL('_sqlite3.dll'); p.close()"
          )
  
imports: import _ctypes
  import _ctypes_test
  import ctypes
  import os
  import shutil
  import subprocess
  import sys
  import test.support
  import unittest
  from ctypes import CDLL, cdll, addressof, c_void_p, c_char_p
  from ctypes.util import find_library
  from test.support import import_helper, os_helper
label_desc: Use image node_id 9 for calling the LoaderTest obj's underlying member method code with example usage: obj.test_load_dll_with_flags() without return types