https://bugs.winehq.org/show_bug.cgi?id=47072
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net Summary|Canon DPP 4.10.20 install |Canon DPP 4.10.20 installer |require Administrator |fails, reports: 'installer |Privileges |requires administrator | |privileges' (netapi32 | |'USER_INFO_1.usri1_priv' | |needs to return | |'USER_PRIV_ADMIN' for login | |session user) URL|https://www.softpedia.com/g |https://web.archive.org/web |et/Multimedia/Graphic/Image |/20190426101243/https://sof |-Convertors/Canon-Digital-P |tpedia-secure-download.com/ |hoto-Professional.shtml#dow |dl/509dff1cf1a87c679bc6f274 |nload |45871a28/5cc2d984/100078921 | |/software/multimedia/graphi | |c/digital_photo/dppw4.10.20 | |-installer.zip Keywords| |Installer
--- Comment #4 from Anastasius Focht focht@gmx.net --- Hello folks,
confirming.
Prerequisite: Installer needs 'winetricks -q msxml3' (another bug).
--- snip --- $ WINEDEBUG=+seh,+relay,+msi,+netapi32 wine ./dppw4.10.20-installer.exe
log.txt 2>&1
... 002a:Call KERNEL32.CreateProcessW(00000000,0034f370 L""C:\users\focht\Temp\Canon_Inc_IC_OFI_TEMP_0\Data\setup.exe"",00000000,00000000,00000000,00000410,00000000,00000000,0034db28,0034db18) ret=7db5176a ... 002d:Call KERNEL32.__wine_kernel_init() ret=7bc67e16 002d:Ret KERNEL32.__wine_kernel_init() retval=7b472c54 ret=7bc67e16 002a:Ret KERNEL32.CreateProcessW() retval=00000001 ret=7db5176a ... 002d:Call KERNEL32.CreateProcessW(00000000,0032f470 L""C:\users\focht\Temp\Canon_Inc_IC_OFI_TEMP_0\Data\software\install\UniversalInstaller.exe"",00000000,00000000,00000000,00000410,00000000,00000000,0032dc28,0032dc18) ret=7dc7d76a ... 002f:Call KERNEL32.__wine_kernel_init() ret=7bc67e16 002f:Ret KERNEL32.__wine_kernel_init() retval=7b472c54 ret=7bc67e16 002d:Ret KERNEL32.CreateProcessW() retval=00000001 ret=7dc7d76a ... 002f:Call wtsapi32.WTSQuerySessionInformationW(00000000,00000001,00000005,0032ecbc,0032ecac) ret=00467e52 002f:fixme:wtsapi:WTSQuerySessionInformationW Stub (nil) 0x00000001 5 0x32ecbc 0x32ecac 002f:Call advapi32.GetUserNameW(00000000,0032ec1c) ret=7d16f403 002f:Ret advapi32.GetUserNameW() retval=00000000 ret=7d16f403 002f:Call ntdll.RtlAllocateHeap(00110000,00000000,0000000c) ret=7d16f43a 002f:Ret ntdll.RtlAllocateHeap() retval=001dca70 ret=7d16f43a 002f:Call advapi32.GetUserNameW(001dca70,0032ec1c) ret=7d16f44c 002f:Ret advapi32.GetUserNameW() retval=00000001 ret=7d16f44c 002f:Ret wtsapi32.WTSQuerySessionInformationW() retval=00000001 ret=00467e52 002f:Call KERNEL32.lstrcpyW(0032ecc0,001dca70 L"focht") ret=00467e69 002f:Ret KERNEL32.lstrcpyW() retval=0032ecc0 ret=00467e69 002f:Call netapi32.NetUserGetInfo(00000000,0032ecc0 L"focht",00000001,0032ecb8) ret=00467e80 002f:Call KERNEL32.IsBadStringPtrW(0032ecc0,ffffffff) ret=7d1b9e25 002f:Ret KERNEL32.IsBadStringPtrW() retval=00000000 ret=7d1b9e25 002f:trace:netapi32:NetUserGetInfo ((null), L"focht", 1, 0x32ecb8) 002f:Call ntdll.RtlAllocateHeap(00110000,00000000,0000002a) ret=7d1bed4f 002f:Ret ntdll.RtlAllocateHeap() retval=001dea00 ret=7d1bed4f 002f:Call advapi32.GetUserNameW(001dea00,0032ec1c) ret=7d1bed67 002f:Ret advapi32.GetUserNameW() retval=00000001 ret=7d1bed67 002f:Call KERNEL32.lstrcmpW(001dea00 L"focht",0032ecc0 L"focht") ret=7d1beead 002f:Ret KERNEL32.lstrcmpW() retval=00000000 ret=7d1beead 002f:Call ntdll.RtlFreeHeap(00110000,00000000,001dea00) ret=7d1beecb 002f:Ret ntdll.RtlFreeHeap() retval=00000001 ret=7d1beecb 002f:Call KERNEL32.IsBadStringPtrW(0032ecc0,ffffffff) ret=7d1b9e25 002f:Ret KERNEL32.IsBadStringPtrW() retval=00000000 ret=7d1b9e25 002f:trace:netapi32:NetUserGetInfo ((null), L"focht", 0, 0x32ec1c) 002f:Call ntdll.RtlAllocateHeap(00110000,00000000,0000002a) ret=7d1bed4f 002f:Ret ntdll.RtlAllocateHeap() retval=001dea00 ret=7d1bed4f 002f:Call advapi32.GetUserNameW(001dea00,0032ebac) ret=7d1bed67 002f:Ret advapi32.GetUserNameW() retval=00000001 ret=7d1bed67 002f:Call KERNEL32.lstrcmpW(001dea00 L"focht",0032ecc0 L"focht") ret=7d1beead 002f:Ret KERNEL32.lstrcmpW() retval=00000000 ret=7d1beead 002f:Call ntdll.RtlFreeHeap(00110000,00000000,001dea00) ret=7d1beecb 002f:Ret ntdll.RtlFreeHeap() retval=00000001 ret=7d1beecb 002f:trace:netapi32:NetApiBufferAllocate (16, 0x32ec1c) 002f:Call ntdll.RtlAllocateHeap(00110000,00000000,00000010) ret=7d1bb1a3 002f:Ret ntdll.RtlAllocateHeap() retval=001db890 ret=7d1bb1a3 002f:Call KERNEL32.GetEnvironmentVariableW(7d1c91b0 L"HOME",00000000,00000000) ret=7d1bea88 002f:Ret KERNEL32.GetEnvironmentVariableW() retval=00000000 ret=7d1bea88 002f:trace:netapi32:NetApiBufferAllocate (50, 0x32ecb8) 002f:Call ntdll.RtlAllocateHeap(00110000,00000000,00000032) ret=7d1bb1a3 002f:Ret ntdll.RtlAllocateHeap() retval=001dea00 ret=7d1bb1a3 002f:trace:netapi32:NetApiBufferFree (0x1db890) 002f:Call ntdll.RtlFreeHeap(00110000,00000000,001db890) ret=7d1bc128 002f:Ret ntdll.RtlFreeHeap() retval=00000001 ret=7d1bc128 002f:Call KERNEL32.GetEnvironmentVariableW(7d1c91b0 L"HOME",001dea2e,00000000) ret=7d1beb18 002f:Ret KERNEL32.GetEnvironmentVariableW() retval=00000000 ret=7d1beb18 002f:Ret netapi32.NetUserGetInfo() retval=00000000 ret=00467e80 002f:Call wtsapi32.WTSFreeMemory(001dca70) ret=00467edd 002f:Call ntdll.RtlFreeHeap(00110000,00000000,001dca70) ret=7d16f194 002f:Ret ntdll.RtlFreeHeap() retval=00000001 ret=7d16f194 002f:Ret wtsapi32.WTSFreeMemory() retval=00175498 ret=00467edd 002f:Call netapi32.NetApiBufferFree(001dea00) ret=00467eee 002f:trace:netapi32:NetApiBufferFree (0x1dea00) 002f:Call ntdll.RtlFreeHeap(00110000,00000000,001dea00) ret=7d1bc128 002f:Ret ntdll.RtlFreeHeap() retval=00000001 ret=7d1bc128 002f:Ret netapi32.NetApiBufferFree() retval=00000000 ret=00467eee ... 002f:Call KERNEL32.WideCharToMultiByte(0000fde9,00000000,0032e66c L"20190426123655:INSTALL:UIx:INFORMATION:Error=UIx is not supported.\r\n\e8482\353e\7bccc\f7be\e72c2\353e\7bcc\e8182\6e7c\7bd1\6e7d\7bd1\0d60\7e39\0002",00000044,0032d914,00000d55,00000000,00000000) ret=004b058d 002f:Ret KERNEL32.WideCharToMultiByte() retval=00000044 ret=004b058d ... 002f:Call gdiplus.GdipMeasureString(01b05438,00190ec0 L"Installation program of Digital Photo Professional 4 requires administrator privileges.",ffffffff,0018e898,0032df7c,00190fe8,0032df8c,0032dfbc,0032dfb8) ret=004441a8 --- snip ---
Trace log doesn't reveal it, one has to debug the sub-installer.
--- snip --- ... 00467E69 | 8D85 D8FDFFFF | lea eax,dword ptr ss:[ebp-228] 00467E6F | 50 | push eax 00467E70 | 56 | push esi 00467E71 | 8D85 E0FDFFFF | lea eax,dword ptr ss:[ebp-220] 00467E77 | 50 | push eax 00467E78 | 6A 00 | push 0 00467E7A | FF15 00D44C00 | call dword ptr ds:[4CD400] ; NetUserGetInfo 00467E80 | 85C0 | test eax,eax 00467E82 | 75 15 | jne universalinstaller.467E99 00467E84 | 33C9 | xor ecx,ecx 00467E86 | 8B85 D8FDFFFF | mov eax,dword ptr ss:[ebp-228] 00467E8C | 8378 0C 02 | cmp dword ptr ds:[eax+C],2 ; ui->usri1_priv 00467E90 | 0F45F1 | cmovne esi,ecx 00467E93 | 89B5 D4FDFFFF | mov dword ptr ss:[ebp-22C],esi 00467E99 | C745 FC FEFFFFFF | mov dword ptr ss:[ebp-4],FFFFFFFE 00467EA0 | E8 27000000 | call universalinstaller.467ECC 00467EA5 | 85F6 | test esi,esi 00467EA7 | 0F95C0 | setne al 00467EAA | 8B4D F0 | mov ecx,dword ptr ss:[ebp-10] 00467EAD | 64:890D 00000000 | mov dword ptr fs:[0],ecx 00467EB4 | 59 | pop ecx 00467EB5 | 5F | pop edi 00467EB6 | 5E | pop esi 00467EB7 | 5B | pop ebx 00467EB8 | 8B4D E4 | mov ecx,dword ptr ss:[ebp-1C] 00467EBB | 33CD | xor ecx,ebp 00467EBD | E8 E6090300 | call universalinstaller.4988A8 00467EC2 | 8BE5 | mov esp,ebp 00467EC4 | 5D | pop ebp 00467EC5 | C3 | ret --- snip ---
The installer checks for 'USER_INFO_1.usri1_priv' == 'USER_PRIV_ADMIN' for current login session user. Wine initializes the field by default to zero ('USER_PRIV_GUEST'), hence the installer failure.
Wine source:
https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/netapi32/netapi32.c#l...
--- snip --- 2120 /************************************************************ 2121 * NetUserGetInfo (NETAPI32.@) 2122 */ 2123 NET_API_STATUS WINAPI 2124 NetUserGetInfo(LPCWSTR servername, LPCWSTR username, DWORD level, 2125 LPBYTE* bufptr) 2126 { 2127 NET_API_STATUS status; 2128 TRACE("(%s, %s, %d, %p)\n", debugstr_w(servername), debugstr_w(username), 2129 level, bufptr); 2130 status = NETAPI_ValidateServername(servername); 2131 if (status != NERR_Success) 2132 return status; 2133 2134 if(!NETAPI_IsLocalComputer(servername)) 2135 { 2136 FIXME("Only implemented for local computer, but remote server" 2137 "%s was requested.\n", debugstr_w(servername)); 2138 return NERR_InvalidComputer; 2139 } 2140 2141 if(!NETAPI_FindUser(username) && !NETAPI_IsCurrentUser(username)) 2142 { 2143 TRACE("User %s is unknown.\n", debugstr_w(username)); 2144 return NERR_UserNotFound; 2145 } 2146 2147 switch (level) 2148 { ... 2211 case 1: 2212 { 2213 static const WCHAR homedirW[] = {'H','O','M','E',0}; 2214 PUSER_INFO_1 ui; 2215 PUSER_INFO_0 ui0; 2216 /* sizes of the field buffers in WCHARS */ 2217 int name_sz, password_sz, home_dir_sz, comment_sz, script_path_sz; 2218 2219 password_sz = 1; /* not filled out for security reasons for NetUserGetInfo*/ 2220 comment_sz = 1; 2221 script_path_sz = 1; 2222 2223 /* get data */ 2224 status = NetUserGetInfo(servername, username, 0, (LPBYTE *) &ui0); 2225 if (status != NERR_Success) 2226 { 2227 NetApiBufferFree(ui0); 2228 return status; 2229 } 2230 name_sz = lstrlenW(ui0->usri0_name) + 1; 2231 home_dir_sz = GetEnvironmentVariableW(homedirW, NULL,0); 2232 /* set up buffer */ 2233 NetApiBufferAllocate(sizeof(USER_INFO_1) + 2234 (name_sz + password_sz + home_dir_sz + 2235 comment_sz + script_path_sz) * sizeof(WCHAR), 2236 (LPVOID *) bufptr); 2237 2238 ui = (PUSER_INFO_1) *bufptr; 2239 ui->usri1_name = (LPWSTR) (ui + 1); 2240 ui->usri1_password = ui->usri1_name + name_sz; 2241 ui->usri1_home_dir = ui->usri1_password + password_sz; 2242 ui->usri1_comment = ui->usri1_home_dir + home_dir_sz; 2243 ui->usri1_script_path = ui->usri1_comment + comment_sz; 2244 /* set data */ 2245 lstrcpyW(ui->usri1_name, ui0->usri0_name); 2246 NetApiBufferFree(ui0); 2247 ui->usri1_password[0] = 0; 2248 ui->usri1_password_age = 0; 2249 ui->usri1_priv = 0; 2250 GetEnvironmentVariableW(homedirW, ui->usri1_home_dir,home_dir_sz); 2251 ui->usri1_comment[0] = 0; 2252 ui->usri1_flags = 0; 2253 ui->usri1_script_path[0] = 0; 2254 break; 2255 } ... 2286 default: 2287 TRACE("Invalid level %d is specified\n", level); 2288 return ERROR_INVALID_LEVEL; 2289 } 2290 return NERR_Success; 2291 } --- snip ---
Microsoft documentation USER_INFO_1 structure:
https://docs.microsoft.com/en-us/windows/desktop/api/lmaccess/ns-lmaccess-_u...
--- quote --- typedef struct _USER_INFO_1 { LPWSTR usri1_name; LPWSTR usri1_password; DWORD usri1_password_age; DWORD usri1_priv; LPWSTR usri1_home_dir; LPWSTR usri1_comment; DWORD usri1_flags; LPWSTR usri1_script_path; } USER_INFO_1, *PUSER_INFO_1, *LPUSER_INFO_1;
...
usri1_priv
Type: DWORD
The level of privilege assigned to the usri1_name member. When you call the NetUserAdd function, this member must be USER_PRIV_USER. When you call the NetUserSetInfo function, this member must be the value returned by the NetUserGetInfo function or the NetUserEnum function. This member can be one of the following values. For more information about user and group account rights, see Privileges. Value Meaning
USER_PRIV_GUEST
Guest
USER_PRIV_USER
User
USER_PRIV_ADMIN
Administrator --- quote ---
$ sha1sum dppw4.10.20-installer.zip aee4adbecdf43108c4459a6344dbd3e678183e8b dppw4.10.20-installer.zip
$ du -sh dppw4.10.20-installer.zip 231M dppw4.10.20-installer.zip
$ wine --version wine-4.6-251-g8582615894
Regards