00347 {
00348 KERNEL_ULONG_PTR dwProc;
00349
DWORD dwCPDType = 0;
00350
PWND pwndParent;
00351
00352
switch (index) {
00353
case GWLP_USERDATA:
00354
return KERNEL_ULONG_PTR_TO_ULONG_PTR(pwnd->
dwUserData);
00355
00356
case GWL_EXSTYLE:
00357
00358
00359
00360
return pwnd->ExStyle & WS_EX_ALLVALID;
00361
00362
case GWL_STYLE:
00363
return pwnd->style;
00364
00365
case GWLP_ID:
00366
if (
TestwndChild(pwnd)) {
00367
return (ULONG_PTR)pwnd->
spmenu;
00368 }
else if (pwnd->
spmenu !=
NULL) {
00369
PMENU pmenu;
00370
00371 pmenu =
REBASEALWAYS(pwnd, spmenu);
00372
return (ULONG_PTR)
PtoH(pmenu);
00373 }
00374
return 0;
00375
00376
case GWLP_HINSTANCE:
00377
return (ULONG_PTR)pwnd->hModule;
00378
00379
case GWLP_WNDPROC:
00380
00381
00382
00383
if (!
TestWindowProcess(pwnd)) {
00384 RIPERR1(ERROR_ACCESS_DENIED, RIP_WARNING,
"Can not subclass another process's window %#p", pwnd);
00385
return 0;
00386 }
00387
00388
00389
00390
00391
00392
00393
if (
TestWF(pwnd, WFSERVERSIDEPROC)) {
00394 dwProc =
MapServerToClientPfn((KERNEL_ULONG_PTR)pwnd->
lpfnWndProc, bAnsi);
00395
if (dwProc == 0)
00396 RIPMSG1(RIP_WARNING,
"GetWindowLong: GWL_WNDPROC: Kernel-side wndproc can't be mapped for pwnd=%#p", pwnd);
00397 }
else {
00398
00399
00400
00401
00402
if (
GETFNID(pwnd) ==
FNID_EDIT) {
00403 dwProc = (ULONG_PTR)
MapKernelClientFnToClientFn(pwnd->
lpfnWndProc);
00404
goto CheckAnsiUnicodeMismatch;
00405 }
else {
00406
PCLS pcls =
REBASEALWAYS(pwnd, pcls);
00407 dwProc =
MapClientNeuterToClientPfn(pcls, (KERNEL_ULONG_PTR)pwnd->
lpfnWndProc, bAnsi);
00408 }
00409
00410
00411
00412
00413
00414
if (dwProc == (KERNEL_ULONG_PTR)pwnd->
lpfnWndProc) {
00415 CheckAnsiUnicodeMismatch:
00416
00417
00418
00419
if (bAnsi != (
TestWF(pwnd, WFANSIPROC) ?
TRUE :
FALSE)) {
00420 dwCPDType |= bAnsi ?
CPD_ANSI_TO_UNICODE :
CPD_UNICODE_TO_ANSI;
00421 }
00422 }
00423
00424
if (dwCPDType) {
00425 ULONG_PTR cpd;
00426
00427 cpd =
GetCPD(pwnd, dwCPDType | CPD_WND, KERNEL_ULONG_PTR_TO_ULONG_PTR(dwProc));
00428
00429
if (cpd) {
00430 dwProc = cpd;
00431 }
else {
00432 RIPMSG0(RIP_WARNING,
"GetWindowLong unable to alloc CPD returning handle\n");
00433 }
00434 }
00435 }
00436
00437
00438
00439
00440
return KERNEL_ULONG_PTR_TO_ULONG_PTR(dwProc);
00441
00442
case GWLP_HWNDPARENT:
00443
00444
00445
00446
00447
00448
00449
00450
if (
GETFNID(pwnd) ==
FNID_DESKTOP) {
00451
return 0;
00452 }
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
if (pwnd->
spwndParent ==
NULL) {
00469
return 0;
00470 }
00471 pwndParent =
REBASEALWAYS(pwnd, spwndParent);
00472
if (
GETFNID(pwndParent) ==
FNID_DESKTOP) {
00473 pwnd =
REBASEPWND(pwnd, spwndOwner);
00474
return (ULONG_PTR)
HW(pwnd);
00475 }
00476
00477
return (ULONG_PTR)
HW(pwndParent);
00478
00479
00480
00481
00482
case GWLP_WOWWORDS:
00483
return (ULONG_PTR) &pwnd->state;
00484
00485 }
00486
00487 RIPERR0(ERROR_INVALID_INDEX, RIP_VERBOSE,
"");
00488
return 0;
00489 }