ReactOS 0.4.15-dev-7961-gdcf9eb0
global_mem.c
Go to the documentation of this file.
1/* File: global_mem.c
2**
3** This program is a test application used for testing correctness of the
4** GlobalXXX memory API implementation.
5**
6** Programmer: Mark Tempel
7*/
8#include <windows.h>
9#include <stdio.h>
10#include <string.h>
11
12/*
13** All output is line wrapped to fit a 80 column screen.
14** these defines control that formatting. To shrink the
15** screen columns, just change the DISPLAY_COMUMNS macro.
16*/
17#define DISPLAY_COLUMNS 78
18#define LINE_BUFFER_SIZE DISPLAY_COLUMNS + 2
19
20/*
21** This define controls the size of a memory allocation request.
22** For this test suite to really be comprehensive, we should
23** probably be testing many different block sizes.
24*/
25#define MEM_BLOCK_SIZE 0x80000
26
27/*
28** This enumeration is really the return value for the program.
29** All test return a TestStatus and test statuses can be combined
30** with the relation TEST_CombineStatus.
31*/
32typedef enum TestStatus
33{
34 FAILED = 0,
35 PASSED = 1,
36 SKIPPED = -1
38
39/*---------------------------------------------------------------------------
40** This is a relation used to combine two test statuses.
41** The combine rules are as follows:
42** FAIL & Anything == FAIL
43** SKIPPED & Anything == Anything
44**
45*/
47{
49
50 switch (a)
51 {
52 case PASSED: result = (PASSED == b || SKIPPED == b) ? (PASSED) : (FAILED); break;
53 case FAILED: result = FAILED; break;
54 case SKIPPED: result = b; break;
55 }
56
57 return result;
58}
59
60/*---------------------------------------------------------------------------
61** This outputs the banner border lines.
62*/
64{
65 int c = 0;
66 printf("+");
67 for (c = 1; c < DISPLAY_COLUMNS; c++)
68 {
69 printf("-");
70 }
71 printf("\n");
72}
73
74
75/*---------------------------------------------------------------------------
76** This method prints a line that has a | on the left, and is line wrapped
77** to be no more that DISPLAY_COLUMNS +2 wide.
78*/
79void OUTPUT_Line(const char *szLine)
80{
81 int spaceIndex = 0;
82 char output[LINE_BUFFER_SIZE];
83
84 memset(output, 0, DISPLAY_COLUMNS + 2);
85
86 /*If this line is longer than DISPLAY_COLUMNS,
87 * break it at the first space.
88 */
89 if (DISPLAY_COLUMNS - 2 < strlen(szLine))
90 {
91 for (spaceIndex = DISPLAY_COLUMNS / 2; spaceIndex < DISPLAY_COLUMNS - 2; spaceIndex++)
92 {
93 if (' ' == szLine[spaceIndex])
94 {
95 break;
96 }
97 }
98
99 memcpy(output + 2, szLine, spaceIndex + 1);
100 output[0] = '|';
101 output[1] = ' ';
102 output[strlen(output)] = '\n';
103 printf(output);
104
105 OUTPUT_Line(szLine + spaceIndex + 1);
106 }
107 else
108 {
109 sprintf(output,"| %s\n", szLine);
110 printf(output);
111 }
112
113}
114
115/*---------------------------------------------------------------------------
116**
117*/
118void OUTPUT_Banner(const char *szBanner)
119{
121 OUTPUT_Line(szBanner);
123}
124
125/*---------------------------------------------------------------------------
126**
127*/
129{
130 switch (status)
131 {
132 case PASSED: OUTPUT_Line("==> PASSED"); break;
133 case FAILED: OUTPUT_Line("*** FAILED"); break;
134 case SKIPPED: OUTPUT_Line("==> SKIPPED"); break;
135 }
136 OUTPUT_Line("");
137}
138
139/*---------------------------------------------------------------------------
140**
141*/
143{
144 char buffer[32];
145 sprintf(buffer, "0x%lX",dw);
147}
148
150{
151 char buffer[32];
152 sprintf(buffer, "0x%p", h);
154}
155
156/*---------------------------------------------------------------------------
157**
158*/
160{
161 if (pFlags & GMEM_MOVEABLE)
162 {
163 OUTPUT_Line("Movable Memory");
164 }
165 else
166 {
167 OUTPUT_Line("Fixed Memory");
168 }
169
170 if (pFlags & GMEM_ZEROINIT)
171 {
172 OUTPUT_Line("Zero Initialized Memory");
173 }
174}
175
176/*---------------------------------------------------------------------------
177**
178*/
180{
181 char buffer[256];
182
183 sprintf(buffer,"GetLastError() returned %lu", GetLastError());
184
186}
187/*---------------------------------------------------------------------------
188**
189*/
191{
193
194 if (0 == IsBadWritePtr(mem, cbSize))
195 {
196 result = PASSED;
197 }
198 return result;
199}
200
201/*---------------------------------------------------------------------------
202**
203*/
205{
207
208 if (0 == IsBadReadPtr(mem, cbSize))
209 {
210 result = PASSED;
211 }
212 return result;
213}
214
215/*---------------------------------------------------------------------------
216** This method tests to see if a block of global memory is movable
217** by seeing if the value returned from GlobalLock is different from
218** the passed in value.
219*/
221{
222 LPVOID pMem = 0;
223 int rc = 0;
224
225 pMem = GlobalLock(hMem);
226 if (pMem != hMem)
227 {
228 rc = 1;
229 }
230 GlobalUnlock(hMem);
231
232 return rc;
233}
234
235/*---------------------------------------------------------------------------
236**
237*/
239{
241 HGLOBAL hTest = 0;
242 OUTPUT_Banner("Testing the GlobalAlloc and GlobalFree calls");
243 OUTPUT_Line("Allocate a buffer");
244
245 OutputAllocFlags(allocFlags);
246
247 status = FAILED;
248 hTest = GlobalAlloc(allocFlags, MEM_BLOCK_SIZE);
249 if (0 != hTest)
250 {
251 if (0 == GlobalFree(hTest))
252 {
253 status = PASSED;
254 }
255 }
256
257 OUTPUT_Line("Result for this run:");
259 OUTPUT_Line("");
260
261 return status;
262}
263
264/*---------------------------------------------------------------------------
265**
266*/
268{
269 HGLOBAL hMem = 0;
270 LPVOID pMem = 0;
273
274 OUTPUT_Banner("Testing the GlobalLock/Unlock functions.");
275 OutputAllocFlags(allocFlags);
276 OUTPUT_Line("");
277
278 hMem = GlobalAlloc(allocFlags, MEM_BLOCK_SIZE);
279 if (0 != hMem)
280 {
281 OUTPUT_Line("Allocated a memory block");
282
283 OUTPUT_Line("Testing Lock");
284 pMem = GlobalLock(hMem);
285 if (0 != pMem)
286 {
288
289 OUTPUT_Line("Testing memory for read.");
293
294
295 OUTPUT_Line("Testing memory for write.");
299
300
301 OUTPUT_Line("Unlocking memory");
302 if (GlobalUnlock(hMem))
303 {
306 }
307 else
308 {
309 if (NO_ERROR == GetLastError())
310 {
313 }
314 else
315 {
319 }
320 }
321 }
322
323 OUTPUT_Line("Freeing memory");
324 if (0 == GlobalFree(hMem))
325 {
328 }
329 else
330 {
334 }
335 }
336 return result;
337}
338
339/*---------------------------------------------------------------------------
340**
341*/
343{
344 HGLOBAL hMem = 0;
345 HGLOBAL hReAlloced = 0;
346 LPVOID pMem = 0;
349
350 OUTPUT_Line("Testing GlobalReAlloc() on memory allocated as GMEM_FIXED");
351
352 /* Case 1: convert a fixed block to a movable block. */
353 OUTPUT_Line("Allocating buffer");
355 if (0 != hMem)
356 {
357 OUTPUT_Line("Testing to see if this is converted into a movable block");
358 hReAlloced = GlobalReAlloc(hMem, MEM_BLOCK_SIZE + 100, GMEM_MOVEABLE | GMEM_MODIFY);
359 if (0 == hReAlloced)
360 {
361 OUTPUT_Line("GlobalReAlloc failed-- returned NULL");
364 }
365 else
366 {
367 hMem = hReAlloced;
368 if (0 == IsMovable(hMem))
369 {
370 OUTPUT_Line("GlobalReAlloc returned a fixed pointer.");
373 }
374 else
375 {
376 pMem = GlobalLock(hMem);
379 if (FAILED == subtest)
380 {
381 OUTPUT_Line("Memory Read failed.");
382 }
384 if (FAILED == subtest)
385 {
386 OUTPUT_Line("Memory Write failed.");
387 }
388 GlobalUnlock(hMem);
389 }
390 }
391
392 GlobalFree(hMem);
393 }
394 else
395 {
396 OUTPUT_Line("Global Alloc Failed.");
398 }
399 OUTPUT_Line("Subtest result:");
401 OUTPUT_Line("");
402
405
406 /* case 2 only move a fixed block */
407 OUTPUT_Line("Allocating buffer");
409 if (0 != hMem)
410 {
411 OUTPUT_Line("Testing to see if a new fixed block is returned.");
412 hReAlloced = GlobalReAlloc(hMem, MEM_BLOCK_SIZE - 100, GMEM_MOVEABLE);
413 if (0 == hReAlloced)
414 {
415 OUTPUT_Line("GlobalReAlloc failed-- returned NULL");
418 }
419 else
420 {
421 OUTPUT_Line("Alloced Handle: ");
422 OUTPUT_Handle(hMem);
423 OUTPUT_Line("ReAlloced Handle: ");
424 OUTPUT_Handle(hReAlloced);
425 if (hMem == hReAlloced)
426 {
427 OUTPUT_Line("GlobalReAlloc returned the same pointer. The documentation states that this is wrong, but Windows NT works this way.");
428 }
429
430 hMem = hReAlloced;
434 }
435
436 GlobalFree(hMem);
437 }
438 else
439 {
441 }
442 OUTPUT_Line("Subtest result:");
444 OUTPUT_Line("");
445
448
449 /* Case 3: re-allocate a fixed block in place */
450 OUTPUT_Line("Allocating buffer");
452 if (0 != hMem)
453 {
454 OUTPUT_Line("Testing to see if a fixed pointer is reallocated in place.");
455 hReAlloced = GlobalReAlloc(hMem, MEM_BLOCK_SIZE - 100, 0);
456 if (0 == hReAlloced)
457 {
458 OUTPUT_Line("GlobalReAlloc failed-- returned NULL");
461 }
462 else
463 {
464 OUTPUT_Line("Alloced Handle: ");
465 OUTPUT_Handle(hMem);
466 OUTPUT_Line("ReAlloced Handle: ");
467 OUTPUT_Handle(hReAlloced);
468 if (hMem != hReAlloced)
469 {
470 OUTPUT_Line("GlobalReAlloc returned a different.");
473 }
474 else
475 {
479 }
480 }
481
482 GlobalFree(hMem);
483 }
484 else
485 {
487 }
488 OUTPUT_Line("Subtest result:");
490 OUTPUT_Line("");
491
493
494 OUTPUT_Line("");
495 return result;
496}
497/*---------------------------------------------------------------------------
498**
499*/
501{
502 HGLOBAL hMem = 0;
503 HGLOBAL hReAlloced = 0;
504 LPVOID pMem = 0;
507
508 OUTPUT_Line("Testing GlobalReAlloc() on memory allocated as GMGM_MOVEABLE");
509
510 /* case 1 test reallocing a movable block that is unlocked. */
511 OUTPUT_Line("Allocating buffer");
513 if (0 != hMem)
514 {
515 OUTPUT_Line("Testing GlobalReAlloc on a unlocked block.");
516 hReAlloced = GlobalReAlloc(hMem, MEM_BLOCK_SIZE - 100, 0);
517 if (0 == hReAlloced)
518 {
519 OUTPUT_Line("GlobalReAlloc failed-- returned NULL");
522 }
523 else
524 {
525 OUTPUT_Line("Alloced Handle: ");
526 OUTPUT_Handle(hMem);
527 OUTPUT_Line("ReAlloced Handle: ");
528 OUTPUT_Handle(hReAlloced);
529
530 pMem = GlobalLock(hReAlloced);
531 hMem = hReAlloced;
535 GlobalUnlock(hReAlloced);
536 }
537
538 GlobalFree(hMem);
539 }
540 else
541 {
543 }
544 OUTPUT_Line("Subtest result:");
546 OUTPUT_Line("");
547
550
551 /* Case 2: re-allocate a moveable block that is locked */
552 OUTPUT_Line("Allocating buffer");
554 if (0 != hMem)
555 {
556
557 OUTPUT_Line("Testing GlobalReAlloc on a locked block.");
558 pMem = GlobalLock(hMem);
559 hReAlloced = GlobalReAlloc(hMem, MEM_BLOCK_SIZE - 100, 0);
560 if (0 == hReAlloced)
561 {
562 OUTPUT_Line("GlobalReAlloc failed-- returned NULL");
565 }
566 else
567 {
568 OUTPUT_Line("Alloced Handle: ");
569 OUTPUT_Handle(hMem);
570 OUTPUT_Line("ReAlloced Handle: ");
571 OUTPUT_Handle(hReAlloced);
572 if (hMem != hReAlloced)
573 {
574 OUTPUT_Line("GlobalReAlloc returned a different block.");
575 }
576 pMem = GlobalLock(hReAlloced);
580 GlobalUnlock(hReAlloced);
581
582 }
583
584 GlobalUnlock(hMem);
585
586 GlobalFree(hMem);
587 }
588 else
589 {
591 }
592 OUTPUT_Line("Subtest result:");
594 OUTPUT_Line("");
595
597
598 OUTPUT_Line("");
599 return result;
600}
601
602/*---------------------------------------------------------------------------
603**
604*/
606{
608 OUTPUT_Banner("Testing GlobalReAlloc()");
609
612
613 OUTPUT_Line("GlobalReAlloc test result:");
615 return result;
616}
617
618/*---------------------------------------------------------------------------
619**
620*/
622{
623 HGLOBAL hMem = 0;
624 UINT uFlags = 0;
626
627 OUTPUT_Line("Test for the proper lock count");
628
630 if (0 != hMem)
631 {
632
633 OUTPUT_Line("Testing initial allocation");
634
635 OUTPUT_Line("Testing for a lock of 0");
636 uFlags = GlobalFlags(hMem);
637 if (((GMEM_LOCKCOUNT & uFlags) == 0)) /*no locks*/
638 {
640 }
641 else
642 {
644 }
646
647 OUTPUT_Line("Pointer from handle: ");
649
650 OUTPUT_Line("Testing after a lock");
651 OUTPUT_Line("Testing for a lock of 1");
652 uFlags = GlobalFlags(hMem);
653 if (((GMEM_LOCKCOUNT & uFlags) == 1)) /*no locks*/
654 {
656 }
657 else
658 {
660 }
662
663 GlobalUnlock(hMem);
664 OUTPUT_Line("Testing after an unlock");
665 OUTPUT_Line("Testing for a lock of 0");
666 uFlags = GlobalFlags(hMem);
667 if (((GMEM_LOCKCOUNT & uFlags) == 0)) /*no locks*/
668 {
670 }
671 else
672 {
674 }
676 }
677 else
678 {
679 OUTPUT_Line("GlobalAlloc failed!");
681 }
682
683 OUTPUT_Line("Test for discarded memory");
684 OUTPUT_Line("Allocating an empty moveable block---automatically marked as discarded");
685 hMem = GlobalAlloc(GMEM_MOVEABLE, 0); /*allocate a discarded block*/
686 if (0 != hMem)
687 {
688 OUTPUT_Line("Allocation handle: ");
689 OUTPUT_Handle(hMem);
690 OUTPUT_Line("Testing for a discarded flag");
691 uFlags = GlobalFlags(hMem);
692 if (0 != (uFlags & GMEM_DISCARDED)) /*discarded*/
693 {
695 }
696 else
697 {
699 }
700 OUTPUT_Line("Flags:");
703
704 GlobalFree(hMem);
705 }
706 else
707 {
708 OUTPUT_Line("GlobalAlloc failed!");
710 }
711 return result;
712}
713
714
715/*---------------------------------------------------------------------------
716**
717*/
719{
720 HGLOBAL hMem = 0;
721 UINT uFlags = 0;
723
724 OUTPUT_Line("Testing for correct handling of GMEM_FIXED memory");
726 if (0 != hMem)
727 {
728
729 OUTPUT_Line("Allocation handle: ");
730 OUTPUT_Handle(hMem);
731
732 OUTPUT_Line("Testing initial allocation");
733 OUTPUT_Line("Testing for non-discarded and lock of 0");
734 uFlags = GlobalFlags(hMem);
735 if (((GMEM_LOCKCOUNT & uFlags) == 0) && /*no locks*/
736 (((uFlags >> 8) & 0xff) == 0 )) /*not discarded*/
737 {
739 }
740 else
741 {
743 }
745
746 OUTPUT_Line("Pointer from handle: ");
748 OUTPUT_Line("Testing after a lock");
749 OUTPUT_Line("Testing for non-discarded and lock of 0");
750 uFlags = GlobalFlags(hMem);
751 if (((GMEM_LOCKCOUNT & uFlags) == 0) && /*no locks*/
752 (((uFlags >> 8) & 0xff) == 0 )) /*not discarded*/
753 {
755 }
756 else
757 {
759 }
761
762 GlobalFree(hMem);
763 }
764 else
765 {
766 OUTPUT_Line("GlobalAlloc failed!");
768 }
769
770 return result;
771}
772/*---------------------------------------------------------------------------
773**
774*/
776{
778 OUTPUT_Banner("Testing GlobalFlags()");
779
782
783 OUTPUT_Line("GlobalFlags result:");
785 return result;
786}
787/*---------------------------------------------------------------------------
788**
789*/
791{
792 HGLOBAL hMem = 0;
793 HGLOBAL hTest = 0;
794 PVOID pMem = 0;
797
798 OUTPUT_Banner("Testing GlobalHandle()");
799
800 OUTPUT_Line("Testing GlobalHandle with a block of GMEM_FIXED memory");
802 if (0 != hMem)
803 {
804
805 OUTPUT_Line("Allocation handle: ");
806 OUTPUT_Handle(hMem);
807
808 hTest = GlobalHandle(hMem);
809 if (hMem == hTest)
810 {
812 }
813 else
814 {
815 OUTPUT_Line("GlobalHandle returned:");
816 OUTPUT_Handle(hTest);
818 }
819
820 GlobalFree(hMem);
821 }
822 else
823 {
824 OUTPUT_Line("GlobalAlloc failed!");
826 }
827
828 OUTPUT_Line("Result from subtest:");
831
832
834 OUTPUT_Line("Testing GlobalHandle with a block of GMEM_MOVEABLE memory");
836 if (0 != hMem)
837 {
838
839 OUTPUT_Line("Allocation handle: ");
840 OUTPUT_Handle(hMem);
841 pMem = GlobalLock(hMem);
842 hTest = GlobalHandle(pMem);
843 if (hMem == hTest)
844 {
846 }
847 else
848 {
849 OUTPUT_Line("GlobalHandle returned:");
850 OUTPUT_Handle(hTest);
852 }
853
854 GlobalUnlock(hMem);
855 GlobalFree(hMem);
856 }
857 else
858 {
859 OUTPUT_Line("GlobalAlloc failed!");
861 }
862
863 OUTPUT_Line("Result from subtest:");
866
867
868 OUTPUT_Line("Global Handle test results:");
870 return result;
871}
872
873/*---------------------------------------------------------------------------
874**
875*/
877{
878 HGLOBAL hMem = 0;
879 SIZE_T size = 0;
882 OUTPUT_Banner("Testing GlobalSize()");
883
884 OUTPUT_Line("Testing GlobalSize with a block of GMEM_FIXED memory");
886 if (0 != hMem)
887 {
888 size = GlobalSize(hMem);
889 if (MEM_BLOCK_SIZE <= size)
890 {
892 }
893 else
894 {
895 OUTPUT_Line("GlobalSize returned:");
898 }
899
900 GlobalFree(hMem);
901 }
902 else
903 {
904 OUTPUT_Line("GlobalAlloc failed!");
906 }
907
908 OUTPUT_Line("Result from subtest:");
911
912 OUTPUT_Line("Testing GlobalSize with a block of GMEM_MOVEABLE memory");
914 if (0 != hMem)
915 {
916 size = GlobalSize(hMem);
917 if (MEM_BLOCK_SIZE <= size)
918 {
920 }
921 else
922 {
923 OUTPUT_Line("GlobalSize returned:");
926 }
927
928 GlobalFree(hMem);
929 }
930 else
931 {
932 OUTPUT_Line("GlobalAlloc failed!");
934 }
935
936 OUTPUT_Line("Result from subtest:");
939
940 OUTPUT_Line("Testing GlobalSize with discarded memory");
941 hMem = GlobalAlloc(GMEM_MOVEABLE, 0);
942 if (0 != hMem)
943 {
944 size = GlobalSize(hMem);
945 if (0 == size)
946 {
948 }
949 else
950 {
951 OUTPUT_Line("GlobalSize returned:");
954 }
955
956 GlobalFree(hMem);
957 }
958 else
959 {
960 OUTPUT_Line("GlobalAlloc failed!");
962 }
963
964 OUTPUT_Line("Result from subtest:");
967
968 OUTPUT_Line("Test result:");
970 return result;
971}
972
973/*---------------------------------------------------------------------------
974**
975*/
977{
978 HGLOBAL hMem = 0;
979 HGLOBAL hTest = 0;
980 DWORD uFlags = 0;
983
984 OUTPUT_Banner("Testing GlobalDiscard()");
986 if (0 != hMem)
987 {
988 OUTPUT_Line("Allocation handle: ");
989 OUTPUT_Handle(hMem);
990
991 hTest = GlobalDiscard(hMem);
992 if (0 == hTest)
993 {
994 OUTPUT_Line("GlobalDiscard returned NULL");
996 }
997 else
998 {
999 uFlags = GlobalFlags(hTest);
1000 OUTPUT_Line("Flags from the new memory block.");
1002 if (0 != (uFlags & GMEM_DISCARDED))
1003 {
1005 }
1006 else
1007 {
1008 OUTPUT_Line("Block is not marked as discardable.");
1010 }
1011 }
1012
1013 GlobalFree(hTest);
1014 }
1015 else
1016 {
1017 OUTPUT_Line("GlobalAlloc failed!");
1019 }
1020
1021 OUTPUT_Line("Result from subtest:");
1023
1025
1027 return result;
1028}
1029
1030/*---------------------------------------------------------------------------
1031**
1032*/
1033int main(int argc, char ** argv)
1034{
1036 OUTPUT_Banner("Testing GlobalXXX memory management functions.");
1037
1042
1043 if (FAILED == test_set)
1044 {
1045 OUTPUT_Line("Skipping any further tests. GlobalAlloc/Free fails.");
1047 return test_set;
1048 }
1049
1054
1056
1058
1060
1062
1064
1065 /* output the result for the entire set of tests*/
1066 OUTPUT_Banner("Test suite result");
1068 return test_set;
1069}
static int argc
Definition: ServiceArgs.c:12
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define NO_ERROR
Definition: dderror.h:5
UINT uFlags
Definition: api.c:59
BOOL WINAPI IsBadReadPtr(IN LPCVOID lp, IN UINT_PTR ucb)
Definition: except.c:805
BOOL NTAPI IsBadWritePtr(IN LPVOID lp, IN UINT_PTR ucb)
Definition: except.c:883
int main()
Definition: test.c:6
unsigned long DWORD
Definition: ntddk_ex.h:95
#define printf
Definition: freeldr.h:97
GLsizeiptr size
Definition: glext.h:5919
GLuint buffer
Definition: glext.h:5915
const GLubyte * c
Definition: glext.h:8905
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
GLuint64EXT * result
Definition: glext.h:11304
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
TEST_STATUS TEST_MemoryWrite(LPVOID mem, DWORD cbSize)
Definition: global_mem.c:190
int IsMovable(HGLOBAL hMem)
Definition: global_mem.c:220
void OUTPUT_HexDword(DWORD dw)
Definition: global_mem.c:142
enum TestStatus TEST_STATUS
TEST_STATUS TEST_CombineStatus(TEST_STATUS a, TEST_STATUS b)
Definition: global_mem.c:46
TEST_STATUS TEST_MemoryRead(LPVOID mem, DWORD cbSize)
Definition: global_mem.c:204
void OUTPUT_Banner(const char *szBanner)
Definition: global_mem.c:118
void OutputErrorCode()
Definition: global_mem.c:179
TEST_STATUS TestGlobalReAllocFixed()
Definition: global_mem.c:342
TEST_STATUS TestGlobalDiscard()
Definition: global_mem.c:976
TEST_STATUS TestGlobalFlagsFixed()
Definition: global_mem.c:718
TEST_STATUS TestGlobalLockNUnlock(UINT allocFlags)
Definition: global_mem.c:267
TEST_STATUS TestGlobalFlags()
Definition: global_mem.c:775
void OutputAllocFlags(UINT pFlags)
Definition: global_mem.c:159
#define DISPLAY_COLUMNS
Definition: global_mem.c:17
TEST_STATUS TestGlobalAllocNFree(UINT allocFlags)
Definition: global_mem.c:238
#define MEM_BLOCK_SIZE
Definition: global_mem.c:25
TEST_STATUS TestGlobalReAllocMovable()
Definition: global_mem.c:500
TEST_STATUS TestGlobalFlagsMoveable()
Definition: global_mem.c:621
TEST_STATUS TestGlobalHandle()
Definition: global_mem.c:790
void OUTPUT_BannerLine()
Definition: global_mem.c:63
TEST_STATUS TestGlobalReAlloc()
Definition: global_mem.c:605
TEST_STATUS TestGlobalSize()
Definition: global_mem.c:876
void OUTPUT_Handle(HANDLE h)
Definition: global_mem.c:149
void OUTPUT_Line(const char *szLine)
Definition: global_mem.c:79
void OUTPUT_Result(TEST_STATUS status)
Definition: global_mem.c:128
TestStatus
Definition: global_mem.c:33
@ SKIPPED
Definition: global_mem.c:36
@ PASSED
Definition: global_mem.c:35
@ FAILED
Definition: global_mem.c:34
#define LINE_BUFFER_SIZE
Definition: global_mem.c:18
HGLOBAL NTAPI GlobalHandle(LPCVOID pMem)
Definition: heapmem.c:705
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
HGLOBAL NTAPI GlobalReAlloc(HGLOBAL hMem, SIZE_T dwBytes, UINT uFlags)
Definition: heapmem.c:825
UINT NTAPI GlobalFlags(HGLOBAL hMem)
Definition: heapmem.c:520
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
Definition: heapmem.c:1090
REFIID LPVOID DWORD_PTR dw
Definition: atlbase.h:40
#define a
Definition: ke_i.h:78
#define b
Definition: ke_i.h:79
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define sprintf(buf, format,...)
Definition: sprintf.c:55
#define argv
Definition: mplay32.c:18
unsigned int UINT
Definition: ndis.h:50
#define memset(x, y, z)
Definition: compat.h:39
Definition: mem.c:156
Definition: ps.c:97
Definition: pseh.c:2763
void test_set()
Definition: test_set.cpp:75
ULONG_PTR SIZE_T
Definition: typedefs.h:80
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define GMEM_LOCKCOUNT
Definition: winbase.h:309
#define GMEM_DISCARDED
Definition: winbase.h:307
#define GPTR
Definition: winbase.h:296
#define GMEM_ZEROINIT
Definition: winbase.h:306
#define GMEM_FIXED
Definition: winbase.h:293
#define GMEM_MODIFY
Definition: winbase.h:295
#define GHND
Definition: winbase.h:297
#define GMEM_MOVEABLE
Definition: winbase.h:294
#define GlobalDiscard(m)
Definition: winbase.h:2578