- add -lossaudio if needed, and a check for <soundcard.h>, to configure.in
[wine] / ipc / wine_test_stub.c
1 #include <stdlib.h>
2 #include "dde.h"
3 #include <wintypes.h>
4 #include "global.h"
5 #include <win.h>
6 #define DEBUG_DEFINE_VARIABLES
7 #define DEBUG_ALL
8 #include <debug.h>
9
10 #define DDE_PROC2WIN(proc_idx)   (  (HWND) ~( (proc_idx)+1)  )
11 #define DDE_WIN2PROC(win)        (  (int) ~(short) ((win)+1) )
12 #define DDE_IsRemoteWindow(win)  (  (win)<0xffff && (win)>=(0xffff-DDE_PROCS))
13
14
15 char *MessageTypeNames[0x400]={NULL};
16 char *dummy_store_for_debug_msg_name;
17
18 ldt_copy_entry ldt_copy[LDT_SIZE];
19
20 int LDT_GetEntry( int entry, ldt_entry *content )
21 {
22     return 0;
23 }
24
25 int LDT_SetEntry( int entry, ldt_entry const *content )
26 {
27     return 0;
28 }
29
30 void dummy_usage_of_debug_msg_name()
31 {
32   dummy_store_for_debug_msg_name=debug_msg_name[0];
33 }
34
35 /* stub */
36 HWND32 GetDesktopWindow32()
37 {
38   printf("GetDesktopWindow\n");
39   return 0;
40 }
41 /* stub */
42 /* smart stub */
43 LONG SendMessage(HWND a,WORD b,WORD c,LONG d)
44 {
45   MSG msg;
46   printf("SendMessage(%04x,%04x,%04x,%04lx)\n",a,b,c,d);
47   if (DDE_IsRemoteWindow(a) || a==(HWND)-1)
48      return 0;
49   if (b!=WM_DDE_INITIATE)
50      return 0;
51   msg.hwnd=c;
52   msg.message= WM_DDE_ACK;
53   msg.lParam= 0;
54   msg.wParam= 0;
55   return DDE_SendMessage(&msg);
56 }
57 /* stub */
58 BOOL PostMessage(HWND a,WORD b,WORD c,LONG d)
59 {
60   printf("PostMessage(%04x,%04x,%04x,%04lx)\n",a,b,c,d);
61   return 0;
62 }
63 /* stub */
64 HWND GetTopWindow(HWND a)
65 {
66   printf("GetTopWindow(%04x)\n",a);
67   return 1;
68 }
69 /* stub */
70 WORD FreeSelector(WORD a)
71 {
72   printf("FreeSelector(%04x)\n",a);
73   return 0;
74 }
75
76 /* stub that partially emulates the true GLOBAL_CreateBlock function */
77 HGLOBAL16 GLOBAL_CreateBlock( WORD flags, void *ptr, DWORD size,
78                             HGLOBAL16 hOwner, BOOL isCode,
79                             BOOL is32Bit, BOOL isReadOnly,
80                             SHMDATA *shmdata  )
81 {
82   
83   printf("GLOBAL_CreateBlock(flags=0x%x,ptr=0x%08lx, size=0x%x,hOwner=0x%x\n",
84          (int)flags, (long)ptr, (int)size, (int)hOwner);
85   printf("isCode=%d, is32Bit=%d, isReadOnly=%d, \n", isCode, is32Bit,
86          isReadOnly);
87   printf("*shmdata={handle=0x%x,sel=0x%x, shmid=%d})\n",
88          shmdata->handle, shmdata->sel, shmdata->shmid);
89   return 1;
90 }
91
92 /* stub */
93 WND *WIN_FindWndPtr(HWND hwnd)
94 {
95   static WND win;
96   printf("WIN_FindWndPtr(%d)\n",hwnd);
97   if (hwnd==0)
98      return NULL;
99   win.next=NULL;
100   win.dwStyle=WS_POPUP;
101   
102   return &win;
103 }
104
105 /* stub */
106 WORD GetCurrentPDB(void)
107 {
108   printf("GetCurrentPDB()\n");
109   
110   return 0;
111 }
112
113 /* stub */
114 void Yield(void)
115 {
116 }