Click here to Skip to main content
15,900,511 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# Seeing Through Objects Pin
Dave Kreskowiak20-Sep-10 1:56
mveDave Kreskowiak20-Sep-10 1:56 
AnswerRe: C# Seeing Through Objects Pin
PIEBALDconsult20-Sep-10 3:12
mvePIEBALDconsult20-Sep-10 3:12 
QuestionReading a PDF File Pin
Anil Kumar.Arvapalli19-Sep-10 20:45
Anil Kumar.Arvapalli19-Sep-10 20:45 
AnswerRe: Reading a PDF File Pin
R. Giskard Reventlov19-Sep-10 20:49
R. Giskard Reventlov19-Sep-10 20:49 
Questionproblem reading from app.config Pin
Jassim Rahma19-Sep-10 6:23
Jassim Rahma19-Sep-10 6:23 
AnswerRe: problem reading from app.config Pin
Luc Pattyn19-Sep-10 7:00
sitebuilderLuc Pattyn19-Sep-10 7:00 
QuestionRe: problem reading from app.config Pin
i.j.russell19-Sep-10 20:58
i.j.russell19-Sep-10 20:58 
QuestionHow to use SetPortVal() and GetPortVal() of winio?? Pin
shushi.lin19-Sep-10 4:39
shushi.lin19-Sep-10 4:39 
In order to get pci devices on computer , I need to read/write 32 bit command to address 0xcf8 and 0xcfc.
I found the WINIO.dll can do this thing.
I wrote a following code to test function.
It can built without any error.
But the value return from 0xcfc never changed.
I can not find the explanation of the winio.
Please help me find out what's wrong with my code.
Thanks


[DllImport("winio.dll")]
public static extern bool InitializeWinIo();
[DllImport("winio.dll")]
public static extern bool GetPortVal(uint wPortAddr, ref uint pdwPortVal, byte bSize);
[DllImport("winio.dll")]
public static extern bool SetPortVal(uint wPortAddr, uint dwPortVal, byte bSize);
[DllImport("winio.dll")]
public static extern void ShutdownWinIo();

uint Bus_No,Dev,Func,VID,DID,count=0;
uint Rt_Val=0x00;

for (Bus_No = 0; Bus_No < 15; Bus_No++)
{
for (Dev = 0; Dev < 32; Dev++)
{
for (Func = 0; Func < 8; Func++)
{
uint Val = 0x80000000 + (Bus_No << 16) + (Dev << 11) + (Func << 8);
SetPortVal(0xcf8, Val, 4);
GetPortVal(0xcfC,ref Rt_Val, 4);
if (Rt_Val != 0xffffffff)
{
count++;
VID = Rt_Val & 0xffff;
DID = (Rt_Val >> 16) & 0xffff;

MessageBox.Show("VID" + VID);

pcitest.Text = Convert.ToString(VID);
if (Func == 0)
{
Val = (Val & 0xfffffff0) + 0x0c;
SetPortVal(0xcf8, Val, 4);
GetPortVal(0xcfc, ref Rt_Val, 4);
Rt_Val = Rt_Val >> 16;
if ((Rt_Val & 0x80) == 0) Func = 8;
}

}
}

}
AnswerRe: How to use SetPortVal() and GetPortVal() of winio?? Pin
Dave Kreskowiak19-Sep-10 7:24
mveDave Kreskowiak19-Sep-10 7:24 
QuestionTCP Header structure Pin
95ulisse19-Sep-10 3:02
95ulisse19-Sep-10 3:02 
AnswerRe: TCP Header structure Pin
Dave Kreskowiak19-Sep-10 7:21
mveDave Kreskowiak19-Sep-10 7:21 
GeneralRe: TCP Header structure Pin
95ulisse19-Sep-10 9:08
95ulisse19-Sep-10 9:08 
GeneralRe: TCP Header structure Pin
Dave Kreskowiak19-Sep-10 9:56
mveDave Kreskowiak19-Sep-10 9:56 
QuestionPInvoke Pin
Saksida Bojan19-Sep-10 0:08
Saksida Bojan19-Sep-10 0:08 
AnswerRe: PInvoke Pin
Luc Pattyn19-Sep-10 3:23
sitebuilderLuc Pattyn19-Sep-10 3:23 
GeneralRe: PInvoke Pin
Saksida Bojan19-Sep-10 3:59
Saksida Bojan19-Sep-10 3:59 
AnswerRe: PInvoke Pin
Luc Pattyn19-Sep-10 4:16
sitebuilderLuc Pattyn19-Sep-10 4:16 
QuestionWhy i get an exception on this code ? ( code attached ) Pin
Yanshof18-Sep-10 21:53
Yanshof18-Sep-10 21:53 
AnswerRe: Why i get an exception on this code ? ( code attached ) Pin
Paul Michalik18-Sep-10 23:32
Paul Michalik18-Sep-10 23:32 
GeneralRe: Why i get an exception on this code ? ( code attached ) Pin
Yanshof18-Sep-10 23:49
Yanshof18-Sep-10 23:49 
AnswerRe: Why i get an exception on this code ? ( code attached ) Pin
Saksida Bojan19-Sep-10 1:19
Saksida Bojan19-Sep-10 1:19 
AnswerRe: Why i get an exception on this code ? ( code attached ) Pin
Manfred Rudolf Bihy19-Sep-10 22:11
professionalManfred Rudolf Bihy19-Sep-10 22:11 
Questionexcel import wizard (fixed line) Pin
eyeshield2118-Sep-10 15:16
eyeshield2118-Sep-10 15:16 
QuestionAnyone have an RDLC Example with SQL Server 2008 R2 Pin
gmhanna18-Sep-10 7:01
gmhanna18-Sep-10 7:01 
AnswerRe: Anyone have an RDLC Example with SQL Server 2008 R2 Pin
Mycroft Holmes18-Sep-10 17:16
professionalMycroft Holmes18-Sep-10 17:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.