tor  0.4.1.0-alpha-dev
winlib.c
Go to the documentation of this file.
1 /* Copyright (c) 2003, Roger Dingledine
2  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
3  * Copyright (c) 2007-2019, The Tor Project, Inc. */
4 /* See LICENSE for licensing information */
5 
15 #ifdef _WIN32
16 #include "lib/fs/winlib.h"
17 
18 HANDLE
19 load_windows_system_library(const TCHAR *library_name)
20 {
21  TCHAR path[MAX_PATH];
22  unsigned n;
23  n = GetSystemDirectory(path, MAX_PATH);
24  if (n == 0 || n + _tcslen(library_name) + 2 >= MAX_PATH)
25  return 0;
26  _tcscat(path, TEXT("\\"));
27  _tcscat(path, library_name);
28  return LoadLibrary(path);
29 }
30 #endif /* defined(_WIN32) */
Header for winlib.c.