• GetSystemDirectory


    Retrieves the path of the system directory. The system directory contains system files such as dynamic-link libraries and drivers.

    检索文件系统路径。例如包含想动态链接库dll和驱动文件sys这样的系统文件。

    This function is provided primarily for compatibility. Applications should store code in the Program Files folder and persistent data in the Application Data folder in the user's profile. For more information, see ShGetFolderPath.

    这个函数出于兼容性被主要提供。一个可执行程序需要存储一些代码在Program Files 文件夹下面还有一些持久性的数据在用户的个人目录下。

    UINT WINAPI GetSystemDirectory
    (
      _Out_ LPTSTR lpBuffer,
      _In_  UINT   uSize
    );

    Parameters(参数)

    lpBuffer [out]

    A pointer to the buffer to receive the path. This path does not end with a backslash unless the system directory is the root directory. For example, if the system directory is named WindowsSystem32 on drive C, the path of the system directory retrieved by this function is C:WindowsSystem32.

    指向一个接受路径的缓冲区指针。这个路径不会被反斜杠结束,除非系统目录是一个根目录。例如:如果文件目录是一个在C驱动器上面以Windows/System32命名的目录,这个文件系统路径会被这个函数检索成: C:WindowsSystem32.

    uSize [in]

    The maximum size of the buffer, in TCHARs.、

    缓冲区的最大容量。

    Return value(返回值)

    If the function succeeds, the return value is the length, in TCHARs, of the string copied to the buffer, not including the terminating null character. If the length is greater than the size of the buffer, the return value is the size of the buffer required to hold the path, including the terminating null character.

    如果函数执行成功,那么返回一个长度,属于缓冲区里面字符串的长度,不包括以0结尾的字符串。如果长度超过缓冲区,那么返回值是保存路径所需的缓冲区的大小,包括终止空字符。

    Remarks

    Applications should not create files in the system directory. If the user is running a shared version of the operating system, the application does not have write access to the system directory.

    一个程序不应该在文件系统目录创建文件。如果用户运行一个分享版的操作系统,这个程序没有访问文件系统的权限。

  • 相关阅读:
    hdu 5335 Walk Out (搜索)
    Hdu 5336 XYZ and Drops (bfs 模拟)
    Zznu 1913: yifan and matrix (多路归并)
    hdu 5316 Magician (线段树)
    Bzoj 2038: [2009国家集训队]小Z的袜子(hose)
    Poj 1741 Tree (树的分治)
    LightOJ 1027
    1067
    Closest Common Ancestors---poj1470(LCA+离线算法)
    1128
  • 原文地址:https://www.cnblogs.com/DeeLMind/p/6884764.html
Copyright © 2020-2023  润新知