2 * Copyright 2012 Andrew Eikum for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 #include "wine/test.h"
27 static void test_WNetGetUniversalName(void)
31 DWORD drive_type, info_size;
32 char driveA[] = "A:\\";
33 WCHAR driveW[] = {'A',':','\\',0};
35 for(; *driveA <= 'Z'; ++*driveA, ++*driveW){
36 drive_type = GetDriveTypeW(driveW);
38 info_size = sizeof(buffer);
39 ret = WNetGetUniversalNameA(driveA, UNIVERSAL_NAME_INFO_LEVEL,
42 if(drive_type == DRIVE_REMOTE)
43 ok(ret == WN_NO_ERROR, "WNetGetUniversalNameA failed: %08x\n", ret);
45 /* WN_NO_NET_OR_BAD_PATH (DRIVE_FIXED) returned from the virtual drive (usual Q:)
46 created by the microsoft application virtualization client */
47 ok((ret == WN_NOT_CONNECTED) || (ret == WN_NO_NET_OR_BAD_PATH),
48 "WNetGetUniversalNameA(%s, ...) returned %u (drive_type: %u)\n",
49 driveA, ret, drive_type);
51 ok(info_size == sizeof(buffer), "Got wrong size: %u\n", info_size);
53 info_size = sizeof(buffer);
54 ret = WNetGetUniversalNameW(driveW, UNIVERSAL_NAME_INFO_LEVEL,
57 if(drive_type == DRIVE_REMOTE)
58 ok(ret == WN_NO_ERROR, "WNetGetUniversalNameW failed: %08x\n", ret);
60 ok((ret == WN_NOT_CONNECTED) || (ret == WN_NO_NET_OR_BAD_PATH),
61 "WNetGetUniversalNameW(%s, ...) returned %u (drive_type: %u)\n",
62 wine_dbgstr_w(driveW), ret, drive_type);
64 ok(info_size == sizeof(buffer), "Got wrong size: %u\n", info_size);
70 test_WNetGetUniversalName();