title: Choosing ctypes dll loading mechanism
body: <p>I´m working on some code that can access some dll funcionality using ctypes. The library loading was done with:</p>
  
  <pre><code>U2_C_INTERFACE = ctypes.cdll.LoadLibrary("mydllname")
  </code></pre>
  
  <p>And this was working in the original developer Windows 10 machine (and others). But on my own machine I got this error when calling library methods:</p>
  
  <pre><code>Procedure called with not enough arguments (24 bytes missing) or wrong calling convention
  </code></pre>
  
  <p>After googling I could fix it changing the dll loading method to:</p>
  
  <pre><code>U2_C_INTERFACE = ctypes.windll.LoadLibrary("mydllname")
  </code></pre>
  
  <p>This works in my own Windows 10 machine (and others). But it doesn´t work in the original Windows 10 machine, we get this other error when calling library methods:</p>
  
  <pre><code>Procedure probably called with too many arguments (24 bytes in excess)
  </code></pre>
  
  <p>Is there a way to know programatically when to use <code>cdll.LoadLibrary</code> and when <code>windll.LoadLibrary</code>?</p>
  
  <p>This is the troublesome code, the call to <code>o_session</code> is throwing the commented exception</p>
  
  <pre><code>if U2_C_INTERFACE is None:
      # U2_C_INTERFACE = ctypes.cdll.LoadLibrary("uvic32")
      U2_C_INTERFACE = ctypes.windll.LoadLibrary("uvic32")
  
  subkey  = c_char_p(bytes(0))
  status  = c_long(0)
  host_l  = bytes(servidor_uv,    servidor_universe.devolver_sistema_codificacion())
  user_l  = bytes(usuario_uv,     servidor_universe.devolver_sistema_codificacion())
  pass_l  = bytes(password_uv,    servidor_universe.devolver_sistema_codificacion())
  acc_l   = bytes(cuenta_uv,      servidor_universe.devolver_sistema_codificacion())
  
  # Gestión de apertura de sesión
  o_session = U2_C_INTERFACE.ic_universe_session
  
  o_session.argtypes = (
      c_char_p, c_char_p, c_char_p,
      c_char_p, c_char_p, _ctypes.POINTER(c_long))
  res = o_session(
      c_char_p(host_l), c_char_p(user_l), c_char_p(pass_l),
      c_char_p(acc_l), subkey, _ctypes.byref(status))
  </code></pre>
  
  <p>The Python version we're using is 3.4.0 (32 bits)</p>
  
  <pre><code>Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:24:06) [MSC v.1600 32 bit (Intel)] on win32
  </code></pre>
  
  <p>My ctypes version is 1.1.0.</p>