﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
3632	The second parameter for _Net_Share_ShareCheck is incorrectly documented and inconsistent with related functions	Bob Anthony	Jpm	"Per the documentation, the second parameter for _Net_Share_ShareCheck is a share name. This would be consistent with the related functions; ShareAdd, ShareDel, ShareGetInfo. However, when given a share name the function returns -1 with extended 2311. The example script in the help file for this function fails when you comment the ShareDel line and run the script a second time.

I found that this function requires the share path to functions as expected. The code below shows that when given a share name the function returns -1. Swapping lines 6 and 7 shows that it functions as expected when passed the local path gathered from ShareGetInfo.

{{{
#include <NetShare.au3>

$sComputerName = @ComputerName
$aInfo = _Net_Share_ShareEnum($sComputerName)
For $iI = 1 To $aInfo[0][0]
	;If CheckShareByName($sComputerName, $aInfo[$iI][0]) = -1 Then
	If _Net_Share_ShareCheck ($sComputerName, $aInfo[$iI][0]) = -1 Then
		ConsoleWrite(""Share "" & $aInfo[$iI][0] & "" does not exist"" & @CRLF)
	Else
		ConsoleWrite(""Share Name: "" & $aInfo[$iI][0] & @CRLF)
		ConsoleWrite(""Share Type: "" & _Net_Share_ResourceStr($aInfo[$iI][1]) & @CRLF)
		ConsoleWrite(""Share Path: "" & $aInfo[$iI][6] & @CRLF & @CRLF)
	EndIf
Next

Func CheckShareByName($sServer, $sShareName)
	Local $aReturn = _Net_Share_ShareGetInfo($sServer, $sShareName)
	If @error Then Return SetError(@error, 0, -1)
	Return _Net_Share_ShareCheck($sServer, $aReturn[6])
EndFunc
}}}"	Bug	closed	3.3.15.1	Standard UDFs	3.3.14.5	None	Fixed	NetShare.au3	
