2 * File path.c - managing path in debugging environments
4 * Copyright (C) 2004, Eric Pouech
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include "dbghelp_private.h"
27 #include "wine/debug.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
31 /******************************************************************
32 * FindDebugInfoFile (DBGHELP.@)
35 HANDLE WINAPI FindDebugInfoFile(PSTR FileName, PSTR SymbolPath, PSTR DebugFilePath)
39 h = CreateFileA(DebugFilePath, GENERIC_READ, FILE_SHARE_READ, NULL,
40 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
41 if (h == INVALID_HANDLE_VALUE)
43 const char* p = strrchr(FileName, '/');
45 if (!SearchPathA(SymbolPath, p, NULL, MAX_PATH, DebugFilePath, NULL))
47 h = CreateFileA(DebugFilePath, GENERIC_READ, FILE_SHARE_READ, NULL,
48 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
50 return (h == INVALID_HANDLE_VALUE) ? NULL : h;
53 /******************************************************************
54 * FindDebugInfoFileEx (DBGHELP.@)
57 HANDLE WINAPI FindDebugInfoFileEx(PSTR FileName, PSTR SymbolPath,
59 PFIND_DEBUG_FILE_CALLBACK Callback,
62 FIXME("(%s %s %p %p %p): stub\n",
63 FileName, SymbolPath, DebugFilePath, Callback, CallerData);
67 /******************************************************************
68 * FindExecutableImage (DBGHELP.@)
71 HANDLE WINAPI FindExecutableImage(PSTR FileName, PSTR SymbolPath, PSTR ImageFilePath)
74 if (!SearchPathA(SymbolPath, FileName, NULL, MAX_PATH, ImageFilePath, NULL))
76 h = CreateFileA(ImageFilePath, GENERIC_READ, FILE_SHARE_READ, NULL,
77 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
78 return (h == INVALID_HANDLE_VALUE) ? NULL : h;
81 /***********************************************************************
82 * MakeSureDirectoryPathExists (DBGHELP.@)
84 BOOL WINAPI MakeSureDirectoryPathExists(LPCSTR DirPath)
86 if (CreateDirectoryA(DirPath, NULL)) return TRUE;
87 if (GetLastError() == ERROR_ALREADY_EXISTS)
89 SetLastError(ERROR_SUCCESS);
95 /***********************************************************************
96 * SearchTreeForFile (DBGHELP.@)
98 BOOL WINAPI SearchTreeForFile(LPSTR RootPath, LPSTR InputPathName,
99 LPSTR OutputPathBuffer)
101 FIXME("(%s, %s, %s): stub\n",
102 debugstr_a(RootPath), debugstr_a(InputPathName),
103 debugstr_a(OutputPathBuffer));
104 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);