일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- imread
- LSTM
- keras
- 삼성소프트웨어멤버십
- pycharm
- GT-S80
- javascript
- synology
- mean
- Lotto
- ipad
- Numpy
- pandas
- CNN
- GitHub
- Series
- Python
- Splunk
- pip
- SciPy
- SPL
- 알고리즘
- DFS
- mariadb
- E-P1
- Button
- RNN
- index
- install
- dataframe
Archives
- Today
- Total
잠토의 잠망경
시스템 디렉토리와 윈도우 디렉토리를 찾아보자. 본문
아래의 두 함수 GetSystemDirectoryA와 GetWindowsDirectoryA를 사용해야 한다.
#include#include int main(void) { char szSystemDirectoryPath[100]={0,}; //시스템 버버를 저장하기 위한 버퍼 char szDllPath[100]={0,}; // Dll의 경로를 저장하기 위한 버퍼이다. char szWindowsDirectoryPath[100]={0,}; UINT ret = GetSystemDirectoryA(szSystemDirectoryPath,100); // Ansi기준으로 작성된 함수이다. unicode 방식으로 하면 잘못된 결과가 도출된다. sprintf(szDllPath, "%s\\WSock32.dll",szSystemDirectoryPath); //szDllPath를 완성하는 것이다. WSock32.dll을 로드하기 위한 작업으로 보인다. HINSTANCE hInst = LoadLibraryA(szDllPath); //Ansi기준으로 작성된 함수이다. unicode 방식으로 하려면 A대신 W로 붙이면된다. if(hInst == NULL) printf("error\n"); void *pFunc; pFunc = GetProcAddress(hInst,"recv"); printf("0x%x\n",pFunc); //윈도우의 디렉토리를 알고 싶을때 사용하면 된다. GetWindowsDirectoryA(szWindowsDirectoryPath,100); printf(szWindowsDirectoryPath); printf("\n"); return 0; }
Comments