GetSystemDirectory
The GetSystemDirectory function retrieves the path of the system directory. The system directory contains such files as dynamic-link libraries, drivers, and font files.
-> 이 함수는 시스템 디렉토리의 경로를 반환한다. 시스템 디렉토리는 다이나믹하게 연결되어 있는 드라이버나 폰트와 같은 것들을
포함하고 있다.
UINT GetSystemDirectory(
LPTSTR lpBuffer, // buffer for system directory
UINT uSize // size of directory buffer
);
Parameters
- lpBuffer
- [out] Pointer to the buffer to receive the null-terminated string containing 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 Windows\System on drive C, the path of the system directory retrieved by this function is C:\Windows\System.
- -> 예를 들어 시스템 디렉토리가 C안의 Window\System이라면 시스템 디렉토리는 이 함수에 의해 C:\Windows\System경로를 돌려받게 된다.
- uSize
- [in] Specifies the maximum size of the buffer, in TCHARs.
- -> TCHAR의 가장큰 버퍼의 크기이다.
- This value should be set to at least MAX_PATH+1 to allow sufficient space for the path and the null terminator.
- -> 이 값은 적어도 경로+1이되어 NULL이 들어갈 공간을 확보해야한다.
Return Values
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.
-> 이 함수가 성공하면 value는 TCHARs의 글길이며, 버퍼에 null로 끝나는 것이 포함되지 않게 복사한다.
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.
-> 만약 length가 버퍼의 크기보다 더 크다면, 버퍼가 경로를 가질때 필요한 크기를 반환한다.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
-> 이 함수가 실패하면 0을 반환한다. GetLastError를 통해 정보를 볼 수 있다.
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.
-> 응용프로그램은 시스템 디렉토리에 접근하여 쓸 수 없다.
Applications should create files only in the directory returned by the GetWindowsDirectory function.
-> 응용프로그램은 오직 GetWindowsDirectory 함수의 디렉토리에 파일을 생성할 수 있다.
출처 : http://cafe.naver.com/prostudy12.cafe?iframe_url=/ArticleRead.nhn%3Farticleid=101&
'SYSTEM PROGRAMMING' 카테고리의 다른 글
세그먼테이션 (0) | 2015.08.05 |
---|---|
GetModuleHandle 과 LoadLibrary (0) | 2015.08.05 |
구조체사용시 주의사항, 메모리정렬, pragma pack (0) | 2015.08.05 |
TCP 를 구성하는 주요 알고리즘 (0) | 2015.08.05 |
TCP 상태 변화 (0) | 2015.08.05 |