Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Window classes functions |
| 3 | * |
| 4 | * Copyright 1993 Alexandre Julliard |
Alexandre Julliard | 234bc24 | 1994-12-10 13:02:28 +0000 | [diff] [blame] | 5 | * |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 6 | static char Copyright[] = "Copyright Alexandre Julliard, 1993"; |
Alexandre Julliard | 234bc24 | 1994-12-10 13:02:28 +0000 | [diff] [blame] | 7 | */ |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 8 | |
Alexandre Julliard | 8d24ae6 | 1994-04-05 21:42:43 +0000 | [diff] [blame] | 9 | #include <stdlib.h> |
| 10 | #include <stdio.h> |
| 11 | #include <string.h> |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 12 | #include "class.h" |
| 13 | #include "user.h" |
| 14 | #include "win.h" |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 15 | #include "dce.h" |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame^] | 16 | #include "toolhelp.h" |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame] | 17 | #include "stddebug.h" |
Alexandre Julliard | 3a405ba | 1994-10-30 16:25:19 +0000 | [diff] [blame] | 18 | /* #define DEBUG_CLASS */ |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame] | 19 | #include "debug.h" |
Alexandre Julliard | 8d24ae6 | 1994-04-05 21:42:43 +0000 | [diff] [blame] | 20 | |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 21 | |
| 22 | static HCLASS firstClass = 0; |
| 23 | |
| 24 | |
| 25 | /*********************************************************************** |
| 26 | * CLASS_FindClassByName |
| 27 | * |
| 28 | * Return a handle and a pointer to the class. |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 29 | * 'ptr' can be NULL if the pointer is not needed. |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 30 | */ |
Alexandre Julliard | 3ed37e0 | 1994-11-07 18:20:42 +0000 | [diff] [blame] | 31 | HCLASS CLASS_FindClassByName( char * name, WORD hinstance, CLASS **ptr ) |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 32 | { |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 33 | ATOM atom; |
| 34 | HCLASS class; |
| 35 | CLASS * classPtr; |
| 36 | |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame^] | 37 | if (!(atom = GlobalFindAtom( name ))) return 0; |
| 38 | |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 39 | /* First search task-specific classes */ |
| 40 | |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame^] | 41 | for (class = firstClass; (class); class = classPtr->hNext) |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 42 | { |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame^] | 43 | classPtr = (CLASS *) USER_HEAP_LIN_ADDR(class); |
| 44 | if (classPtr->wc.style & CS_GLOBALCLASS) continue; |
| 45 | if ((classPtr->atomName == atom) && |
| 46 | ((hinstance==0xffff )|| (hinstance == classPtr->wc.hInstance))) |
| 47 | { |
| 48 | if (ptr) *ptr = classPtr; |
| 49 | return class; |
| 50 | } |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 51 | } |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 52 | |
| 53 | /* Then search global classes */ |
| 54 | |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame^] | 55 | for (class = firstClass; (class); class = classPtr->hNext) |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 56 | { |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame^] | 57 | classPtr = (CLASS *) USER_HEAP_LIN_ADDR(class); |
| 58 | if (!(classPtr->wc.style & CS_GLOBALCLASS)) continue; |
| 59 | if (classPtr->atomName == atom) |
| 60 | { |
| 61 | if (ptr) *ptr = classPtr; |
| 62 | return class; |
| 63 | } |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 64 | } |
| 65 | |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 66 | return 0; |
| 67 | } |
| 68 | |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 69 | |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 70 | /*********************************************************************** |
| 71 | * CLASS_FindClassPtr |
| 72 | * |
| 73 | * Return a pointer to the CLASS structure corresponding to a HCLASS. |
| 74 | */ |
| 75 | CLASS * CLASS_FindClassPtr( HCLASS hclass ) |
| 76 | { |
| 77 | CLASS * ptr; |
| 78 | |
| 79 | if (!hclass) return NULL; |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame^] | 80 | ptr = (CLASS *) USER_HEAP_LIN_ADDR( hclass ); |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 81 | if (ptr->wMagic != CLASS_MAGIC) return NULL; |
| 82 | return ptr; |
| 83 | } |
| 84 | |
| 85 | |
| 86 | /*********************************************************************** |
| 87 | * RegisterClass (USER.57) |
| 88 | */ |
| 89 | ATOM RegisterClass( LPWNDCLASS class ) |
| 90 | { |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 91 | CLASS * newClass, * prevClassPtr; |
| 92 | HCLASS handle, prevClass; |
Alexandre Julliard | 6b81b39 | 1994-07-07 16:23:58 +0000 | [diff] [blame] | 93 | int classExtra; |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame^] | 94 | char *name = PTR_SEG_TO_LIN( class->lpszClassName ); |
Alexandre Julliard | 6b81b39 | 1994-07-07 16:23:58 +0000 | [diff] [blame] | 95 | |
Alexandre Julliard | 3a405ba | 1994-10-30 16:25:19 +0000 | [diff] [blame] | 96 | dprintf_class(stddeb, "RegisterClass: wndproc=%p hinst=%d name='%s' background %x\n", |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame^] | 97 | class->lpfnWndProc, class->hInstance, name, class->hbrBackground ); |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 98 | |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 99 | /* Check if a class with this name already exists */ |
| 100 | |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame^] | 101 | prevClass = CLASS_FindClassByName( name, class->hInstance, &prevClassPtr ); |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 102 | if (prevClass) |
| 103 | { |
| 104 | /* Class can be created only if it is local and */ |
| 105 | /* if the class with the same name is global. */ |
| 106 | |
| 107 | if (class->style & CS_GLOBALCLASS) return 0; |
| 108 | if (!(prevClassPtr->wc.style & CS_GLOBALCLASS)) return 0; |
| 109 | } |
| 110 | |
| 111 | /* Create class */ |
| 112 | |
Alexandre Julliard | 6b81b39 | 1994-07-07 16:23:58 +0000 | [diff] [blame] | 113 | classExtra = (class->cbClsExtra < 0) ? 0 : class->cbClsExtra; |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame^] | 114 | handle = USER_HEAP_ALLOC( sizeof(CLASS) + classExtra ); |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 115 | if (!handle) return 0; |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame^] | 116 | newClass = (CLASS *) USER_HEAP_LIN_ADDR( handle ); |
Alexandre Julliard | 6b81b39 | 1994-07-07 16:23:58 +0000 | [diff] [blame] | 117 | newClass->hNext = firstClass; |
| 118 | newClass->wMagic = CLASS_MAGIC; |
| 119 | newClass->cWindows = 0; |
| 120 | newClass->wc = *class; |
| 121 | newClass->wc.cbWndExtra = (class->cbWndExtra < 0) ? 0 : class->cbWndExtra; |
| 122 | newClass->wc.cbClsExtra = classExtra; |
Alexandre Julliard | f0b2354 | 1993-09-29 12:21:49 +0000 | [diff] [blame] | 123 | |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame^] | 124 | newClass->atomName = GlobalAddAtom( name ); |
Alexandre Julliard | 8d24ae6 | 1994-04-05 21:42:43 +0000 | [diff] [blame] | 125 | newClass->wc.lpszClassName = NULL; |
Alexandre Julliard | f0b2354 | 1993-09-29 12:21:49 +0000 | [diff] [blame] | 126 | |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 127 | if (newClass->wc.style & CS_CLASSDC) |
| 128 | newClass->hdce = DCE_AllocDCE( DCE_CLASS_DC ); |
| 129 | else newClass->hdce = 0; |
| 130 | |
Alexandre Julliard | 8d24ae6 | 1994-04-05 21:42:43 +0000 | [diff] [blame] | 131 | /* Make a copy of the menu name (only if it is a string) */ |
| 132 | |
| 133 | if ((int)class->lpszMenuName & 0xffff0000) |
| 134 | { |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame^] | 135 | char *menuname = PTR_SEG_TO_LIN( class->lpszMenuName ); |
| 136 | HANDLE hname = USER_HEAP_ALLOC( strlen(menuname)+1 ); |
Alexandre Julliard | 8d24ae6 | 1994-04-05 21:42:43 +0000 | [diff] [blame] | 137 | if (hname) |
| 138 | { |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame^] | 139 | newClass->wc.lpszMenuName = (char *)USER_HEAP_SEG_ADDR( hname ); |
| 140 | strcpy( USER_HEAP_LIN_ADDR( hname ), menuname ); |
Alexandre Julliard | 8d24ae6 | 1994-04-05 21:42:43 +0000 | [diff] [blame] | 141 | } |
| 142 | } |
| 143 | |
Alexandre Julliard | 6b81b39 | 1994-07-07 16:23:58 +0000 | [diff] [blame] | 144 | if (classExtra) memset( newClass->wExtra, 0, classExtra ); |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 145 | firstClass = handle; |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 146 | return newClass->atomName; |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 147 | } |
| 148 | |
| 149 | |
| 150 | /*********************************************************************** |
| 151 | * UnregisterClass (USER.403) |
| 152 | */ |
| 153 | BOOL UnregisterClass( LPSTR className, HANDLE instance ) |
| 154 | { |
Alexandre Julliard | 8d24ae6 | 1994-04-05 21:42:43 +0000 | [diff] [blame] | 155 | HANDLE class, prevClass; |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 156 | CLASS * classPtr, * prevClassPtr; |
| 157 | |
| 158 | /* Check if we can remove this class */ |
Alexandre Julliard | 3ed37e0 | 1994-11-07 18:20:42 +0000 | [diff] [blame] | 159 | class = CLASS_FindClassByName( className, instance, &classPtr ); |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 160 | if (!class) return FALSE; |
| 161 | if ((classPtr->wc.hInstance != instance) || (classPtr->cWindows > 0)) |
| 162 | return FALSE; |
| 163 | |
| 164 | /* Remove the class from the linked list */ |
| 165 | if (firstClass == class) firstClass = classPtr->hNext; |
| 166 | else |
| 167 | { |
| 168 | for (prevClass = firstClass; prevClass; prevClass=prevClassPtr->hNext) |
| 169 | { |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame^] | 170 | prevClassPtr = (CLASS *) USER_HEAP_LIN_ADDR(prevClass); |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 171 | if (prevClassPtr->hNext == class) break; |
| 172 | } |
| 173 | if (!prevClass) |
| 174 | { |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame] | 175 | fprintf(stderr, "ERROR: Class list corrupted\n" ); |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 176 | return FALSE; |
| 177 | } |
| 178 | prevClassPtr->hNext = classPtr->hNext; |
| 179 | } |
Alexandre Julliard | f0b2354 | 1993-09-29 12:21:49 +0000 | [diff] [blame] | 180 | |
| 181 | /* Delete the class */ |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 182 | if (classPtr->hdce) DCE_FreeDCE( classPtr->hdce ); |
Alexandre Julliard | f0b2354 | 1993-09-29 12:21:49 +0000 | [diff] [blame] | 183 | if (classPtr->wc.hbrBackground) DeleteObject( classPtr->wc.hbrBackground ); |
Alexandre Julliard | 3ed37e0 | 1994-11-07 18:20:42 +0000 | [diff] [blame] | 184 | /*if (classPtr->wc.style & CS_GLOBALCLASS)*/ GlobalDeleteAtom( classPtr->atomName ); |
| 185 | /*else DeleteAtom( classPtr->atomName );*/ |
Alexandre Julliard | 8d24ae6 | 1994-04-05 21:42:43 +0000 | [diff] [blame] | 186 | if ((int)classPtr->wc.lpszMenuName & 0xffff0000) |
| 187 | USER_HEAP_FREE( (int)classPtr->wc.lpszMenuName & 0xffff ); |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 188 | USER_HEAP_FREE( class ); |
| 189 | return TRUE; |
| 190 | } |
| 191 | |
| 192 | |
| 193 | /*********************************************************************** |
| 194 | * GetClassWord (USER.129) |
| 195 | */ |
| 196 | WORD GetClassWord( HWND hwnd, short offset ) |
| 197 | { |
| 198 | return (WORD)GetClassLong( hwnd, offset ); |
| 199 | } |
| 200 | |
| 201 | |
| 202 | /*********************************************************************** |
| 203 | * SetClassWord (USER.130) |
| 204 | */ |
| 205 | WORD SetClassWord( HWND hwnd, short offset, WORD newval ) |
| 206 | { |
| 207 | CLASS * classPtr; |
| 208 | WND * wndPtr; |
Alexandre Julliard | f0b2354 | 1993-09-29 12:21:49 +0000 | [diff] [blame] | 209 | WORD *ptr, retval = 0; |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 210 | |
| 211 | if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0; |
Alexandre Julliard | f0b2354 | 1993-09-29 12:21:49 +0000 | [diff] [blame] | 212 | if (!(classPtr = CLASS_FindClassPtr( wndPtr->hClass ))) return 0; |
| 213 | ptr = (WORD *)(((char *)classPtr->wExtra) + offset); |
| 214 | retval = *ptr; |
| 215 | *ptr = newval; |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 216 | return retval; |
| 217 | } |
| 218 | |
| 219 | |
| 220 | /*********************************************************************** |
| 221 | * GetClassLong (USER.131) |
| 222 | */ |
| 223 | LONG GetClassLong( HWND hwnd, short offset ) |
| 224 | { |
| 225 | CLASS * classPtr; |
| 226 | WND * wndPtr; |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 227 | |
| 228 | if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0; |
Alexandre Julliard | f0b2354 | 1993-09-29 12:21:49 +0000 | [diff] [blame] | 229 | if (!(classPtr = CLASS_FindClassPtr( wndPtr->hClass ))) return 0; |
| 230 | return *(LONG *)(((char *)classPtr->wExtra) + offset); |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | |
| 234 | /*********************************************************************** |
| 235 | * SetClassLong (USER.132) |
| 236 | */ |
| 237 | LONG SetClassLong( HWND hwnd, short offset, LONG newval ) |
| 238 | { |
| 239 | CLASS * classPtr; |
| 240 | WND * wndPtr; |
Alexandre Julliard | f0b2354 | 1993-09-29 12:21:49 +0000 | [diff] [blame] | 241 | LONG *ptr, retval = 0; |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 242 | |
| 243 | if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0; |
Alexandre Julliard | f0b2354 | 1993-09-29 12:21:49 +0000 | [diff] [blame] | 244 | if (!(classPtr = CLASS_FindClassPtr( wndPtr->hClass ))) return 0; |
| 245 | ptr = (LONG *)(((char *)classPtr->wExtra) + offset); |
| 246 | retval = *ptr; |
| 247 | *ptr = newval; |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 248 | return retval; |
| 249 | } |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 250 | |
| 251 | |
| 252 | /*********************************************************************** |
| 253 | * GetClassName (USER.58) |
| 254 | */ |
| 255 | int GetClassName(HWND hwnd, LPSTR lpClassName, short maxCount) |
| 256 | { |
| 257 | WND *wndPtr; |
| 258 | CLASS *classPtr; |
| 259 | |
Alexandre Julliard | 3ed37e0 | 1994-11-07 18:20:42 +0000 | [diff] [blame] | 260 | /* FIXME: We have the find the correct hInstance */ |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame^] | 261 | dprintf_class(stddeb,"GetClassName(%x,%p,%d\n)",hwnd,lpClassName,maxCount); |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 262 | if (!(wndPtr = WIN_FindWndPtr(hwnd))) return 0; |
| 263 | if (!(classPtr = CLASS_FindClassPtr(wndPtr->hClass))) return 0; |
| 264 | |
| 265 | return (GetAtomName(classPtr->atomName, lpClassName, maxCount)); |
| 266 | } |
| 267 | |
| 268 | |
| 269 | /*********************************************************************** |
| 270 | * GetClassInfo (USER.404) |
| 271 | */ |
| 272 | BOOL GetClassInfo(HANDLE hInstance, LPSTR lpClassName, |
| 273 | LPWNDCLASS lpWndClass) |
| 274 | { |
| 275 | CLASS *classPtr; |
| 276 | |
Alexandre Julliard | 3ed37e0 | 1994-11-07 18:20:42 +0000 | [diff] [blame] | 277 | if (HIWORD(lpClassName)) |
| 278 | { |
| 279 | dprintf_class(stddeb, "GetClassInfo hInstance=%04x lpClassName=%s\n", |
| 280 | hInstance, lpClassName); |
| 281 | } |
| 282 | else |
| 283 | dprintf_class(stddeb, "GetClassInfo hInstance=%04x lpClassName=#%d\n", |
| 284 | hInstance, (int)lpClassName); |
| 285 | |
| 286 | |
| 287 | /* if (!(CLASS_FindClassByName(lpClassName, &classPtr))) return FALSE; */ |
| 288 | if (!(CLASS_FindClassByName(lpClassName, hInstance, &classPtr))) |
| 289 | { |
| 290 | if (!HIWORD(lpClassName)) |
| 291 | { |
| 292 | char temp[10]; |
| 293 | sprintf(temp, "#%d", (int)lpClassName); |
| 294 | if (!(CLASS_FindClassByName(temp, hInstance, &classPtr))) return FALSE; |
| 295 | |
| 296 | } |
| 297 | else return FALSE; |
| 298 | } |
| 299 | |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 300 | if (hInstance && (hInstance != classPtr->wc.hInstance)) return FALSE; |
| 301 | |
| 302 | memcpy(lpWndClass, &(classPtr->wc), sizeof(WNDCLASS)); |
| 303 | return TRUE; |
| 304 | } |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame^] | 305 | |
| 306 | |
| 307 | /*********************************************************************** |
| 308 | * ClassFirst (TOOLHELP.69) |
| 309 | */ |
| 310 | BOOL ClassFirst( CLASSENTRY *pClassEntry ) |
| 311 | { |
| 312 | pClassEntry->wNext = firstClass; |
| 313 | return ClassNext( pClassEntry ); |
| 314 | } |
| 315 | |
| 316 | |
| 317 | /*********************************************************************** |
| 318 | * ClassNext (TOOLHELP.70) |
| 319 | */ |
| 320 | BOOL ClassNext( CLASSENTRY *pClassEntry ) |
| 321 | { |
| 322 | CLASS *classPtr = (CLASS *) USER_HEAP_LIN_ADDR( pClassEntry->wNext ); |
| 323 | if (!classPtr) return FALSE; |
| 324 | |
| 325 | pClassEntry->hInst = classPtr->wc.hInstance; |
| 326 | pClassEntry->wNext = classPtr->hNext; |
| 327 | GlobalGetAtomName( classPtr->atomName, pClassEntry->szClassName, |
| 328 | sizeof(pClassEntry->szClassName) ); |
| 329 | return TRUE; |
| 330 | } |