Modify

Opened 16 years ago

Closed 16 years ago

#1453 closed Bug (Fixed)

_Net_Share_ShareCheck() always returns 0

Reported by: PsaltyDS Owned by: J-Paul Mesnage
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, 16 years ago

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 J-Paul Mesnage, 16 years ago

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 J-Paul Mesnage, 16 years ago

@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, 16 years ago

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 J-Paul Mesnage, 16 years ago

Milestone: 3.3.7.0
Owner: changed from Gary to J-Paul Mesnage
Resolution: Fixed
Status: newclosed

Fixed by revision [5866] in version: 3.3.7.0

Modify Ticket

Action
as closed The owner will remain J-Paul Mesnage.

Add Comment


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