{"record":{"id":"8c3e418df3aaccc4","repo":"peass-ng/PEASS-ng","slug":"path-is-greater-than-0-characters-1","errorCode":null,"errorMessage":"Path is greater than {0} characters: {1}","messagePattern":"Path is greater than (.+?) characters: (.+?)","errorType":"exception","errorClass":"PathTooLongException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.GetCurrentDirectory.cs","lineNumber":62,"sourceCode":"      /// <returns>The path of the current working directory without a trailing directory separator.</returns>\n      [SuppressMessage(\"Microsoft.Design\", \"CA1024:UsePropertiesWhereAppropriate\"), SecurityCritical]\n      public static string GetCurrentDirectory()\n      {\n         var nameBuffer = new StringBuilder(NativeMethods.MaxPathUnicode);\n\n         // GetCurrentDirectory()\n         // 2016-09-29: MSDN does not confirm LongPath usage but a Unicode version of this function exists.\n         // 2017-05-30: MSDN confirms LongPath usage: Starting with Windows 10, version 1607\n         // 2018-01-15: MSDN confirmation is gone?\n\n         var folderNameLength = NativeMethods.GetCurrentDirectory((uint) nameBuffer.Capacity, nameBuffer);\n         var lastError = Marshal.GetLastWin32Error();\n\n         if (folderNameLength == 0)\n            NativeError.ThrowException(lastError);\n\n         if (folderNameLength > NativeMethods.MaxPathUnicode)\n            throw new PathTooLongException(string.Format(CultureInfo.InvariantCulture, \"Path is greater than {0} characters: {1}\", NativeMethods.MaxPathUnicode, folderNameLength));\n\n         return nameBuffer.ToString();\n      }\n   }\n}\n","sourceCodeStart":44,"sourceCodeEnd":68,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.GetCurrentDirectory.cs#L44-L68","documentation":"Thrown by the AlphaFS NativeMethods error mapper when the Win32 GetCurrentDirectory call reports a buffer/length failure: the returned working directory path exceeds the maximum character limit (MaxPathUnicode) the buffer was sized for. It fires when the process current directory is a very long path, typically on systems without long-path support enabled.","triggerScenarios":"Thrown at winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.GetCurrentDirectory.cs:62 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Shorten or relocate the current directory so the full path stays under the Unicode max path limit","Enable Windows 10 long-path support (group policy / manifest longPathAware) so >260 char paths are accepted","Use absolute paths from a shorter anchor directory instead of relying on a very long current directory"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"53fb989abc2219826385683a6fee826bd6cd38d6","analyzedAt":"2026-09-02T04:25:09.259Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}