Mercurial > mplayer.hg
annotate loader/ext.c @ 2623:0d8f8d313f9c
fixed fault with --help
author | alex |
---|---|
date | Fri, 02 Nov 2001 02:21:57 +0000 |
parents | ce45cce7f7a5 |
children | 958d10763c34 |
rev | line source |
---|---|
1 | 1 /******************************************************** |
2 * | |
3 * | |
4 * Stub functions for Wine module | |
5 * | |
6 * | |
7 ********************************************************/ | |
8 #include <config.h> | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
9 #include <stdio.h> |
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
10 #include <stdlib.h> |
1 | 11 #ifdef HAVE_MALLOC_H |
12 #include <malloc.h> | |
13 #endif | |
14 #include <unistd.h> | |
15 #include <sys/mman.h> | |
16 #include <errno.h> | |
17 #include <fcntl.h> | |
18 #include <string.h> | |
19 #include <stdarg.h> | |
20 #include <wine/windef.h> | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
21 #include <wine/winbase.h> |
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
22 #include <wine/debugtools.h> |
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
23 #include <wine/heap.h> |
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
24 #include "ext.h" |
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
25 |
1 | 26 int dbg_header_err( const char *dbg_channel, const char *func ) |
27 { | |
28 return 0; | |
29 } | |
30 int dbg_header_warn( const char *dbg_channel, const char *func ) | |
31 { | |
32 return 0; | |
33 } | |
34 int dbg_header_fixme( const char *dbg_channel, const char *func ) | |
35 { | |
36 return 0; | |
37 } | |
38 int dbg_header_trace( const char *dbg_channel, const char *func ) | |
39 { | |
40 return 0; | |
41 } | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
42 int dbg_vprintf( const char *format, va_list args ) |
1 | 43 { |
44 return 0; | |
45 } | |
46 int __vprintf( const char *format, ... ) | |
47 { | |
48 #ifdef DETAILED_OUT | |
49 va_list va; | |
50 va_start(va, format); | |
51 vprintf(format, va); | |
52 va_end(va); | |
53 #endif | |
54 return 0; | |
55 } | |
56 | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
57 HANDLE WINAPI GetProcessHeap(void) |
1 | 58 { |
59 return 1; | |
60 } | |
61 | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
62 LPVOID WINAPI HeapAlloc(HANDLE heap, DWORD flags, DWORD size) |
1 | 63 { |
64 if(flags & 0x8) | |
65 return calloc(size, 1); | |
66 else | |
67 return malloc(size); | |
68 } | |
69 | |
2069 | 70 WIN_BOOL WINAPI HeapFree(HANDLE heap, DWORD flags, LPVOID mem) |
1 | 71 { |
128 | 72 if (mem) free(mem); |
1 | 73 return 1; |
74 } | |
75 | |
76 static int last_error; | |
77 | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
78 DWORD WINAPI GetLastError(void) |
1 | 79 { |
80 return last_error; | |
81 } | |
82 | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
83 VOID WINAPI SetLastError(DWORD error) |
1 | 84 { |
2069 | 85 last_error=error; |
1 | 86 } |
87 | |
2069 | 88 WIN_BOOL WINAPI ReadFile(HANDLE handle, LPVOID mem, DWORD size, LPDWORD result, LPOVERLAPPED flags) |
1 | 89 { |
90 *result=read(handle, mem, size); | |
91 return *result; | |
92 } | |
2069 | 93 INT WINAPI lstrcmpiA(LPCSTR c1, LPCSTR c2) |
1 | 94 { |
95 return strcasecmp(c1,c2); | |
96 } | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
97 LPSTR WINAPI lstrcpynA(LPSTR dest, LPCSTR src, INT num) |
1 | 98 { |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
99 return strncpy(dest,src,num); |
1 | 100 } |
2069 | 101 INT WINAPI lstrlenA(LPCSTR s) |
1 | 102 { |
103 return strlen(s); | |
104 } | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
105 INT WINAPI lstrlenW(LPCWSTR s) |
1 | 106 { |
107 int l; | |
108 if(!s) | |
109 return 0; | |
110 l=0; | |
111 while(s[l]) | |
112 l++; | |
113 return l; | |
114 } | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
115 LPSTR WINAPI lstrcpynWtoA(LPSTR dest, LPCWSTR src, INT count) |
1 | 116 { |
2069 | 117 LPSTR result = dest; |
1 | 118 int moved=0; |
119 if((dest==0) || (src==0)) | |
120 return 0; | |
121 while(moved<count) | |
122 { | |
123 *dest=*src; | |
124 moved++; | |
125 if(*src==0) | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
126 break; |
1 | 127 src++; |
128 dest++; | |
129 } | |
2069 | 130 return result; |
1 | 131 } |
132 int wcsnicmp(const unsigned short* s1, const unsigned short* s2, int n) | |
133 { | |
2069 | 134 /* |
1 | 135 if(s1==0) |
136 return; | |
137 if(s2==0) | |
138 return; | |
2069 | 139 */ |
1 | 140 while(n>0) |
141 { | |
142 if(*s1<*s2) | |
143 return -1; | |
144 else | |
145 if(*s1>*s2) | |
146 return 1; | |
147 else | |
148 if(*s1==0) | |
149 return 0; | |
150 s1++; | |
151 s2++; | |
152 n--; | |
153 } | |
154 return 0; | |
155 } | |
156 | |
157 | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
158 WIN_BOOL WINAPI IsBadReadPtr(LPCVOID data, UINT size) |
1 | 159 { |
160 if(size==0) | |
161 return 0; | |
162 if(data==NULL) | |
163 return 1; | |
164 return 0; | |
165 } | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
166 LPSTR HEAP_strdupA(HANDLE heap, DWORD flags, LPCSTR string) |
1 | 167 { |
168 // return strdup(string); | |
169 char* answ=malloc(strlen(string)+1); | |
170 strcpy(answ, string); | |
171 return answ; | |
172 } | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
173 LPWSTR HEAP_strdupAtoW(HANDLE heap, DWORD flags, LPCSTR string) |
1 | 174 { |
175 int size, i; | |
176 short* answer; | |
177 if(string==0) | |
178 return 0; | |
179 size=strlen(string); | |
180 answer=malloc(size+size+2); | |
181 for(i=0; i<=size; i++) | |
182 answer[i]=(short)string[i]; | |
183 return answer; | |
184 } | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
185 LPSTR HEAP_strdupWtoA(HANDLE heap, DWORD flags, LPCWSTR string) |
1 | 186 { |
187 int size, i; | |
188 char* answer; | |
189 if(string==0) | |
190 return 0; | |
191 size=0; | |
192 while(string[size]) | |
193 size++; | |
194 answer=malloc(size+2); | |
195 for(i=0; i<=size; i++) | |
196 answer[i]=(char)string[i]; | |
197 return answer; | |
198 } | |
199 | |
200 /*********************************************************************** | |
201 * FILE_dommap | |
202 */ | |
203 | |
204 //#define MAP_PRIVATE | |
205 //#define MAP_SHARED | |
206 #undef MAP_ANON | |
207 LPVOID FILE_dommap( int unix_handle, LPVOID start, | |
208 DWORD size_high, DWORD size_low, | |
209 DWORD offset_high, DWORD offset_low, | |
210 int prot, int flags ) | |
211 { | |
212 int fd = -1; | |
213 int pos; | |
214 LPVOID ret; | |
215 | |
216 if (size_high || offset_high) | |
217 printf("offsets larger than 4Gb not supported\n"); | |
218 | |
219 if (unix_handle == -1) | |
220 { | |
221 #ifdef MAP_ANON | |
222 // printf("Anonymous\n"); | |
223 flags |= MAP_ANON; | |
224 #else | |
225 static int fdzero = -1; | |
226 | |
227 if (fdzero == -1) | |
228 { | |
229 if ((fdzero = open( "/dev/zero", O_RDONLY )) == -1) | |
230 { | |
231 perror( "/dev/zero: open" ); | |
232 exit(1); | |
233 } | |
234 } | |
235 fd = fdzero; | |
236 #endif /* MAP_ANON */ | |
237 /* Linux EINVAL's on us if we don't pass MAP_PRIVATE to an anon mmap */ | |
238 #ifdef MAP_SHARED | |
239 flags &= ~MAP_SHARED; | |
240 #endif | |
241 #ifdef MAP_PRIVATE | |
242 flags |= MAP_PRIVATE; | |
243 #endif | |
244 } | |
245 else fd = unix_handle; | |
246 // printf("fd %x, start %x, size %x, pos %x, prot %x\n",fd,start,size_low, offset_low, prot); | |
247 // if ((ret = mmap( start, size_low, prot, | |
248 // flags, fd, offset_low )) != (LPVOID)-1) | |
249 if ((ret = mmap( start, size_low, prot, | |
250 MAP_PRIVATE | MAP_FIXED, fd, offset_low )) != (LPVOID)-1) | |
251 { | |
252 // printf("address %08x\n", *(int*)ret); | |
253 // printf("%x\n", ret); | |
254 return ret; | |
255 } | |
256 | |
257 // printf("mmap %d\n", errno); | |
258 | |
259 /* mmap() failed; if this is because the file offset is not */ | |
260 /* page-aligned (EINVAL), or because the underlying filesystem */ | |
261 /* does not support mmap() (ENOEXEC), we do it by hand. */ | |
262 | |
263 if (unix_handle == -1) return ret; | |
264 if ((errno != ENOEXEC) && (errno != EINVAL)) return ret; | |
265 if (prot & PROT_WRITE) | |
266 { | |
267 /* We cannot fake shared write mappings */ | |
268 #ifdef MAP_SHARED | |
269 if (flags & MAP_SHARED) return ret; | |
270 #endif | |
271 #ifdef MAP_PRIVATE | |
272 if (!(flags & MAP_PRIVATE)) return ret; | |
273 #endif | |
274 } | |
275 /* printf( "FILE_mmap: mmap failed (%d), faking it\n", errno );*/ | |
276 /* Reserve the memory with an anonymous mmap */ | |
277 ret = FILE_dommap( -1, start, size_high, size_low, 0, 0, | |
278 PROT_READ | PROT_WRITE, flags ); | |
279 if (ret == (LPVOID)-1) | |
280 // { | |
281 // perror( | |
282 return ret; | |
283 /* Now read in the file */ | |
284 if ((pos = lseek( fd, offset_low, SEEK_SET )) == -1) | |
285 { | |
286 FILE_munmap( ret, size_high, size_low ); | |
287 // printf("lseek\n"); | |
288 return (LPVOID)-1; | |
289 } | |
290 read( fd, ret, size_low ); | |
291 lseek( fd, pos, SEEK_SET ); /* Restore the file pointer */ | |
292 mprotect( ret, size_low, prot ); /* Set the right protection */ | |
293 // printf("address %08x\n", *(int*)ret); | |
294 return ret; | |
295 } | |
296 | |
297 | |
298 /*********************************************************************** | |
299 * FILE_munmap | |
300 */ | |
301 int FILE_munmap( LPVOID start, DWORD size_high, DWORD size_low ) | |
302 { | |
303 if (size_high) | |
304 printf("offsets larger than 4Gb not supported\n"); | |
305 return munmap( start, size_low ); | |
306 } | |
307 static int mapping_size=0; | |
308 | |
309 struct file_mapping_s; | |
310 typedef struct file_mapping_s | |
311 { | |
312 int mapping_size; | |
313 char* name; | |
2069 | 314 LPVOID handle; |
1 | 315 struct file_mapping_s* next; |
316 struct file_mapping_s* prev; | |
317 }file_mapping; | |
318 static file_mapping* fm=0; | |
319 | |
320 | |
321 | |
322 #define PAGE_NOACCESS 0x01 | |
323 #define PAGE_READONLY 0x02 | |
324 #define PAGE_READWRITE 0x04 | |
325 #define PAGE_WRITECOPY 0x08 | |
326 #define PAGE_EXECUTE 0x10 | |
327 #define PAGE_EXECUTE_READ 0x20 | |
328 #define PAGE_EXECUTE_READWRITE 0x40 | |
329 #define PAGE_EXECUTE_WRITECOPY 0x80 | |
330 #define PAGE_GUARD 0x100 | |
331 #define PAGE_NOCACHE 0x200 | |
332 | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
333 HANDLE WINAPI CreateFileMappingA(HANDLE handle, LPSECURITY_ATTRIBUTES lpAttr, |
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
334 DWORD flProtect, |
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
335 DWORD dwMaxHigh, DWORD dwMaxLow, |
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
336 LPCSTR name) |
1 | 337 { |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
338 int hFile = (int)handle; |
1 | 339 unsigned int len; |
2069 | 340 LPVOID answer; |
1 | 341 int anon=0; |
342 int mmap_access=0; | |
343 if(hFile<0) | |
344 { | |
345 anon=1; | |
346 hFile=open("/dev/zero", O_RDWR); | |
347 if(hFile<0) | |
348 return 0; | |
349 } | |
350 if(!anon) | |
351 { | |
352 len=lseek(hFile, 0, SEEK_END); | |
353 lseek(hFile, 0, SEEK_SET); | |
354 } | |
355 else len=dwMaxLow; | |
356 | |
357 if(flProtect & PAGE_READONLY) | |
358 mmap_access |=PROT_READ; | |
359 else | |
360 mmap_access |=PROT_READ|PROT_WRITE; | |
361 | |
2069 | 362 answer=mmap(NULL, len, mmap_access, MAP_PRIVATE, hFile, 0); |
1 | 363 if(anon) |
364 close(hFile); | |
2069 | 365 if(answer!=(LPVOID)-1) |
1 | 366 { |
367 if(fm==0) | |
368 { | |
369 fm=malloc(sizeof(file_mapping)); | |
370 fm->prev=NULL; | |
371 } | |
372 else | |
373 { | |
374 fm->next=malloc(sizeof(file_mapping)); | |
375 fm->next->prev=fm; | |
376 fm=fm->next; | |
377 } | |
378 fm->next=NULL; | |
379 fm->handle=answer; | |
380 if(name) | |
381 { | |
382 fm->name=malloc(strlen(name)+1); | |
383 strcpy(fm->name, name); | |
384 } | |
385 else | |
386 fm->name=NULL; | |
387 fm->mapping_size=len; | |
388 | |
389 if(anon) | |
390 close(hFile); | |
2069 | 391 return (HANDLE)answer; |
1 | 392 } |
393 return (HANDLE)0; | |
394 } | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
395 WIN_BOOL WINAPI UnmapViewOfFile(LPVOID handle) |
1 | 396 { |
397 file_mapping* p; | |
398 int result; | |
399 if(fm==0) | |
2069 | 400 return 0; |
1 | 401 for(p=fm; p; p=p->next) |
402 { | |
2069 | 403 if(p->handle==handle) |
1 | 404 { |
405 result=munmap((void*)handle, p->mapping_size); | |
406 if(p->next)p->next->prev=p->prev; | |
407 if(p->prev)p->prev->next=p->next; | |
408 if(p->name) | |
409 free(p->name); | |
410 if(p==fm) | |
411 fm=p->prev; | |
412 free(p); | |
413 return result; | |
414 } | |
415 } | |
416 return 0; | |
417 } | |
418 //static int va_size=0; | |
419 struct virt_alloc_s; | |
420 typedef struct virt_alloc_s | |
421 { | |
422 int mapping_size; | |
423 char* address; | |
424 struct virt_alloc_s* next; | |
425 struct virt_alloc_s* prev; | |
426 int state; | |
427 }virt_alloc; | |
428 static virt_alloc* vm=0; | |
429 #define MEM_COMMIT 0x00001000 | |
430 #define MEM_RESERVE 0x00002000 | |
431 | |
2069 | 432 LPVOID WINAPI VirtualAlloc(LPVOID address, DWORD size, DWORD type, DWORD protection) |
1 | 433 { |
434 void* answer; | |
435 int fd=open("/dev/zero", O_RDWR); | |
436 size=(size+0xffff)&(~0xffff); | |
437 // printf("VirtualAlloc(0x%08X, %d)\n", address | |
438 if(address!=0) | |
439 { | |
440 //check whether we can allow to allocate this | |
441 virt_alloc* str=vm; | |
442 while(str) | |
443 { | |
444 if((unsigned)address>=(unsigned)str->address+str->mapping_size) | |
445 { | |
446 str=str->prev; | |
447 continue; | |
448 } | |
449 if((unsigned)address+size<(unsigned)str->address) | |
450 { | |
451 str=str->prev; | |
452 continue; | |
453 } | |
454 if(str->state==0) | |
455 { | |
456 #warning FIXME | |
457 if(((unsigned)address+size<(unsigned)str->address+str->mapping_size) && (type & MEM_COMMIT)) | |
458 { | |
459 close(fd); | |
460 return address; //returning previously reserved memory | |
461 } | |
462 return NULL; | |
463 } | |
464 close(fd); | |
465 return NULL; | |
466 } | |
467 answer=mmap(address, size, PROT_READ | PROT_WRITE | PROT_EXEC, | |
468 MAP_FIXED | MAP_PRIVATE, fd, 0); | |
469 } | |
470 else | |
471 answer=mmap(address, size, PROT_READ | PROT_WRITE | PROT_EXEC, | |
472 MAP_PRIVATE, fd, 0); | |
473 // answer=FILE_dommap(-1, address, 0, size, 0, 0, | |
474 // PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE); | |
475 close(fd); | |
476 if(answer==(void*)-1) | |
477 { | |
478 printf("Error no %d\n", errno); | |
2069 | 479 printf("VirtualAlloc(0x%p, %ld) failed\n", address, size); |
1 | 480 return NULL; |
481 } | |
482 else | |
483 { | |
484 virt_alloc *new_vm=malloc(sizeof(virt_alloc)); | |
485 new_vm->mapping_size=size; | |
486 new_vm->address=answer; | |
487 new_vm->prev=vm; | |
488 if(type == MEM_RESERVE) | |
489 new_vm->state=0; | |
490 else | |
491 new_vm->state=1; | |
492 if(vm) | |
493 vm->next=new_vm; | |
494 vm=new_vm; | |
495 vm->next=0; | |
496 // if(va_size!=0) | |
497 // printf("Multiple VirtualAlloc!\n"); | |
498 // printf("answer=0x%08x\n", answer); | |
499 return answer; | |
500 } | |
501 } | |
2069 | 502 WIN_BOOL WINAPI VirtualFree(LPVOID address, DWORD t1, DWORD t2)//not sure |
1 | 503 { |
504 virt_alloc* str=vm; | |
505 int answer; | |
506 while(str) | |
507 { | |
508 if(address!=str->address) | |
509 { | |
510 str=str->prev; | |
511 continue; | |
512 } | |
513 answer=munmap(str->address, str->mapping_size); | |
514 if(str->next)str->next->prev=str->prev; | |
515 if(str->prev)str->prev->next=str->next; | |
516 if(vm==str)vm=0; | |
517 free(str); | |
518 return 0; | |
519 } | |
520 return -1; | |
521 } | |
522 | |
2069 | 523 INT WINAPI WideCharToMultiByte(UINT codepage, DWORD flags, LPCWSTR src, |
524 INT srclen,LPSTR dest, INT destlen, LPCSTR defch, WIN_BOOL* used_defch) | |
1 | 525 { |
526 int i; | |
527 if(src==0) | |
528 return 0; | |
2069 | 529 if ((srclen==-1)&&(dest==0)) return 0; |
128 | 530 if(srclen==-1){srclen=0; while(src[srclen++]);} |
531 // for(i=0; i<srclen; i++) | |
532 // printf("%c", src[i]); | |
533 // printf("\n"); | |
1 | 534 if(dest==0) |
535 { | |
536 for(i=0; i<srclen; i++) | |
537 { | |
538 src++; | |
539 if(*src==0) | |
540 return i+1; | |
541 } | |
542 return srclen+1; | |
543 } | |
544 if(used_defch) | |
545 *used_defch=0; | |
546 for(i=0; i<min(srclen, destlen); i++) | |
547 { | |
548 *dest=(char)*src; | |
549 dest++; | |
550 src++; | |
551 if(*src==0) | |
552 return i+1; | |
553 } | |
554 return min(srclen, destlen); | |
555 } | |
2069 | 556 INT WINAPI MultiByteToWideChar(UINT codepage,DWORD flags, LPCSTR src, INT srclen, |
557 LPWSTR dest, INT destlen) | |
1 | 558 { |
559 return 0; | |
560 } | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
128
diff
changeset
|
561 HANDLE WINAPI OpenFileMappingA(DWORD access, WIN_BOOL prot, LPCSTR name) |
1 | 562 { |
563 file_mapping* p; | |
564 if(fm==0) | |
565 return (HANDLE)0; | |
566 if(name==0) | |
567 return (HANDLE)0; | |
568 for(p=fm; p; p=p->prev) | |
569 { | |
570 if(p->name==0) | |
571 continue; | |
572 if(strcmp(p->name, name)==0) | |
2069 | 573 return (HANDLE)p->handle; |
1 | 574 } |
575 return 0; | |
576 } |