Changeset 21944 for trunk/src/user32/oslibdnd.cpp
- Timestamp:
- Jan 18, 2012, 8:15:16 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/oslibdnd.cpp
r21928 r21944 25 25 #include "oslibdnd.h" 26 26 27 static char *pszFile = NULL;28 27 static HWND hwndTarget = 0; 29 28 static PDRAGINFO curDragInfo = NULL; 30 29 static char *pszCurDragData = NULL; 31 30 32 #if 033 FILE *tmpfile;34 tmpfile = fopen(pszFile, "wb+");35 fwrite(lpszDnDString, 1, strlen(lpszDnDString)+1, tmpfile);36 fclose(tmpfile);37 #endif38 31 //****************************************************************************** 39 32 //****************************************************************************** … … 62 55 63 56 char szDir[CCHMAXPATH*4]; 64 65 pszFile = tempnam(0, 0); 66 if(pszFile == NULL) { 67 DebugInt3(); 68 DrgFreeDraginfo(pdinfo); 69 return NULL; 70 } 71 72 strcpy(szDir, pszFile); 73 74 char *tmp = strrchr(szDir, '\\'); 75 if (!tmp) 76 tmp = strrchr(szDir, '/'); 77 if (!tmp) { 78 DebugInt3(); 79 free(pszFile); 80 DrgFreeDraginfo(pdinfo); 81 return NULL; 82 } 83 84 *tmp = 0; 85 tmp++; 86 87 dprintf(("temporary file %s", pszFile)); 88 57 58 const char *pszTmpDir = getenv("TMP"); 59 if (!pszTmpDir) 60 pszTmpDir = getenv("TEMP"); 61 if (!pszTmpDir) 62 pszTmpDir = "."; 63 64 strncpy(szDir, pszTmpDir, sizeof(szDir) - 2); 65 szDir[sizeof(szDir) - 2] = '\0'; // strncpy doesn't ensure this 89 66 strcat(szDir, "\\"); 67 68 dprintf(("temporary dir %s", szDir)); 90 69 91 70 ditem.hwndItem = pdinfo->hwndSource;
Note:
See TracChangeset
for help on using the changeset viewer.