Mercurial > mplayer.hg
comparison loader/win32.c @ 12066:792eec413bd5
Support for Alparysoft lossless video codec (DShow and VfW)
Patch by Melisha Johnson <adland123 (at) yahoo (dot) com>
author | rtognimp |
---|---|
date | Thu, 25 Mar 2004 21:36:18 +0000 |
parents | 937a520811e9 |
children | 6356eb2a11c3 |
comparison
equal
deleted
inserted
replaced
12065:cabb28717cd6 | 12066:792eec413bd5 |
---|---|
494 static int WINAPI ext_unknown() | 494 static int WINAPI ext_unknown() |
495 { | 495 { |
496 printf("Unknown func called\n"); | 496 printf("Unknown func called\n"); |
497 return 0; | 497 return 0; |
498 } | 498 } |
499 | |
500 static int WINAPI expGetVolumeInformationA( const char *root, char *label, | |
501 unsigned int label_len, unsigned int *serial, | |
502 unsigned int *filename_len,unsigned int *flags, | |
503 char *fsname, unsigned int fsname_len ) | |
504 { | |
505 dbgprintf("GetVolumeInformationA( %s, 0x%x, %ld, 0x%x, 0x%x, 0x%x, 0x%x, %ld) => 1\n", | |
506 root,label,label_len,serial,filename_len,flags,fsname,fsname_len); | |
507 //hack Do not return any real data - do nothing | |
508 return 1; | |
509 } | |
510 | |
511 static unsigned int WINAPI expGetDriveTypeA( const char *root ) | |
512 { | |
513 dbgprintf("GetDriveTypeA( %s ) => %d\n",root,DRIVE_FIXED); | |
514 // hack return as Fixed Drive Type | |
515 return DRIVE_FIXED; | |
516 } | |
517 | |
518 static unsigned int WINAPI expGetLogicalDriveStringsA( unsigned int len, char *buffer ) | |
519 { | |
520 dbgprintf("GetLogicalDriveStringsA(%d, 0x%x) => 4\n",len,buffer); | |
521 // hack only have one drive c:\ in this hack | |
522 *buffer++='c'; | |
523 *buffer++=':'; | |
524 *buffer++='\\'; | |
525 *buffer++='\0'; | |
526 *buffer= '\0'; | |
527 return 4; // 1 drive * 4 bytes (includes null) | |
528 } | |
529 | |
499 | 530 |
500 static int WINAPI expIsBadWritePtr(void* ptr, unsigned int count) | 531 static int WINAPI expIsBadWritePtr(void* ptr, unsigned int count) |
501 { | 532 { |
502 int result = (count == 0 || ptr != 0) ? 0 : 1; | 533 int result = (count == 0 || ptr != 0) ? 0 : 1; |
503 dbgprintf("IsBadWritePtr(0x%x, 0x%x) => %d\n", ptr, count, result); | 534 dbgprintf("IsBadWritePtr(0x%x, 0x%x) => %d\n", ptr, count, result); |
1648 #endif | 1679 #endif |
1649 | 1680 |
1650 dbgprintf("GlobalSize(0x%x)\n", amem); | 1681 dbgprintf("GlobalSize(0x%x)\n", amem); |
1651 return size; | 1682 return size; |
1652 } | 1683 } |
1684 | |
1685 static int WINAPI expLoadIconA( long hinstance, char *name ) | |
1686 { | |
1687 dbgprintf("LoadIconA( %ld, 0x%x ) => 1\n",hinstance,name); | |
1688 return 1; | |
1689 } | |
1690 | |
1653 static int WINAPI expLoadStringA(long instance, long id, void* buf, long size) | 1691 static int WINAPI expLoadStringA(long instance, long id, void* buf, long size) |
1654 { | 1692 { |
1655 int result=LoadStringA(instance, id, buf, size); | 1693 int result=LoadStringA(instance, id, buf, size); |
1656 // if(buf) | 1694 // if(buf) |
1657 dbgprintf("LoadStringA(instance 0x%x, id 0x%x, buffer 0x%x, size %d) => %d ( %s )\n", | 1695 dbgprintf("LoadStringA(instance 0x%x, id 0x%x, buffer 0x%x, size %d) => %d ( %s )\n", |
3928 expMoFreeMediaType(dest); | 3966 expMoFreeMediaType(dest); |
3929 my_release(dest); | 3967 my_release(dest); |
3930 return S_OK; | 3968 return S_OK; |
3931 } | 3969 } |
3932 | 3970 |
3971 static int exp_snprintf( char *str, int size, const char *format, ... ) | |
3972 { | |
3973 int x; | |
3974 va_list va; | |
3975 va_start(va, format); | |
3976 x=snprintf(str,size,format,va); | |
3977 dbgprintf("_snprintf( 0x%x, %d, %s, ... ) => %d\n",str,size,format,x); | |
3978 va_end(va); | |
3979 return x; | |
3980 } | |
3933 | 3981 |
3934 #if 0 | 3982 #if 0 |
3935 static int exp_initterm(int v1, int v2) | 3983 static int exp_initterm(int v1, int v2) |
3936 { | 3984 { |
3937 dbgprintf("_initterm(0x%x, 0x%x) => 0\n", v1, v2); | 3985 dbgprintf("_initterm(0x%x, 0x%x) => 0\n", v1, v2); |
3980 { | 4028 { |
3981 // FIXME extract from WINE | 4029 // FIXME extract from WINE |
3982 return NULL; | 4030 return NULL; |
3983 } | 4031 } |
3984 | 4032 |
3985 static int expwsprintfA(char* string, char* format, ...) | 4033 static int expwsprintfA(char* string, const char* format, ...) |
3986 { | 4034 { |
3987 va_list va; | 4035 va_list va; |
3988 int result; | 4036 int result; |
3989 va_start(va, format); | 4037 va_start(va, format); |
3990 result = vsprintf(string, format, va); | 4038 result = vsprintf(string, format, va); |
3995 | 4043 |
3996 static int expsprintf(char* str, const char* format, ...) | 4044 static int expsprintf(char* str, const char* format, ...) |
3997 { | 4045 { |
3998 va_list args; | 4046 va_list args; |
3999 int r; | 4047 int r; |
4000 dbgprintf("sprintf(%s, %s)\n", str, format); | 4048 dbgprintf("sprintf(0x%x, %s)\n", str, format); |
4001 va_start(args, format); | 4049 va_start(args, format); |
4002 r = vsprintf(str, format, args); | 4050 r = vsprintf(str, format, args); |
4003 va_end(args); | 4051 va_end(args); |
4004 return r; | 4052 return r; |
4005 } | 4053 } |
4511 { | 4559 { |
4512 printf("InitCommonControls called!\n"); | 4560 printf("InitCommonControls called!\n"); |
4513 return; | 4561 return; |
4514 } | 4562 } |
4515 | 4563 |
4516 int expRegisterClassA(const void/*WNDCLASSA*/ *wc) | 4564 static int WINAPI expRegisterClassA(const void/*WNDCLASSA*/ *wc) |
4517 { | 4565 { |
4518 dbgprintf("RegisterClassA(%p) => random id\n", wc); | 4566 dbgprintf("RegisterClassA(%p) => random id\n", wc); |
4519 return time(NULL); /* be precise ! */ | 4567 return time(NULL); /* be precise ! */ |
4520 } | 4568 } |
4521 | 4569 |
4522 int expUnregisterClassA(const char *className, HINSTANCE hInstance) | 4570 static int WINAPI expUnregisterClassA(const char *className, HINSTANCE hInstance) |
4523 { | 4571 { |
4524 dbgprintf("UnregisterClassA(%s, %p) => 0\n", className, hInstance); | 4572 dbgprintf("UnregisterClassA(%s, %p) => 0\n", className, hInstance); |
4525 return 0; | 4573 return 0; |
4526 } | 4574 } |
4527 | 4575 |
4654 #define FF(X,Y) \ | 4702 #define FF(X,Y) \ |
4655 {#X, Y, (void*)exp##X}, | 4703 {#X, Y, (void*)exp##X}, |
4656 | 4704 |
4657 struct exports exp_kernel32[]= | 4705 struct exports exp_kernel32[]= |
4658 { | 4706 { |
4707 FF(GetVolumeInformationA,-1) | |
4708 FF(GetDriveTypeA,-1) | |
4709 FF(GetLogicalDriveStringsA,-1) | |
4659 FF(IsBadWritePtr, 357) | 4710 FF(IsBadWritePtr, 357) |
4660 FF(IsBadReadPtr, 354) | 4711 FF(IsBadReadPtr, 354) |
4661 FF(IsBadStringPtrW, -1) | 4712 FF(IsBadStringPtrW, -1) |
4662 FF(IsBadStringPtrA, -1) | 4713 FF(IsBadStringPtrA, -1) |
4663 FF(DisableThreadLibraryCalls, -1) | 4714 FF(DisableThreadLibraryCalls, -1) |
4809 | 4860 |
4810 struct exports exp_msvcrt[]={ | 4861 struct exports exp_msvcrt[]={ |
4811 FF(malloc, -1) | 4862 FF(malloc, -1) |
4812 FF(_initterm, -1) | 4863 FF(_initterm, -1) |
4813 FF(__dllonexit, -1) | 4864 FF(__dllonexit, -1) |
4865 FF(_snprintf,-1) | |
4814 FF(free, -1) | 4866 FF(free, -1) |
4815 {"??3@YAXPAX@Z", -1, expdelete}, | 4867 {"??3@YAXPAX@Z", -1, expdelete}, |
4816 {"??2@YAPAXI@Z", -1, expnew}, | 4868 {"??2@YAPAXI@Z", -1, expnew}, |
4817 {"_adjust_fdiv", -1, (void*)&_adjust_fdiv}, | 4869 {"_adjust_fdiv", -1, (void*)&_adjust_fdiv}, |
4818 FF(strrchr, -1) | 4870 FF(strrchr, -1) |
4876 FF(timeEndPeriod, -1) | 4928 FF(timeEndPeriod, -1) |
4877 FF(waveOutGetNumDevs, -1) | 4929 FF(waveOutGetNumDevs, -1) |
4878 #endif | 4930 #endif |
4879 }; | 4931 }; |
4880 struct exports exp_user32[]={ | 4932 struct exports exp_user32[]={ |
4933 FF(LoadIconA,-1) | |
4881 FF(LoadStringA, -1) | 4934 FF(LoadStringA, -1) |
4882 FF(wsprintfA, -1) | 4935 FF(wsprintfA, -1) |
4883 FF(GetDC, -1) | 4936 FF(GetDC, -1) |
4884 FF(GetDesktopWindow, -1) | 4937 FF(GetDesktopWindow, -1) |
4885 FF(ReleaseDC, -1) | 4938 FF(ReleaseDC, -1) |