2 * Unit tests for OLE storage
4 * Copyright (c) 2004 Mike McCormack
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "wine/test.h"
33 DEFINE_GUID( test_stg_cls, 0x88888888, 0x0425, 0x0000, 0,0,0,0,0,0,0,0);
35 void test_hglobal_storage_stat(void)
37 ILockBytes *ilb = NULL;
43 r = CreateILockBytesOnHGlobal( NULL, TRUE, &ilb );
44 ok( r == S_OK, "CreateILockBytesOnHGlobal failed\n");
46 mode = STGM_CREATE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE;/*0x1012*/
47 r = StgCreateDocfileOnILockBytes( ilb, mode, 0, &stg );
48 ok( r == S_OK, "CreateILockBytesOnHGlobal failed\n");
50 r = WriteClassStg( stg, &test_stg_cls );
51 ok( r == S_OK, "WriteClassStg failed\n");
53 memset( &stat, 0, sizeof stat );
54 r = IStorage_Stat( stg, &stat, 0 );
56 ok( stat.pwcsName == NULL, "storage name not null\n");
57 ok( stat.type == 1, "type is wrong\n");
59 ok( stat.grfMode == 0x12, "grf mode is incorrect\n");
61 ok( !memcmp(&stat.clsid, &test_stg_cls, sizeof test_stg_cls), "CLSID is wrong");
63 refcount = IStorage_Release( stg );
64 ok( refcount == 0, "IStorage refcount is wrong\n");
65 refcount = ILockBytes_Release( ilb );
66 ok( refcount == 0, "ILockBytes refcount is wrong\n");
71 test_hglobal_storage_stat();