标题：max_path
delphi 中的 MAX_PATH

在delphi中的Windows单元也定义了一个同样意义的常量，该常量代表 Windows 允许路径的最大长度。这样系统性的约定好长度，就不会造成不必要的麻烦。定义方式如下代码所示：
unit Windows;
{$ALIGN ON}
{$MINENUMSIZE 4}
{$WEAKPACKAGEUNIT}
{$IFDEF LINUX}
{$DEFINE LINUXCRITSECTION}
{$ENDIF}
interface
uses Types{$IFDEF LINUX}, Libc {$ENDIF};
(*$HPPEMIT '// WINVER check BEGIN ' *)
(*$HPPEMIT '#if (WINVER < 0x0400)' *)
(*$HPPEMIT '#error WINVER < 0x0400' *)
(*$HPPEMIT '#endif' *)
(*$HPPEMIT '// WINVER check END. ' *)
(*$HPPEMIT '' *)
(*$HPPEMIT '// WIN2K SDK fixes BEGIN ' *)
(*$HPPEMIT '#ifndef WINTRUST_H' *)
(*$HPPEMIT '#include<wintrust.h>' *)
(*$HPPEMIT '#endif' *)
(*$HPPEMIT '// WIN2K SDK fixes END. ' *)
(*$HPPEMIT '//' *)
(*$HPPEMIT '// WINDOWS provides two definitions of BLOB: wtypes.h defines a' *)
(*$HPPEMIT '// BLOB as a tagBLOB struct whereas nspapi.h defines a BLOB as a _BLOB' *)
(*$HPPEMIT '// struct. Unfortunately, VCL does not use the portable BLOB type but' *)
(*$HPPEMIT '// rather relies on tagBLOB. So here we use a kludge to try to determine' *)
(*$HPPEMIT '// which flavour of BLOB we have (which is determined by the order of header' *)
(*$HPPEMIT '// inclusion by the compilation unit). If it is the _BLOB, we expose the' *)
(*$HPPEMIT '// tagBLOB type for VCL.' *)
(*$HPPEMIT '//' *)
(*$HPPEMIT '#if sizeof(_BLOB) == 8 // We know that BLOB is 8 bytes ' *)
(*$HPPEMIT 'typedef _BLOB tagBLOB; // If unknown, _BLOB would be 4 ' *)
(*$HPPEMIT '#endif // tagBLOB Kludge' *)
(*$HPPEMIT '#if sizeof(tagBLOB) == 4 // tagBLOB has probably not been defined yet' *)
(*$HPPEMIT '#ifndef _tagBLOB_DEFINED' *)
(*$HPPEMIT '#define _tagBLOB_DEFINED' *)
(*$HPPEMIT '#define _BLOB_DEFINED' *)
(*$HPPEMIT '#define _LPBLOB_DEFINED' *)
(*$HPPEMIT 'typedef struct tagBLOB' *)
(*$HPPEMIT ' {' *)
(*$HPPEMIT ' ULONG cbSize;' *)
(*$HPPEMIT ' /* [size_is] */ BYTE __RPC_FAR *pBlobData;' *)
(*$HPPEMIT ' } BLOB;' *)
(*$HPPEMIT '' *)
(*$HPPEMIT 'typedef struct tagBLOB __RPC_FAR *LPBLOB;' *)
(*$HPPEMIT '#endif // _tagBLOB_DEFINED' *)
(*$HPPEMIT '#endif // sizeof(tagBLOB) == 4' *)
(*$HPPEMIT '' *)
(*$HPPEMIT '#if defined(WIN32_LEAN_AND_MEAN) && !defined(_DDEHEADER_INCLUDED_)' *)
(*$HPPEMIT '#include <dde.h>' *)
(*$HPPEMIT '#endif // WIN32_LEAN_AND_MEAN & _DDEHEADER_INCLUDED_' *)
(*$HPPEMIT '' *)
(*$HPPEMIT 'namespace Windows {'*)
(*$HPPEMIT 'typedef _LARGE_INTEGER TLargeInteger;'*)
(*$HPPEMIT ''*)
(*$HPPEMIT '#if (WINVER >= 0x0500)'*)
(*$HPPEMIT 'typedef BITMAPV5HEADER *PBitmapV5Header;'*)
(*$HPPEMIT 'typedef BITMAPV5HEADER TBitmapV5Header;'*)
(*$HPPEMIT 'typedef tagEMRGRADIENTFILL *PEMGradientFill;'*)
(*$HPPEMIT 'typedef tagEMRGRADIENTFILL TEMGradientFill;'*)
(*$HPPEMIT 'typedef tagEMRALPHABLEND *PEMRAlphaBlend;'*)
(*$HPPEMIT 'typedef tagEMRALPHABLEND TEMRAlphaBlend;'*)
(*$HPPEMIT 'typedef tagEMRTRANSPARENTBLT *PEMRTransparentBLT;'*)
(*$HPPEMIT 'typedef tagEMRTRANSPARENTBLT TEMRTransparentBLT;'*)
(*$HPPEMIT 'typedef _WGLSWAP *PWGLSwap;'*)
(*$HPPEMIT 'typedef _WGLSWAP TWGLSwap;'*)
(*$HPPEMIT 'typedef tagMOUSEMOVEPOINT *PMouseMovePoint;'*)
(*$HPPEMIT 'typedef tagMOUSEMOVEPOINT TMouseMovePoint;'*)
(*$HPPEMIT 'typedef FLASHWINFO TFlashWInfo;'*)
(*$HPPEMIT 'typedef tagMENUINFO *PMenuInfo;'*)
(*$HPPEMIT 'typedef tagMENUINFO TMenuInfo;'*)
(*$HPPEMIT 'typedef tagMENUGETOBJECTINFO *PMenuGetObjectInfo;'*)
(*$HPPEMIT 'typedef tagMENUGETOBJECTINFO TMenuGetObjectInfo;'*)
(*$HPPEMIT 'typedef tagGUITHREADINFO *PGUIThreadInfo;'*)
(*$HPPEMIT 'typedef tagGUITHREADINFO TGUIThreadInfo;'*)
(*$HPPEMIT 'typedef tagCURSORINFO *PCursorInfo;'*)
(*$HPPEMIT 'typedef tagCURSORINFO TCursorInfo;'*)
(*$HPPEMIT 'typedef tagWINDOWINFO *PWindowInfo;'*)
(*$HPPEMIT 'typedef tagWINDOWINFO TWindowInfo;'*)
(*$HPPEMIT 'typedef tagTITLEBARINFO *PTitleBarInfo;'*)
(*$HPPEMIT 'typedef tagTITLEBARINFO TTitleBarInfo;'*)
(*$HPPEMIT 'typedef tagMENUBARINFO *PMenuBarInfo;'*)
(*$HPPEMIT 'typedef tagMENUBARINFO TMenuBarInfo;'*)
(*$HPPEMIT 'typedef tagSCROLLBARINFO *PScrollBarInfo;'*)
(*$HPPEMIT 'typedef tagSCROLLBARINFO TScrollBarInfo;'*)
(*$HPPEMIT 'typedef tagCOMBOBOXINFO *PComboBoxInfo;'*)
(*$HPPEMIT 'typedef tagCOMBOBOXINFO TComboBoxInfo;'*)
(*$HPPEMIT 'typedef tagALTTABINFO *PAltTabInfo;'*)
(*$HPPEMIT 'typedef tagALTTABINFO TAltTabInfo;'*)
(*$HPPEMIT '#endif'*)
(*$HPPEMIT ''*)
(*$HPPEMIT '} // namespace Windows'*)
(*$HPPEMIT ''*)
type
{ Translated from WINDEF.H }
WCHAR = WideChar;
{$EXTERNALSYM WCHAR}
PWChar = PWideChar;
LPSTR = PAnsiChar;
{$EXTERNALSYM LPSTR}
PLPSTR = ^LPSTR;
{$EXTERNALSYM PLPSTR}
LPCSTR = PAnsiChar;
{$EXTERNALSYM LPCSTR}
LPCTSTR = PAnsiChar;
{$EXTERNALSYM LPCTSTR}
LPTSTR = PAnsiChar;
{$EXTERNALSYM LPTSTR}
LPWSTR = PWideChar;
{$EXTERNALSYM LPWSTR}
PLPWSTR = ^LPWSTR;
{$EXTERNALSYM PLPWSTR}
LPCWSTR = PWideChar;
{$EXTERNALSYM LPCWSTR}
DWORD = Types.DWORD;
{$EXTERNALSYM DWORD}
BOOL = LongBool;
{$EXTERNALSYM BOOL}
PBOOL = ^BOOL;
{$EXTERNALSYM PBOOL}
PByte = Types.PByte;
PINT = ^Integer;
{$EXTERNALSYM PINT}
PSingle = ^Single;
PWORD = ^Word;
{$EXTERNALSYM PWORD}
PDWORD = ^DWORD;
{$EXTERNALSYM PDWORD}
LPDWORD = PDWORD;
{$EXTERNALSYM LPDWORD}
UCHAR = Byte;
{$EXTERNALSYM UCHAR}
PUCHAR = ^Byte;
{$EXTERNALSYM PUCHAR}
SHORT = Smallint;
{$EXTERNALSYM SHORT}
UINT = LongWord;
{$EXTERNALSYM UINT}
PUINT = ^UINT;
{$EXTERNALSYM PUINT}
ULONG = Cardinal;
{$EXTERNALSYM ULONG}
PULONG = ^ULONG;
{$EXTERNALSYM PULONG}
PLongint = System.PLongint;
{$EXTERNALSYM PLongint}
PInteger = System.PInteger;
{$EXTERNALSYM PInteger}
PLongWord = System.PLongWord;
{$EXTERNALSYM PLongWord}
PSmallInt = System.PSmallInt;
{$EXTERNALSYM PSmallInt}
PDouble = System.PDouble;
{$EXTERNALSYM PDouble}
PShortInt = System.PShortInt;
{$EXTERNALSYM PShortInt}
LCID = DWORD;
{$EXTERNALSYM LCID}
LANGID = Word;
{$EXTERNALSYM LANGID}
THandle = System.THandle;
PHandle = ^THandle;
// From BaseTsd.h
INT_PTR = Integer;
{$EXTERNALSYM INT_PTR}
LONG_PTR = Integer;
{$EXTERNALSYM LONG_PTR}
UINT_PTR = Cardinal;
{$EXTERNALSYM UINT_PTR}
ULONG_PTR = Cardinal;
{$EXTERNALSYM ULONG_PTR}
DWORD_PTR = ULONG_PTR;
{$EXTERNALSYM DWORD_PTR}
const
MAX_PATH = 260;
{$EXTERNALSYM MAX_PATH}