[text] PathResolve

Viewer

copydownloadembedprintName: PathResolve
  1. BOOL WINAPI PathResolve(LPWSTR path, LPCWSTR *dirs, DWORD flags)
  2. {
  3.     UINT uExtensions = (flags & PRF_DONTFINDLNK) ? 0xF : 0x3F;
  4.  
  5.     if (edi & PRF_VERIFYEXISTS)
  6.         SetLastError(ERROR_FILE_NOT_FOUND);
  7.  
  8.     PathUnquoteSpacesW(path);
  9.  
  10.     if (PathIsRootW(path))
  11.     {
  12.         if ((path[0] == L'\\' && path[1] == 0) ||
  13.             (PathIsUNCServerW(path) || PathIsUNCServerShare(path)))
  14.         {
  15.             if ((flags & PRF_FIRSTDIRDEF) == 0)
  16.                 Func7C95C607(path, dirs[0], 0);
  17.             else
  18.                 Func7C95C607(path, NULL, 0);
  19.         }
  20.  
  21.         if (flags & PRF_VERIFYEXISTS)
  22.             return PathFileExistsAndAttributesW(path, NULL);
  23.         return TRUE;
  24.     }
  25.     else if (PathIsFileSpecW(path))
  26.     {
  27.         if ((flags & PRF_TRYPROGRAMEXTENSIONS) && Func7C903F7F(path, dirs, TRUE, uExtensions))
  28.             return TRUE;
  29.  
  30.         if (PathFindOnPathW(path, dirs))
  31.         {
  32.             if (!(flags & PRF_REQUIREABSOLUTE))
  33.                 return TRUE;
  34.  
  35.             if (!Func7C8FF2D3(path))
  36.             {
  37.                 if (!Func7C9A5238(path))
  38.                     return FALSE;
  39.                 return PathFileExistsAndAttributesW(path, NULL);
  40.             }
  41.         }
  42.     }
  43.     else if (!PathIsURLW(path))
  44.     {
  45.         if (flags & PRF_FIRSTDIRDEF)
  46.             Func7C95C607(path, *dirs, 1);
  47.         else
  48.             Func7C95C607(path, NULL, 1);
  49.  
  50.         if (flags & PRF_TRYPROGRAMEXTENSIONS)
  51.         {
  52.             if (Func7C903F7F(path, dirs, FALSE, uExtensions))
  53.                 return PathFileExistsAndAttributesW(path, NULL);
  54.         }
  55.         else
  56.         {
  57.             if (!PathFileExistsAndAttributesW(path, NULL))
  58.                 return FALSE;
  59.         }
  60.  
  61.         if (flags & PRF_REQUIREABSOLUTE)
  62.         {
  63.             if (!Func7C8FF2D3(path))
  64.             {
  65.                 if (!Func7C9A5238(path))
  66.                     return FALSE;
  67.                 return PathFileExistsAndAttributesW(path, NULL);
  68.             }
  69.         }
  70.  
  71.         return TRUE;
  72.     }
  73.  
  74.     return FALSE;
  75. }
  76.  

Editor

You can edit this paste and save as new: