diff options
| author | Miles Bader | 2006-08-16 14:08:49 +0000 |
|---|---|---|
| committer | Miles Bader | 2006-08-16 14:08:49 +0000 |
| commit | de20e0ccdb039a2ac27e5bbd3e06ab70c4e7bb65 (patch) | |
| tree | 80243ce02b52cbf7945c614bd213dd63142b861a /src/w32.c | |
| parent | 7a5c2a42040b12b037940a067aee6ac6fde01680 (diff) | |
| parent | 5ebdc2990a95cc38b21f772eea4de3ceee149e54 (diff) | |
| download | emacs-de20e0ccdb039a2ac27e5bbd3e06ab70c4e7bb65.tar.gz emacs-de20e0ccdb039a2ac27e5bbd3e06ab70c4e7bb65.zip | |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 382-398)
- Update from CVS
- Update from erc--emacs--22
- Fix ERC bug introduced in last patch
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 123-125)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-101
Diffstat (limited to 'src/w32.c')
| -rw-r--r-- | src/w32.c | 22 |
1 files changed, 22 insertions, 0 deletions
| @@ -323,6 +323,28 @@ w32_strerror (int error_no) | |||
| 323 | return buf; | 323 | return buf; |
| 324 | } | 324 | } |
| 325 | 325 | ||
| 326 | /* Return 1 if P is a valid pointer to an object of size SIZE. Return | ||
| 327 | 0 if P is NOT a valid pointer. Return -1 if we cannot validate P. | ||
| 328 | |||
| 329 | This is called from alloc.c:valid_pointer_p. */ | ||
| 330 | int | ||
| 331 | w32_valid_pointer_p (void *p, int size) | ||
| 332 | { | ||
| 333 | SIZE_T done; | ||
| 334 | HANDLE h = OpenProcess (PROCESS_VM_READ, FALSE, GetCurrentProcessId ()); | ||
| 335 | |||
| 336 | if (h) | ||
| 337 | { | ||
| 338 | unsigned char *buf = alloca (size); | ||
| 339 | int retval = ReadProcessMemory (h, p, buf, size, &done); | ||
| 340 | |||
| 341 | CloseHandle (h); | ||
| 342 | return retval; | ||
| 343 | } | ||
| 344 | else | ||
| 345 | return -1; | ||
| 346 | } | ||
| 347 | |||
| 326 | static char startup_dir[MAXPATHLEN]; | 348 | static char startup_dir[MAXPATHLEN]; |
| 327 | 349 | ||
| 328 | /* Get the current working directory. */ | 350 | /* Get the current working directory. */ |