-
Notifications
You must be signed in to change notification settings - Fork 3
/
xsherry-19.08.2016.diff
3235 lines (3039 loc) · 170 KB
/
xsherry-19.08.2016.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff --git a/dlls/apphelp/apphelp.c b/dlls/apphelp/apphelp.c
index 64dcd87..9150efb 100644
--- a/dlls/apphelp/apphelp.c
+++ b/dlls/apphelp/apphelp.c
@@ -111,3 +111,9 @@ void WINAPI SdbCloseDatabase(PDB pdb)
{
FIXME("stub: %p\n", pdb);
}
+
+void WINAPI SdbGetAppPatchDir(HSDB hsdb, LPWSTR path, DWORD size)
+{
+ FIXME("stub: %p %s %d\n", hsdb, debugstr_w(path), size);
+}
+
diff --git a/dlls/apphelp/apphelp.spec b/dlls/apphelp/apphelp.spec
index a658e5c..0119a48 100644
--- a/dlls/apphelp/apphelp.spec
+++ b/dlls/apphelp/apphelp.spec
@@ -49,7 +49,7 @@
@ stub SdbFreeFileInfo
@ stub SdbFreeFlagInfo
@ stub SdbGetAppCompatDataSize
-@ stub SdbGetAppPatchDir
+@ stdcall SdbGetAppPatchDir(ptr wstr long)
@ stub SdbGetBinaryTagData
@ stub SdbGetDatabaseID
@ stub SdbGetDatabaseInformation
diff --git a/dlls/d3d11/shader.c b/dlls/d3d11/shader.c
index 9f618e4..d0b07f7 100644
--- a/dlls/d3d11/shader.c
+++ b/dlls/d3d11/shader.c
@@ -439,6 +439,10 @@ static HRESULT d3d_vertex_shader_init(struct d3d_vertex_shader *shader, struct d
return hr;
}
desc.max_version = d3d_sm_from_feature_level(device->feature_level);
+//Slice
+ desc.byte_code = byte_code;
+ desc.input_signature.element_count = 0;
+ desc.output_signature.element_count = 0;
hr = wined3d_shader_create_vs(device->wined3d_device, &desc, shader,
&d3d_vertex_shader_wined3d_parent_ops, &shader->wined3d_shader);
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 1c600ca..e1ca9f4 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -1106,7 +1106,7 @@ static HRESULT d3d9_device_create_surface(struct d3d9_device *device, UINT width
{
struct wined3d_resource_desc desc;
struct d3d9_surface *surface_impl;
- struct wined3d_texture *texture;
+ struct wined3d_texture *texture = NULL;
HRESULT hr;
TRACE("device %p, width %u, height %u, format %#x, flags %#x, surface %p.\n"
diff --git a/dlls/d3d9/surface.c b/dlls/d3d9/surface.c
index 2dce998..bbadf81 100644
--- a/dlls/d3d9/surface.c
+++ b/dlls/d3d9/surface.c
@@ -355,7 +355,7 @@ void surface_init(struct d3d9_surface *surface, struct wined3d_texture *wined3d_
unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops)
{
struct wined3d_resource_desc desc;
- IDirect3DBaseTexture9 *texture;
+ IDirect3DBaseTexture9 *texture = NULL;
surface->IDirect3DSurface9_iface.lpVtbl = &d3d9_surface_vtbl;
d3d9_resource_init(&surface->resource);
@@ -396,6 +396,10 @@ static void STDMETHODCALLTYPE view_wined3d_object_destroyed(void *parent)
{
struct d3d9_surface *surface = parent;
+ if (!surface) {
+ return;
+ }
+
/* If the surface reference count drops to zero, we release our reference
* to the view, but don't clear the pointer yet, in case e.g. a
* GetRenderTarget() call brings the surface back before the view is
@@ -418,6 +422,10 @@ struct wined3d_rendertarget_view *d3d9_surface_get_rendertarget_view(struct d3d9
{
HRESULT hr;
+ if (!surface) {
+ return NULL;
+ }
+
if (surface->wined3d_rtv)
return surface->wined3d_rtv;
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index b55c1f2..252811e 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -19653,6 +19653,261 @@ done:
DestroyWindow(window);
}
+static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char *test_id_str)
+{
+ D3DCAPS9 caps;
+ D3DCOLOR color;
+ HRESULT hr;
+ int i;
+
+ static const D3DMATRIX view_mat =
+ {{{
+ 2.0f / 10.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 2.0f / 10.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f
+ }}},
+ upper_left =
+ {{{
+ 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ -4.0f, 4.0f, 0.0f, 1.0f
+ }}},
+ lower_left =
+ {{{
+ 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ -4.0f, -4.0f, 0.0f, 1.0f
+ }}},
+ upper_right =
+ {{{
+ 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ 4.0f, 4.0f, 0.0f, 1.0f
+ }}},
+ lower_right =
+ {{{
+ 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ 4.0f, -4.0f, 0.0f, 1.0f
+ }}};
+
+ static const POINT quad_upper_right_points[] =
+ {
+ {576, 48}, {-1, -1},
+ },
+ quad_upper_right_empty_points[] =
+ {
+ {64, 48}, {64, 432}, {576, 432}, {320, 240}, {-1, -1}
+ },
+ quad_center_points[] =
+ {
+ {320, 240}, {-1, -1}
+ },
+ quad_center_empty_points[] =
+ {
+ {64, 48}, {576, 48}, {64, 432}, {576, 432}, {-1, -1}
+ },
+ quad_upper_center_points[] =
+ {
+ {320, 48}, {-1, -1}
+ },
+ quad_upper_center_empty_points[] =
+ {
+ {320, 240}, {64, 48}, {576, 48}, {-1, -1}
+ },
+ quad_fullscreen_points[] =
+ {
+ {320, 48}, {320, 240}, {64, 48}, {576, 48}, {64, 432}, {576, 432}, {-1, -1}
+ },
+ quad_fullscreen_empty_points[] =
+ {
+ {-1, -1}
+ };
+
+ static const struct
+ {
+ struct
+ {
+ struct vec3 position;
+ struct vec3 blendweights;
+ DWORD matrixIndices;
+ }
+ vertex_data[4];
+ const POINT *quad_points;
+ const POINT *empty_points;
+ }
+ tests[] =
+ {
+ /* upper right */
+ {
+ {{{-1.0f, -1.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, 0x06070405},
+ {{-1.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, 0x06070405},
+ {{ 1.0f, -1.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, 0x06070405},
+ {{ 1.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, 0x06070405}},
+ quad_upper_right_points, quad_upper_right_empty_points
+ },
+ /* center */
+ {
+ {{{-1.0f, -1.0f, 0.0f}, {0.25f, 0.25f, 0.25f}, 0x06070405},
+ {{-1.0f, 1.0f, 0.0f}, {0.25f, 0.25f, 0.25f}, 0x06070405},
+ {{ 1.0f, -1.0f, 0.0f}, {0.25f, 0.25f, 0.25f}, 0x06070405},
+ {{ 1.0f, 1.0f, 0.0f}, {0.25f, 0.25f, 0.25f}, 0x06070405}},
+ quad_center_points, quad_center_empty_points
+ },
+ /* upper center */
+ {
+ {{{-1.0f, -1.0f, 0.0f}, {0.5f, 0.0f, 0.0f}, 0x06070405},
+ {{-1.0f, 1.0f, 0.0f}, {0.5f, 0.0f, 0.0f}, 0x06070405},
+ {{ 1.0f, -1.0f, 0.0f}, {0.5f, 0.0f, 0.0f}, 0x06070405},
+ {{ 1.0f, 1.0f, 0.0f}, {0.5f, 0.0f, 0.0f}, 0x06070405}},
+ quad_upper_center_points, quad_upper_center_empty_points
+ },
+ /* full screen */
+ {
+ {{{-1.0f, -1.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, 0x06070405},
+ {{-1.0f, 1.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, 0x06070405},
+ {{ 1.0f, -1.0f, 0.0f}, {0.0f, 0.0f, 1.0f}, 0x06070405},
+ {{ 1.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, 0x06070405}},
+ quad_fullscreen_points, quad_fullscreen_empty_points
+ }
+ };
+
+ hr = IDirect3DDevice9_GetDeviceCaps(device, &caps);
+ ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr);
+ if (caps.MaxVertexBlendMatrixIndex < 7 || caps.MaxVertexBlendMatrices < 4)
+ {
+ skip("(%s) Too few vertex blend matrices supported: MaxVertexBlendMatrices=%u, MaxVertexBlendMatrixIndex=%u\n",
+ test_id_str, caps.MaxVertexBlendMatrices,caps.MaxVertexBlendMatrixIndex);
+ goto done;
+ }
+ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE);
+ ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr);
+
+ hr = IDirect3DDevice9_SetTransform(device, D3DTS_VIEW, &view_mat);
+ ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform returned %08x\n", hr);
+
+ hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLDMATRIX(5), &upper_left);
+ ok(hr == D3D_OK, "(%s) IDirect3DDevice9_SetTransform returned %08x\n", test_id_str, hr);
+ hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLDMATRIX(4), &lower_left);
+ ok(hr == D3D_OK, "(%s) IDirect3DDevice9_SetTransform returned %08x\n", test_id_str, hr);
+ hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLDMATRIX(7), &lower_right);
+ ok(hr == D3D_OK, "(%s) IDirect3DDevice9_SetTransform returned %08x\n", test_id_str, hr);
+ hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLDMATRIX(6), &upper_right);
+ ok(hr == D3D_OK, "(%s) IDirect3DDevice9_SetTransform returned %08x\n", test_id_str, hr);
+
+ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_VERTEXBLEND, D3DVBF_3WEIGHTS);
+ ok(hr == D3D_OK, "(%s) IDirect3DDevice9_SetRenderState failed %08x\n", test_id_str, hr);
+ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_INDEXEDVERTEXBLENDENABLE, TRUE);
+ ok(hr == D3D_OK, "(%s) IDirect3DDevice9_SetRenderState D3DRS_INDEXEDVERTEXBLENDENABLE failed %08x\n", test_id_str, hr);
+
+ for (i = 0; i < sizeof(tests) / sizeof(tests[0]); ++i)
+ {
+ const POINT *point;
+
+ hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff000000, 0.0, 0);
+ ok(SUCCEEDED(hr), "Failed to clear %08x\n", hr);
+
+ hr = IDirect3DDevice9_BeginScene(device);
+ ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZB4 | D3DFVF_LASTBETA_UBYTE4);
+ ok(SUCCEEDED(hr), "(%s) Failed to set FVF, hr %#x.\n", test_id_str, hr);
+
+ hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, tests[i].vertex_data, 6 * sizeof(float) + sizeof(DWORD));
+ ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
+
+ hr = IDirect3DDevice9_EndScene(device);
+ ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
+
+ point = tests[i].quad_points;
+ while (point->x != -1 && point->y != -1)
+ {
+ color = getPixelColor(device, point->x, point->y);
+ ok(color_match(color, 0x00ffffff, 1), "(%s) Expected quad at %dx%d.\n", test_id_str, point->x, point->y);
+ ++point;
+ }
+
+ point = tests[i].empty_points;
+ while (point->x != -1 && point->y != -1)
+ {
+ color = getPixelColor(device, point->x, point->y);
+ ok(color_match(color, 0x00000000, 1), "(%s) Unexpected quad at %dx%d.\n", test_id_str, point->x, point->y);
+ ++point;
+ }
+
+ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
+ ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr);
+ }
+done:
+ ;
+}
+
+static void test_indexed_vertex_blending(void)
+{
+IDirect3D9 *d3d;
+IDirect3DDevice9 *device;
+ULONG refcount;
+HWND window;
+D3DPRESENT_PARAMETERS present_parameters = {0};
+
+ window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
+ 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ d3d = Direct3DCreate9(D3D_SDK_VERSION);
+ ok(!!d3d, "Failed to create a D3D object.\n");
+ if (!(device = create_device(d3d, window, window, TRUE)))
+ {
+ skip("Failed to create a D3D device, skipping tests.\n");
+ goto done;
+ }
+ present_parameters.Windowed = TRUE;
+ present_parameters.hDeviceWindow = window;
+ present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
+ present_parameters.BackBufferWidth = 640;
+ present_parameters.BackBufferHeight = 480;
+ present_parameters.BackBufferFormat = D3DFMT_A8R8G8B8;
+ present_parameters.EnableAutoDepthStencil = TRUE;
+ present_parameters.AutoDepthStencilFormat = D3DFMT_D24S8;
+
+ if (!SUCCEEDED(IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window,
+ D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device)))
+ {
+ skip("Failed to create a D3D device, skipping tests.\n");
+ goto done;
+ }
+ do_test_indexed_vertex_blending(device,"IVB software");
+ refcount = IDirect3DDevice9_Release(device);
+ ok(!refcount, "Device has %u references left.\n", refcount);
+
+ if (!SUCCEEDED(IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window,
+ D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device)))
+ {
+ skip("Failed to create a D3D device, skipping tests.\n");
+ goto done;
+ }
+ do_test_indexed_vertex_blending(device,"IVB hardware");
+ refcount = IDirect3DDevice9_Release(device);
+ ok(!refcount, "Device has %u references left.\n", refcount);
+
+ if (!SUCCEEDED(IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window,
+ D3DCREATE_MIXED_VERTEXPROCESSING, &present_parameters, &device)))
+ {
+ skip("Failed to create a D3D device, skipping tests.\n");
+ goto done;
+ }
+ do_test_indexed_vertex_blending(device,"IVB mixed");
+ refcount = IDirect3DDevice9_Release(device);
+ ok(!refcount, "Device has %u references left.\n", refcount);
+
+done:
+ IDirect3D9_Release(d3d);
+ DestroyWindow(window);
+}
+
static void test_updatetexture(void)
{
IDirect3DDevice9 *device;
@@ -22017,6 +22272,7 @@ START_TEST(visual)
test_multisample_mismatch();
test_texcoordindex();
test_vertex_blending();
+ test_indexed_vertex_blending();
test_updatetexture();
test_depthbias();
test_flip();
diff --git a/dlls/d3dx9_36/font.c b/dlls/d3dx9_36/font.c
index 5522dea..b4b9600 100644
--- a/dlls/d3dx9_36/font.c
+++ b/dlls/d3dx9_36/font.c
@@ -35,8 +35,29 @@ struct d3dx_font
HDC hdc;
HFONT hfont;
+
+ UINT tex_width;
+ UINT tex_height;
+ IDirect3DTexture9 *texture;
+ HBITMAP bitmap;
+ BYTE *bits;
};
+/* Returns the smallest power of 2 which is greater than or equal to num */
+static UINT make_pow2(UINT num)
+{
+ UINT result = 1;
+
+ /* In the unlikely event somebody passes a large value, make sure we don't enter an infinite loop */
+ if (num >= 0x80000000)
+ return 0x80000000;
+
+ while (result < num)
+ result <<= 1;
+
+ return result;
+}
+
static inline struct d3dx_font *impl_from_ID3DXFont(ID3DXFont *iface)
{
return CONTAINING_RECORD(iface, struct d3dx_font, ID3DXFont_iface);
@@ -63,19 +84,27 @@ static HRESULT WINAPI ID3DXFontImpl_QueryInterface(ID3DXFont *iface, REFIID riid
static ULONG WINAPI ID3DXFontImpl_AddRef(ID3DXFont *iface)
{
struct d3dx_font *This = impl_from_ID3DXFont(iface);
- ULONG ref=InterlockedIncrement(&This->ref);
+ ULONG ref = InterlockedIncrement(&This->ref);
+
TRACE("%p increasing refcount to %u\n", iface, ref);
+
return ref;
}
static ULONG WINAPI ID3DXFontImpl_Release(ID3DXFont *iface)
{
struct d3dx_font *This = impl_from_ID3DXFont(iface);
- ULONG ref=InterlockedDecrement(&This->ref);
+ ULONG ref = InterlockedDecrement(&This->ref);
TRACE("%p decreasing refcount to %u\n", iface, ref);
- if(ref==0) {
+ if (!ref)
+ {
+ if (This->texture)
+ {
+ IDirect3DTexture9_Release(This->texture);
+ DeleteObject(This->bitmap);
+ }
DeleteObject(This->hfont);
DeleteDC(This->hdc);
IDirect3DDevice9_Release(This->device);
@@ -178,17 +207,187 @@ static HRESULT WINAPI ID3DXFontImpl_PreloadTextW(ID3DXFont *iface, const WCHAR *
static INT WINAPI ID3DXFontImpl_DrawTextA(ID3DXFont *iface, ID3DXSprite *sprite,
const char *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
{
- FIXME("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x stub!\n",
+ LPWSTR stringW;
+ INT countW, ret = 0;
+
+ TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
iface, sprite, debugstr_a(string), count, wine_dbgstr_rect(rect), format, color);
- return 1;
+
+ if (!string || count == 0)
+ return 0;
+
+ if (count < 0)
+ count = -1;
+
+ countW = MultiByteToWideChar(CP_ACP, 0, string, count, NULL, 0);
+ stringW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR));
+ if (stringW)
+ {
+ MultiByteToWideChar(CP_ACP, 0, string, count, stringW, countW);
+ ret = ID3DXFont_DrawTextW(iface, sprite, stringW, countW, rect, format, color);
+ HeapFree(GetProcessHeap(), 0, stringW);
+ }
+
+ return ret;
}
static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
const WCHAR *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
{
- FIXME("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x stub!\n",
+ struct d3dx_font *This = impl_from_ID3DXFont(iface);
+ RECT calc_rect;
+ INT height;
+
+ TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
iface, sprite, debugstr_w(string), count, wine_dbgstr_rect(rect), format, color);
- return 1;
+
+ if (!string || count == 0)
+ return 0;
+
+ if (count < 0)
+ count = lstrlenW(string);
+
+ /* Strip terminating NULL characters */
+ while (count > 0 && !string[count-1])
+ count--;
+
+ if (rect)
+ calc_rect = *rect;
+
+ height = DrawTextW(This->hdc, string, count, &calc_rect, format | DT_CALCRECT);
+
+ if (format & DT_CALCRECT)
+ {
+ if (rect)
+ *rect = calc_rect;
+ return height;
+ }
+
+ if (format & DT_CENTER)
+ {
+ UINT new_width = calc_rect.right - calc_rect.left;
+ calc_rect.left = (rect->right + rect->left - new_width) / 2;
+ calc_rect.right = calc_rect.left + new_width;
+ }
+
+ if (height && (calc_rect.left < calc_rect.right))
+ {
+ D3DLOCKED_RECT locked_rect;
+ D3DXVECTOR3 position;
+ UINT text_width, text_height;
+ RECT text_rect;
+ ID3DXSprite *target = sprite;
+ HRESULT hr;
+ int i, j;
+
+ /* Get rect position and dimensions */
+ position.x = calc_rect.left;
+ position.y = calc_rect.top;
+ position.z = 0;
+ text_width = calc_rect.right - calc_rect.left;
+ text_height = calc_rect.bottom - calc_rect.top;
+ text_rect.left = 0;
+ text_rect.top = 0;
+ text_rect.right = text_width;
+ text_rect.bottom = text_height;
+
+ /* We need to flush as it seems all draws in the begin/end sequence use only the latest updated texture */
+ if (sprite)
+ ID3DXSprite_Flush(sprite);
+
+ /* Extend texture and DIB section to contain text */
+ if ((text_width > This->tex_width) || (text_height > This->tex_height))
+ {
+ BITMAPINFOHEADER header;
+
+ if (text_width > This->tex_width)
+ This->tex_width = make_pow2(text_width);
+ if (text_height > This->tex_height)
+ This->tex_height = make_pow2(text_height);
+
+ if (This->texture)
+ {
+ IDirect3DTexture9_Release(This->texture);
+ DeleteObject(This->bitmap);
+ }
+
+ hr = D3DXCreateTexture(This->device, This->tex_width, This->tex_height, 1, 0,
+ D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &This->texture);
+ if (FAILED(hr))
+ {
+ This->texture = NULL;
+ return 0;
+ }
+
+ header.biSize = sizeof(header);
+ header.biWidth = This->tex_width;
+ header.biHeight = -This->tex_height;
+ header.biPlanes = 1;
+ header.biBitCount = 32;
+ header.biCompression = BI_RGB;
+ header.biSizeImage = sizeof(DWORD) * This->tex_width * This->tex_height;
+ header.biXPelsPerMeter = 0;
+ header.biYPelsPerMeter = 0;
+ header.biClrUsed = 0;
+ header.biClrImportant = 0;
+
+ This->bitmap = CreateDIBSection(This->hdc, (const BITMAPINFO*)&header,
+ DIB_RGB_COLORS, (void**)&This->bits, NULL, 0);
+ if (!This->bitmap)
+ {
+ IDirect3DTexture9_Release(This->texture);
+ This->texture = NULL;
+ return 0;
+ }
+
+ SelectObject(This->hdc, This->bitmap);
+ }
+
+ if (FAILED(IDirect3DTexture9_LockRect(This->texture, 0, &locked_rect, &text_rect, D3DLOCK_DISCARD)))
+ return 0;
+
+ /* Clear rect */
+ for (i = 0; i < text_height; i++)
+ memset(This->bits + i * This->tex_width * sizeof(DWORD), 0,
+ text_width * sizeof(DWORD));
+
+ DrawTextW(This->hdc, string, count, &text_rect, format);
+
+ /* All RGB components are equal so take one as alpha and set RGB
+ * color to white, so it can be modulated with color parameter */
+ for (i = 0; i < text_height; i++)
+ {
+ DWORD *src = (DWORD *)This->bits + i * This->tex_width;
+ DWORD *dst = (DWORD *)((BYTE *)locked_rect.pBits + i * locked_rect.Pitch);
+ for (j = 0; j < text_width; j++)
+ {
+ *dst++ = (*src++ << 24) | 0xFFFFFF;
+ }
+ }
+
+ IDirect3DTexture9_UnlockRect(This->texture, 0);
+
+ if (!sprite)
+ {
+ hr = D3DXCreateSprite(This->device, &target);
+ if (FAILED(hr))
+ return 0;
+ ID3DXSprite_Begin(target, 0);
+ }
+
+ hr = target->lpVtbl->Draw(target, This->texture, &text_rect, NULL, &position, color);
+
+ if (!sprite)
+ {
+ ID3DXSprite_End(target);
+ ID3DXSprite_Release(target);
+ }
+
+ if (FAILED(hr))
+ return 0;
+ }
+
+ return height;
}
static HRESULT WINAPI ID3DXFontImpl_OnLostDevice(ID3DXFont *iface)
@@ -302,46 +501,55 @@ HRESULT WINAPI D3DXCreateFontIndirectW(IDirect3DDevice9 *device, const D3DXFONT_
TRACE("(%p, %p, %p)\n", device, desc, font);
- if( !device || !desc || !font ) return D3DERR_INVALIDCALL;
+ if (!device || !desc || !font) return D3DERR_INVALIDCALL;
- /* the device MUST support D3DFMT_A8R8G8B8 */
+ TRACE("desc: %d %d %d %d %d %d %d %d %d %s\n", desc->Height, desc->Width, desc->Weight, desc->MipLevels, desc->Italic,
+ desc->CharSet, desc->OutputPrecision, desc->Quality, desc->PitchAndFamily, debugstr_w(desc->FaceName));
+
+ /* The device MUST support D3DFMT_A8R8G8B8 */
IDirect3DDevice9_GetDirect3D(device, &d3d);
IDirect3DDevice9_GetCreationParameters(device, &cpars);
IDirect3DDevice9_GetDisplayMode(device, 0, &mode);
hr = IDirect3D9_CheckDeviceFormat(d3d, cpars.AdapterOrdinal, cpars.DeviceType, mode.Format, 0, D3DRTYPE_TEXTURE, D3DFMT_A8R8G8B8);
- if(FAILED(hr)) {
+ if (FAILED(hr))
+ {
IDirect3D9_Release(d3d);
return D3DXERR_INVALIDDATA;
}
IDirect3D9_Release(d3d);
- object = HeapAlloc(GetProcessHeap(), 0, sizeof(struct d3dx_font));
- if(object==NULL) {
- *font=NULL;
+ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct d3dx_font));
+ if (!object)
+ {
+ *font = NULL;
return E_OUTOFMEMORY;
}
object->ID3DXFont_iface.lpVtbl = &D3DXFont_Vtbl;
- object->ref=1;
- object->device=device;
- object->desc=*desc;
+ object->ref = 1;
+ object->device = device;
+ object->desc = *desc;
object->hdc = CreateCompatibleDC(NULL);
- if( !object->hdc ) {
+ if (!object->hdc)
+ {
HeapFree(GetProcessHeap(), 0, object);
return D3DXERR_INVALIDDATA;
}
object->hfont = CreateFontW(desc->Height, desc->Width, 0, 0, desc->Weight, desc->Italic, FALSE, FALSE, desc->CharSet,
desc->OutputPrecision, CLIP_DEFAULT_PRECIS, desc->Quality, desc->PitchAndFamily, desc->FaceName);
- if( !object->hfont ) {
+ if (!object->hfont)
+ {
DeleteDC(object->hdc);
HeapFree(GetProcessHeap(), 0, object);
return D3DXERR_INVALIDDATA;
}
SelectObject(object->hdc, object->hfont);
+ SetTextColor(object->hdc, 0x00ffffff);
+ SetBkColor(object->hdc, 0x00000000);
IDirect3DDevice9_AddRef(device);
- *font=&object->ID3DXFont_iface;
+ *font = &object->ID3DXFont_iface;
return D3D_OK;
}
diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c
index c26aa72..3aac499 100644
--- a/dlls/d3dx9_36/mesh.c
+++ b/dlls/d3dx9_36/mesh.c
@@ -5184,6 +5184,9 @@ HRESULT WINAPI D3DXCreateTextA(struct IDirect3DDevice9 *device, HDC hdc, const c
len = MultiByteToWideChar(CP_ACP, 0, text, -1, NULL, 0);
textW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
+ if (!textW) {
+ return E_OUTOFMEMORY;
+ }
MultiByteToWideChar(CP_ACP, 0, text, -1, textW, len);
hr = D3DXCreateTextW(device, hdc, textW, deviation, extrusion,
diff --git a/dlls/d3dx9_36/tests/core.c b/dlls/d3dx9_36/tests/core.c
index 90b678f..414671a 100644
--- a/dlls/d3dx9_36/tests/core.c
+++ b/dlls/d3dx9_36/tests/core.c
@@ -321,6 +321,8 @@ static void test_ID3DXFont(IDirect3DDevice9 *device)
{ 12, 256, 5 },
{ 72, 256, 8 }
};
+ static const WCHAR testW[] = {'t','e','s','t',0};
+ static const char testA[] = "test";
/* D3DXCreateFont */
@@ -463,7 +465,6 @@ static void test_ID3DXFont(IDirect3DDevice9 *device)
/* ID3DXFont_PreloadText */
hr = D3DXCreateFontA(device, 12, 0, FW_DONTCARE, 0, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "Arial", &font);
if(SUCCEEDED(hr)) {
- const WCHAR testW[] = {'t','e','s','t',0};
todo_wine {
hr = ID3DXFont_PreloadTextA(font, NULL, -1);
@@ -591,6 +592,67 @@ static void test_ID3DXFont(IDirect3DDevice9 *device)
}
ID3DXFont_Release(font);
}
+
+ /* ID3DXFont_DrawTextA, ID3DXFont_DrawTextW */
+ hr = D3DXCreateFontA(device, 12, 0, FW_DONTCARE, 0, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "Arial", &font);
+ if (SUCCEEDED(hr)) {
+ RECT rect;
+ int height;
+
+ SetRect(&rect, 10, 10, 200, 200);
+
+ height = ID3DXFont_DrawTextA(font, NULL, testA, -2, &rect, 0, 0xFF00FF);
+ ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
+
+ height = ID3DXFont_DrawTextA(font, NULL, testA, -1, &rect, 0, 0xFF00FF);
+ ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
+
+ height = ID3DXFont_DrawTextA(font, NULL, testA, 0, &rect, 0, 0xFF00FF);
+ ok(height == 0, "DrawTextA returned %d, expected 0.\n", height);
+
+ height = ID3DXFont_DrawTextA(font, NULL, testA, 1, &rect, 0, 0xFF00FF);
+ ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
+
+ height = ID3DXFont_DrawTextA(font, NULL, testA, 2, &rect, 0, 0xFF00FF);
+ ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
+
+ height = ID3DXFont_DrawTextA(font, NULL, testA, -1, NULL, 0, 0xFF00FF);
+ ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
+
+ height = ID3DXFont_DrawTextA(font, NULL, testA, -1, NULL, DT_CALCRECT, 0xFF00FF);
+ ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
+
+ height = ID3DXFont_DrawTextA(font, NULL, NULL, -1, NULL, 0, 0xFF00FF);
+ ok(height == 0, "DrawTextA returned %d, expected 0.\n", height);
+
+if (0) { /* Causes a lockup on windows 7. */
+ height = ID3DXFont_DrawTextW(font, NULL, testW, -2, &rect, 0, 0xFF00FF);
+ ok(height == 12, "DrawTextW returned %d, expected 12.\n", height);
+}
+
+ height = ID3DXFont_DrawTextW(font, NULL, testW, -1, &rect, 0, 0xFF00FF);
+ ok(height == 12, "DrawTextW returned %d, expected 12.\n", height);
+
+ height = ID3DXFont_DrawTextW(font, NULL, testW, 0, &rect, 0, 0xFF00FF);
+ ok(height == 0, "DrawTextW returned %d, expected 0.\n", height);
+
+ height = ID3DXFont_DrawTextW(font, NULL, testW, 1, &rect, 0, 0xFF00FF);
+ ok(height == 12, "DrawTextW returned %d, expected 12.\n", height);
+
+ height = ID3DXFont_DrawTextW(font, NULL, testW, 2, &rect, 0, 0xFF00FF);
+ ok(height == 12, "DrawTextW returned %d, expected 12.\n", height);
+
+ height = ID3DXFont_DrawTextW(font, NULL, testW, -1, NULL, 0, 0xFF00FF);
+ ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
+
+ height = ID3DXFont_DrawTextW(font, NULL, testW, -1, NULL, DT_CALCRECT, 0xFF00FF);
+ ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
+
+ height = ID3DXFont_DrawTextW(font, NULL, NULL, -1, NULL, 0, 0xFF00FF);
+ ok(height == 0, "DrawTextA returned %d, expected 0.\n", height);
+
+ ID3DXFont_Release(font);
+ }
}
static void test_D3DXCreateRenderToSurface(IDirect3DDevice9 *device)
diff --git a/dlls/ddraw/main.c b/dlls/ddraw/main.c
index bb9e37f..8a57123 100644
--- a/dlls/ddraw/main.c
+++ b/dlls/ddraw/main.c
@@ -251,8 +251,14 @@ DDRAW_Create(const GUID *guid,
{
device_type = WINED3D_DEVICE_TYPE_HAL;
}
+ else if(guid && guid->Data1 == 0xaeb2cdd4)
+ {
+ device_type = WINED3D_DEVICE_TYPE_HAL;
+ }
else
{
+// FIXME("unknown guid call %x-%x-%x...\n", guid->Data1, guid->Data2,
+// guid->Data3);
device_type = 0;
}
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index db03303..8431920 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -597,6 +597,10 @@ static ULONG WINAPI ddraw_surface7_Release(IDirectDrawSurface7 *iface)
struct ddraw_surface *This = impl_from_IDirectDrawSurface7(iface);
ULONG refcount = InterlockedDecrement(&This->ref7);
+ if (!This) {
+ return 0;
+ }
+
TRACE("iface %p decreasing refcount to %u.\n", iface, refcount);
if (refcount == 0)
@@ -627,6 +631,10 @@ static ULONG WINAPI ddraw_surface3_Release(IDirectDrawSurface3 *iface)
struct ddraw_surface *This = impl_from_IDirectDrawSurface3(iface);
ULONG refcount = InterlockedDecrement(&This->ref3);
+ if (!This) {
+ return 0;
+ }
+
TRACE("iface %p decreasing refcount to %u.\n", iface, refcount);
if (refcount == 0)
@@ -642,6 +650,10 @@ static ULONG WINAPI ddraw_surface2_Release(IDirectDrawSurface2 *iface)
struct ddraw_surface *This = impl_from_IDirectDrawSurface2(iface);
ULONG refcount = InterlockedDecrement(&This->ref2);
+ if (!This) {
+ return 0;
+ }
+
TRACE("iface %p decreasing refcount to %u.\n", iface, refcount);
if (refcount == 0)
@@ -657,6 +669,10 @@ static ULONG WINAPI ddraw_surface1_Release(IDirectDrawSurface *iface)
struct ddraw_surface *This = impl_from_IDirectDrawSurface(iface);
ULONG refcount = InterlockedDecrement(&This->ref1);
+ if (!This) {
+ return 0;
+ }
+
TRACE("iface %p decreasing refcount to %u.\n", iface, refcount);
if (refcount == 0)
@@ -672,6 +688,10 @@ static ULONG WINAPI ddraw_gamma_control_Release(IDirectDrawGammaControl *iface)
struct ddraw_surface *This = impl_from_IDirectDrawGammaControl(iface);
ULONG refcount = InterlockedDecrement(&This->gamma_count);
+ if (!This) {
+ return 0;
+ }
+
TRACE("iface %p decreasing refcount to %u.\n", iface, refcount);
if (refcount == 0)
@@ -686,6 +706,10 @@ static ULONG WINAPI d3d_texture2_Release(IDirect3DTexture2 *iface)
{
struct ddraw_surface *surface = impl_from_IDirect3DTexture2(iface);
+ if (!surface) {
+ return DDERR_INVALIDPARAMS;
+ }
+
TRACE("iface %p.\n", iface);
return IUnknown_Release(surface->texture_outer);
@@ -695,6 +719,10 @@ static ULONG WINAPI d3d_texture1_Release(IDirect3DTexture *iface)
{
struct ddraw_surface *surface = impl_from_IDirect3DTexture(iface);
+ if (!surface) {
+ return DDERR_INVALIDPARAMS;
+ }
+
TRACE("iface %p.\n", iface);
return IUnknown_Release(surface->texture_outer);
@@ -735,6 +763,10 @@ static HRESULT WINAPI ddraw_surface7_GetAttachedSurface(IDirectDrawSurface7 *ifa
DDSCAPS2 our_caps;
int i;
+ if (!This) {
+ return DDERR_INVALIDPARAMS;
+ }
+
TRACE("iface %p, caps %p, attachment %p.\n", iface, Caps, Surface);
wined3d_mutex_lock();
@@ -821,6 +853,10 @@ static HRESULT WINAPI ddraw_surface4_GetAttachedSurface(IDirectDrawSurface4 *ifa
IDirectDrawSurface7 *attachment7;
HRESULT hr;
+ if (!surface) {
+ return DDERR_INVALIDPARAMS;
+ }
+
TRACE("iface %p, caps %p, attachment %p.\n", iface, caps, attachment);
hr = ddraw_surface7_GetAttachedSurface(&surface->IDirectDrawSurface7_iface,
@@ -847,6 +883,10 @@ static HRESULT WINAPI ddraw_surface3_GetAttachedSurface(IDirectDrawSurface3 *ifa
DDSCAPS2 caps2;
HRESULT hr;
+ if (!surface) {
+ return DDERR_INVALIDPARAMS;
+ }
+
TRACE("iface %p, caps %p, attachment %p.\n", iface, caps, attachment);
caps2.dwCaps = caps->dwCaps;
@@ -878,6 +918,10 @@ static HRESULT WINAPI ddraw_surface2_GetAttachedSurface(IDirectDrawSurface2 *ifa
DDSCAPS2 caps2;
HRESULT hr;
+ if (!surface) {
+ return DDERR_INVALIDPARAMS;
+ }
+
TRACE("iface %p, caps %p, attachment %p.\n", iface, caps, attachment);
caps2.dwCaps = caps->dwCaps;
@@ -909,6 +953,10 @@ static HRESULT WINAPI ddraw_surface1_GetAttachedSurface(IDirectDrawSurface *ifac
DDSCAPS2 caps2;
HRESULT hr;
+ if (!surface) {
+ return DDERR_INVALIDPARAMS;
+ }
+
TRACE("iface %p, caps %p, attachment %p.\n", iface, caps, attachment);
caps2.dwCaps = caps->dwCaps;
@@ -1037,6 +1085,10 @@ static HRESULT WINAPI ddraw_surface7_Lock(IDirectDrawSurface7 *iface,
{
struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface);
+ if (!surface) {
+ return DDERR_INVALIDPARAMS;
+ }
+
TRACE("iface %p, rect %s, surface_desc %p, flags %#x, h %p.\n",
iface, wine_dbgstr_rect(rect), surface_desc, flags, h);
@@ -1055,6 +1107,10 @@ static HRESULT WINAPI ddraw_surface4_Lock(IDirectDrawSurface4 *iface, RECT *rect
{
struct ddraw_surface *surface = impl_from_IDirectDrawSurface4(iface);
+ if (!surface) {
+ return DDERR_INVALIDPARAMS;
+ }
+
TRACE("iface %p, rect %s, surface_desc %p, flags %#x, h %p.\n",
iface, wine_dbgstr_rect(rect), surface_desc, flags, h);
@@ -1075,6 +1131,10 @@ static HRESULT WINAPI ddraw_surface3_Lock(IDirectDrawSurface3 *iface, RECT *rect
DDSURFACEDESC2 surface_desc2;
HRESULT hr;
+ if (!surface) {
+ return DDERR_INVALIDPARAMS;
+ }
+
TRACE("iface %p, rect %s, surface_desc %p, flags %#x, h %p.\n",
iface, wine_dbgstr_rect(rect), surface_desc, flags, h);
@@ -1101,6 +1161,10 @@ static HRESULT WINAPI ddraw_surface2_Lock(IDirectDrawSurface2 *iface, RECT *rect
DDSURFACEDESC2 surface_desc2;
HRESULT hr;
+ if (!surface) {
+ return DDERR_INVALIDPARAMS;
+ }
+
TRACE("iface %p, rect %s, surface_desc %p, flags %#x, h %p.\n",
iface, wine_dbgstr_rect(rect), surface_desc, flags, h);
@@ -1126,6 +1190,10 @@ static HRESULT WINAPI ddraw_surface1_Lock(IDirectDrawSurface *iface, RECT *rect,
struct ddraw_surface *surface = impl_from_IDirectDrawSurface(iface);
DDSURFACEDESC2 surface_desc2;
HRESULT hr;
+ if (!surface) {
+ return DDERR_INVALIDPARAMS;
+ }
+
TRACE("iface %p, rect %s, surface_desc %p, flags %#x, h %p.\n",