Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than winspool, prefix the name with the module name and a period.
public static extern int EnumPrintProcessorDatatypesA(string pName, string pPrintProcessorName, int Level, ref byte pDatatypes, int cdBuf, ref int pcbNeeded, ref int pcRetruned)
VB Signature:
Declare Function EnumPrintProcessorDatatypes Lib "winspool.drv" Alias "EnumPrintProcessorDatatypesA" (ByVal pName As String, ByVal pPrintProcessorName As String, ByVal Level As Integer, ByRef pDatatypes As Byte, ByVal cdBuf As Integer, ByRef pcbNeeded As Integer, ByRef pcRetruned As Integer) As Integer
User-Defined Types:
None.
Alternative Managed API:
Do you know one? Please contribute it!
Notes:
None.
Tips & Tricks:
Please add some!
Sample Code:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct DataTypesInfo {
[MarshalAs(UnmanagedType.LPTStr)]
public string Name;
}
public static class PrintProcessor {
public enum ServerEnvironment{
X86,
X64,
Ia64,
Local,
}
//first call gets the number of bytes and structures needed - it must return an ErrorInsufficientBuffer error
if (EnumPrintProcessorDatatypes(serverName, printProcessorName, 1, IntPtr.Zero, 0, ref bytesNeeded, ref numStructsReturned)) {
return null;
}
int lastWin32Error = Marshal.GetLastWin32Error();
if (lastWin32Error == ErrorInsufficientBuffer) {
IntPtr rawBuffer = Marshal.AllocHGlobal((int)bytesNeeded);
try {
if (EnumPrintProcessorDatatypes(serverName, printProcessorName, 1, rawBuffer, bytesNeeded, ref bytesNeeded, ref numStructsReturned)) {
var dataTypesInfoArray = new DataTypesInfo[numStructsReturned];
int offset = rawBuffer.ToInt32();
Type type = typeof(DataTypesInfo);
int increment = Marshal.SizeOf(type);
for (int i = 0; i < numStructsReturned; i++) {
dataTypesInfoArray[i] = (DataTypesInfo)Marshal.PtrToStructure(new IntPtr(offset), type);
offset += increment;
}
var retStrings = new List<string>();
foreach (var dataTypeInfo in dataTypesInfoArray) {
retStrings.Add(dataTypeInfo.Name);
}
return retStrings;
}
} finally {
Marshal.FreeHGlobal(rawBuffer);
}
//lastWin32Error = Marshal.GetLastWin32Error();
}
//if I get here - it's an error, so...
return null;
}
private static string GetEnvironmentString(ServerEnvironment environment) {
switch (environment) {
case ServerEnvironment.X86:
return "Windows x86";
case ServerEnvironment.X64:
return "Windows x64";
return "Window x64";
case ServerEnvironment.Ia64:
return "Windows IA64";
case ServerEnvironment.Local:
return string.Empty;
}
//not really needed, but...
return string.Empty;
}
}
List supported datatypes of printer
10/28/2014 3:39:48 PM - -12.10.115.129
ByVal is a VB keyword that specifies a variable to be passed as a parameter BY VALUE. In other words, if the function or sub changes the value of the internal variable, it does not change the value of the external variable that was passed to it.
4/25/2007 3:19:55 AM - josep1er@cmich.edu-141.209.229.179
ByVal is a VB keyword that specifies a variable to be passed as a parameter BY VALUE. In other words, if the function or sub changes the value of the internal variable, it does not change the value of the external variable that was passed to it.
4/25/2007 3:19:55 AM - josep1er@cmich.edu-141.209.229.179
ByVal is a VB keyword that specifies a variable to be passed as a parameter BY VALUE. In other words, if the function or sub changes the value of the internal variable, it does not change the value of the external variable that was passed to it.
4/25/2007 3:19:55 AM - josep1er@cmich.edu-141.209.229.179
ByRef is a VB keyword that specifies a variable to be passed as a parameter BY REFERENCE. In other words, the pointer to the variable is passed and any change to its value made within the function or sub will change its value outside the function/sub.
4/25/2007 3:19:29 AM - anonymous
ByVal is a VB keyword that specifies a variable to be passed as a parameter BY VALUE. In other words, if the function or sub changes the value of the internal variable, it does not change the value of the external variable that was passed to it.
4/25/2007 3:19:55 AM - josep1er@cmich.edu-141.209.229.179
ByRef is a VB keyword that specifies a variable to be passed as a parameter BY REFERENCE. In other words, the pointer to the variable is passed and any change to its value made within the function or sub will change its value outside the function/sub.
4/25/2007 3:19:29 AM - anonymous
ByRef is a VB keyword that specifies a variable to be passed as a parameter BY REFERENCE. In other words, the pointer to the variable is passed and any change to its value made within the function or sub will change its value outside the function/sub.
4/25/2007 3:19:29 AM - anonymous
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).