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 ok(ret == ERROR_NOT_CONNECTED, "WNetGetUniversalNameA gave wrong error: %08x\n", ret);
47 ok(info_size == sizeof(buffer), "Got wrong size: %u\n", info_size);
49 info_size = sizeof(buffer);
50 ret = WNetGetUniversalNameW(driveW, UNIVERSAL_NAME_INFO_LEVEL,
53 if(drive_type == DRIVE_REMOTE)
54 ok(ret == WN_NO_ERROR, "WNetGetUniversalNameW failed: %08x\n", ret);
56 ok(ret == ERROR_NOT_CONNECTED, "WNetGetUniversalNameW gave wrong error: %08x\n", ret);
58 ok(info_size == sizeof(buffer), "Got wrong size: %u\n", info_size);
64 test_WNetGetUniversalName();