Modify

#1453 closed Bug (Fixed)

_Net_Share_ShareCheck() always returns 0

Reported by: PsaltyDS Owned by: Jpm
Milestone: 3.3.7.0 Component: Standard UDFs
Version: 3.3.4.0 Severity: None
Keywords: Cc:

Description

Something broke _Net_Share_ShareCheck(). I have a broken script that used to work because now all share types, even non-existent, return 0. Zero is a valid return for $STYPE_DISKTREE, but other types (i.e. the IPC$ share) have other values and non-existent should return -1.

In this demo, compare result on console to col. 1 of array from _Net_Share_ShareEnum(), which still works correctly:

#include <NetShare.au3>
#include <Array.au3>

$aShares = _Net_Share_ShareEnum(@ComputerName)
For $n = 1 To UBound($aShares) - 1
    $iCheck = _Net_Share_ShareCheck(@ComputerName, $aShares[$n][0])
    ConsoleWrite("Share: " & $aShares[$n][0] & "; Check = " & $iCheck & @LF)
Next
ConsoleWrite(@LF & "Share: NoSuchShare; Check = " & _Net_Share_ShareCheck(@ComputerName, "NoSuchShare") & @LF)
_ArrayDisplay($aShares, "")

Tested against Beta 3.3.5.1 with no change.

Attachments (0)

Change History (5)

comment:1 by Jon, on Feb 14, 2010 at 5:31:49 PM

Anybody got a clue about this one? Even if I change NetShare.au3 to the oldest version I get the same results.

comment:2 by Jpm, on May 9, 2010 at 6:32:19 AM

The _Net_Share_ShareCheck() return @extended= 2311 indicating that the requested share is not shared!!!
I test it under Win7 perhaps a BUG at MS Side

comment:3 by Jpm, on Jun 3, 2010 at 8:23:22 AM

@PsaltyDS
can you check with the modified script and report the extended values?
Thanks

#include <NetShare.au3>
#include <Array.au3>

$aShares = _Net_Share_ShareEnum(@ComputerName)
For $n = 1 To UBound($aShares) - 1
    $iCheck = _Net_Share_ShareCheck(@ComputerName, $aShares[$n][0])
    ConsoleWrite("Share: " & $aShares[$n][0] & "; Check = " & $iCheck & " @extended = " & @extended & @LF)
Next
ConsoleWrite(@LF & "Share: NoSuchShare; Check = " & _Net_Share_ShareCheck(@ComputerName, "NoSuchShare") & " @extended = " & @extended & @LF)
_ArrayDisplay($aShares, "")

in reply to:  3 comment:4 by anonymous, on Jun 4, 2010 at 9:56:01 PM

Replying to Jpm:

@PsaltyDS
can you check with the modified script and report the extended values?
Thanks

On two Vista workstations with different share configs, I get Check = 0 @extended = 2311 on every share. Same with Administrator or user.

On the Server 2003 environment of my original problem which has over 40 shares, they all show Check = 0, and most show @extended = 2311. But some show @extended = 0 (12 out of 43 to be exact).

I don't see any clear difference between the ones that show @extended = 0 on the server and the rest, except that all (4) of the mapped drives default shares (i.e. C$) show @extended = 0.

comment:5 by Jpm, on Jun 5, 2010 at 8:44:55 AM

Milestone: 3.3.7.0
Owner: changed from Gary to Jpm
Resolution: Fixed
Status: newclosed

Fixed by revision [5866] in version: 3.3.7.0

Modify Ticket

Action
as closed The owner will remain Jpm.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.